Heesu
asked on
overlay two bitmap images
Does anyone know how to overlay a bitmap image on the another one?
Thanks,
Heesu.
Thanks,
Heesu.
Hi there,
you can use the CopyRect function of a Canvas, and set the Canvas.CopyMode to the desired effect (XOR, OR, etc...) :
procedure TForm1.Cut1Click(Sender: TObject);
var
ARect: TRect;
begin
Copy1Click(Sender); { do the same thing as the copy menu item }
with Image.Canvas do
begin
CopyMode := cmWhiteness;
ARect := Rect(0, 0, Image.Width, Image.Height);
CopyRect(ARect, Image.Canvas, ARect);
CopyMode := cmSrcCopy; { restore the copy mode }
end;
end;
HTH,
Stef
you can use the CopyRect function of a Canvas, and set the Canvas.CopyMode to the desired effect (XOR, OR, etc...) :
procedure TForm1.Cut1Click(Sender: TObject);
var
ARect: TRect;
begin
Copy1Click(Sender); { do the same thing as the copy menu item }
with Image.Canvas do
begin
CopyMode := cmWhiteness;
ARect := Rect(0, 0, Image.Width, Image.Height);
CopyRect(ARect, Image.Canvas, ARect);
CopyMode := cmSrcCopy; { restore the copy mode }
end;
end;
HTH,
Stef
ASKER
My BaseImage has color in it.
OverlayImage has WhiteandBlack.
I want to show black lines only of OverlayImage on the BaseImage.
Not just cover the BaseImage.
TviGep:
Sorry, I am not an expert.
Can you show me any example in detail.
about Copy1Click and etc.
Thanks,
Heesu.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Slick812:
Thanks a lot.
That's what I wanted to see.
Heesu.
Thanks a lot.
That's what I wanted to see.
Heesu.
Place two TImage components on a form, load bitmaps to them and try this:
procedure TForm1.Button1Click(Sender
begin
Image1.Picture.Bitmap.Canv
end;
Regards, Geo