DelphiFAQ Home Search:

How to print an image (JPEG, BMP.. any)

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

How can I print a TGraphic, especially an image?

Answer:

You need to use the global Printer instance from unit Printers - see the code below:

uses 
  Printers; 

procedure PrintBitmap(aGraphic: TGraphic; Title: string); 
begin { PrintBitmap } 
  Printer.Title := Title; 
  Printer.BeginDoc; 
  Printer.Canvas.Draw(0, 0, aGraphic); 
  Printer.EndDoc
end; { PrintBitmap } 
You don't like the formatting? Check out SourceCoder then!
Content-type: text/html

Comments:

2006-02-10, 07:20:21
anonymous from India  
what format the bit image is printing
can i dble to retrive the data from the hex codes of that image
2012-05-16, 06:24:14
sunila77@gmail.com from Delhi, India  
I have a JPEG file which I am able to print . However when I send this image to someone who needs this, he is not able to print it. Could you please help.

Sunila Singh
2012-05-16, 17:22:50
OJAS from United States  
.bmp format can be opened in paint or photoshop

http://en.wikipedia..e_formats

Sunil, you may get spammed if you post your email address in public domains. Safer to use something like Delhi Daredevil

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: