You have to provide the image before drawing it on the PrintPreview's canvas. As a simple solution, you can put an invisible DBImage on the form and use it for retrieving image from the database.
By the way, TPrintPreview is a low level printing tool, and you might not consider it as a report generator.
I managed to create the DBImage and it works fine. Now I need to transfer this image to PrintPreview so that I can zoom, rotate and print the image. How do I do it from here?
POGEE Systems & Technologies
Home of Affordable Solutions
Now, DBImage1.Picture.Graphic contains the image, and you can use this property and one of PaintGraphic, PaintGraphcEx, or PaintGraphicEx2 methods of PrintPreview to draw the image on the PrintPreview's canvas.
Note: if DBImage1 has no image, DBImage1.Picture.Graphic could be nil. Therefore, you should check this condition otherwise you'll get an AV.
Now All I need to do is to be able to zoom (resize), rotate and print the image. I know you will hear from me about this but let me do a little work and study your component a little more.
Thanks again
POGEE Systems & Technologies
Home of Affordable Solutions
DbImage1.Picture.Width and DBImage1.Picture.Height as X and Y parameters are wrong. PaintGraphic works like Draw method of a Canvas.
For resizing the image you can use PaintGraphicEx method instead of PaintGraphic. PaintGraphicEx works more or less like StretchDraw method of the canvas.