Recent

Author Topic: printing an image with text on it  (Read 3391 times)

dfspannie

  • New Member
  • *
  • Posts: 24
printing an image with text on it
« on: March 04, 2012, 12:26:54 am »
I have a problem printing an image with text on it. The image is  inside a scrollbox on a form, the image being too large to just put on the form. I tried printing it using various methods.
stretchdraw only prints the image, not the text.
copyrect only prints the part visible on the screen .
I've searched the forum and the web, but all the solutions I've found seems to deal only with images that are completely visible.

Any ideas ?

Thanks in advance.

Lazarus 0.9.30.2
FPC 2.4.4
Win XP/vista/7

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: printing an image with text on it
« Reply #1 on: March 04, 2012, 01:57:36 am »
Easier with TPaintBox. But also mistake you are making is propably drawing into TImage.Canvas. You should be drawing into its permanent memory, that is somewhere under TImage.Picture.Bitmap.Canvas. This may not be the case though with PNG or JPG.

dfspannie

  • New Member
  • *
  • Posts: 24
Re: printing an image with text on it
« Reply #2 on: March 04, 2012, 08:19:14 am »
 :D Thanks.
changed jpeg to bmp and image1.canvas to image1.picture.bitmap.canvas.
problem solved.

 

TinyPortal © 2005-2018