Recent

Author Topic: SOLVED: BGRABitmap drawing png file on image  (Read 281 times)

SaraT

  • Jr. Member
  • **
  • Posts: 86
  • A little student
SOLVED: BGRABitmap drawing png file on image
« on: March 27, 2020, 11:11:01 pm »
hello, I would like to draw any png (transparent) logo/text on any corner of an image
like the example attached. It is like a watermark on a image.

Can you provide me any function? Please.

Many thanks
« Last Edit: March 29, 2020, 04:02:39 am by SaraT »

winni

  • Hero Member
  • *****
  • Posts: 1782
Re: BGRABitmap drawing png file on image
« Reply #1 on: March 27, 2020, 11:29:12 pm »
Hi!

Not a big trick:
Code: Pascal  [Select][+][-]
  1. Form1 = class (TForm)
  2. ...
  3. Img: TImage;
  4. ...
  5. end;
  6.  
  7. procedure TForm1.FourCorners(logo: TBGRAbitmap);
  8. var wi,hi : integer;
  9. begin
  10. wi := logo.width;
  11. hi := logo.height;
  12. Logo.Draw (0,0,img.picture.bitmap.canvas, false); // TopLeft
  13. Logo.Draw (img.width - wi,0,img.picture.bitmap.canvas, false); // TopRight
  14. Logo.Draw (img.width - wi,  img.height-hi, img.picture.bitmap.canvas, false); //BottomRight
  15. Logo.Draw (0,  img.height-hi,  img.picture.bitmap.canvas, false); //BottomLeft
  16. end;
  17.  

Winni


 

TinyPortal © 2005-2018