Board index » delphi » How to merge two bmp images and save it into one
Marcos
![]() Delphi Developer |
Marcos
![]() Delphi Developer |
How to merge two bmp images and save it into one2004-09-08 08:00:43 AM delphi40 Hello friends: Please help. can some body provide small sample code on how to merge two images bmp then save it into one single bmp file. for example: I have two images of a check front and back I want to merge these two images into one single bmp under a sinlgle file bmp. Thank you very much in advance Marcos |
Wayne Herbert
![]() Delphi Developer |
2004-09-08 10:02:22 AM
Re:How to merge two bmp images and save it into one
Marcos writes:
QuoteHello friends: that you have loaded. You have an output bitmap, Both, that holds each image. Then: // stack two images top to bottom in a single bitmap var Chk1, Chk2, Both : TBitmap begin <load up the front and back check images into their bitmaps> Both := TBitmap.Create; If Chk1.Width>Chk2.Width then Both.Width := Chk1.Width else Both.Width := Chk2.Width; Both.Height := Chk1.Height + Chk1.Height; Both.Canvas.CopyRect(Rect(0,0,Chk1.Width,Chk1.Height), Chk1.Picture.Bitmap.Canvas,Rect(0,0,Chk1.Width,Chk1.Height)); Both.Canvas.CopyRect(Rect(0,Chk1.Height,Chk2.Width,Chk2.Height), Chk2.Picture.Bitmap.Canvas,Rect(0,0,Chk2.Width,Chk2.Height)); Both.SaveToFile('s:\temp\wowza.bmp'); Both.Free.Free; |
Marcos
![]() Delphi Developer |
2004-09-09 01:15:35 AM
Re:How to merge two bmp images and save it into one
Mr.Wayne Herbert,
Thank you very much for your fast response, I try the code you provided and it works GREAT!!!! Once again thank you sir, I appreciated your help Marcos "Wayne Herbert" <XXXX@XXXXX.COM>writes QuoteMarcos writes: |