Autor Beitrag
Jungsta
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Xp
Delphi 7 Pers.
BeitragVerfasst: Sa 04.08.07 18:26 
Hallo!
Ich habe versuchteine Bitmap transparent, mit einer bestimmten
Größe und Position, in eine andere Bitmap einzufügen.

ausblenden Ich habe es schon mal so probiert:
1:
2:
3:
4:
5:
Bmp1.LoadFromFile(FileName1);Bmp2.LoadFromFile(FileNAme2);
Bmp2.TransparentColor := clwhite;
Bmp2.Transparent := true;
Bmp2.Canvas.Draw(20, 20, Bmp1);
Image1.Picture.Bitmap := Bmp1;


Leider kann ich hier nicht die Größe und die Transparenz einstellen :cry: .
Schon mal danke im voraus.

_________________
Erst denken,
dann handeln!!!
Jann1k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 866
Erhaltene Danke: 43

Win 7
TurboDelphi, Visual Studio 2010
BeitragVerfasst: Sa 04.08.07 19:14 
mach aus

ausblenden Delphi-Quelltext
1:
Bmp2.Canvas.Draw(20, 20, Bmp1);					



ausblenden Delphi-Quelltext
1:
Bmp1.Canvas.Draw(20, 20, Bmp2);					


und zum einstellen der größe benutze die prozedur copyrect
Jungsta Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Xp
Delphi 7 Pers.
BeitragVerfasst: Sa 04.08.07 20:16 
Und wie könnte es mit der Transparenz klappen?

Schuldigung wenn ich frage, aber ich kapier nicht
wirklich wie ich das mit dem CopyRect anstellen soll. :oops: :oops:

_________________
Erst denken,
dann handeln!!!
Jungsta Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win Xp
Delphi 7 Pers.
BeitragVerfasst: So 12.08.07 16:06 
Hallo nochmal!!!!!!
Ich schaffe es jetzt die Bitmap in die Bitmap zu "malen":
ausblenden So mache ich es jetzt:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button1Click(Sender: TObject);
var Bmp1, Bmp2: TBitmap;
begin
Bmp1 := TBitmap.Create;
Bmp2 := TBitmap.Create;
OpenDialog1.Execute;
Bmp1.LoadFromFile(OpenDialog1.FileName);
OpenDialog1.Execute;
Bmp2.LoadFromFile(OpenDialog1.FileName);
Bmp2.Canvas.StretchDraw(Rect(0, 0, 100, 100), Bmp2);
Bmp2.Width := 100;
Bmp2.Height := 100;
Bmp1.Canvas.Draw(50, 50, Bmp2);
Image1.Picture.Bitmap := Bmp1;
end;


Aber wie kriege ich das mit der Transparenz hin?

_________________
Erst denken,
dann handeln!!!
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 12.08.07 16:12 
Du könntest anstatt die Bitmap direkt hinein zu zeichnen, Pixel für Pixel per Scanline durchgehen und dann mithilfe dieser Funktion die Mischfarbe berechnen, um eine Transparenz "vorzugaukeln".

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot