Autor Beitrag
FatalError
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WIN ME
D6 Pers
BeitragVerfasst: Mi 24.12.03 00:14 
Hi,

wie kann man zwei Bitmaps ineinander kopieren?

Denn, Bitmaps in einzelnen images zu öffnen und dann jedes Image einzeln über den Bildschirm zu schieben find ich eeeein biiisscheeeeen laaaaaangsaaaaam...

Grüße
Andy :wink:
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: Mi 24.12.03 00:41 
Ich weiss jetzt nicht genau was du meinst aber z.B.:
Image1.Picture.Bitmap.Canvas.Draw(X, Y, Image2.Picture.Graphic);kopiert Image2 in Image1 bei (X,Y).
Image1.Picture.Bitmap.Canvas.CopyRect(DestRect, Image2.Picture.Bitmap.Canvas, SourceRect);kopiert einen AUsschnitt (SourceRect) aus dem Image2 in einen Ausschnitt (DestRect) in Image1.

Viele Grüsse.
FatalError Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WIN ME
D6 Pers
BeitragVerfasst: Sa 27.12.03 18:30 
Hi,

danke erstmal für die Vorschläge, ist aber nicht ganz das worauf ich hinaus will.. :?

Gibt es denn eine Möglichkeit, nicht über das jeweilige image zu gehen, sondern direkt die bmps ineinander zu kopieren?

Ich hab in meiner Unit ein bmp 'Backpuffer' neu erstellt, und will jetzt in diesen ein anderes bmp hineinkopieren, BEVOR ich den Backpuffer in ein image zeichne!

Grüße
Andy
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: So 28.12.03 00:34 
Backpuffer_Bitmap.Canvas.CopyRect(DestRect, Anderes_Bitmap.Canvas, SourceRect); ...oder was ?

Viele Grüsse.
FatalError Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WIN ME
D6 Pers
BeitragVerfasst: So 28.12.03 18:17 
Jaaa, daas sieht gut aus!

Welche Bedeutung hat hier DestRect?

Das ist vom Typ Rect, aber wie kann ich dem dann integer-Werte des Rechtecks zuweisen?

Grüße
Andy :D
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: So 28.12.03 22:37 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
  Rect: TRect;
begin
  Rect.Left := 37;
  Rect.Top := 25;
  Rect.Right := 232;
  Rect.Bottom := 555;

...

end;

Viele Grüsse.
DestRect ist das "Ziel"-Rechteck, in das du dein Bitmap kopierst (also das Rechteck des Zielitmaps, das mit dem anderen Bitmap überschrieben wird). Einfach probieren ;)
FatalError Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

WIN ME
D6 Pers
BeitragVerfasst: Mo 29.12.03 01:46 
Hey Danke!!! :D :D genau das hab ich gesucht, mit typen wie TRect konnt ich vorher nichts anfangen, aber jetzt klappts!!

Viele Grüße
Andy :lol: