Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi,

I have a images in database .

i want to print the images in whole (A4) paper with the size of 180*100 px.

i am looking for windows form with c# codes
Posted
Comments
[no name] 28-Jun-13 13:03pm    
http://www.codeproject.com/Answers/610076/printingplusmultipleplusimages#answer1
Sergey Alexandrovich Kryukov 28-Jun-13 13:48pm    
What you need is not "looking", but writing the code. What's the problem?
—SA

1 solution

This is easily done by using System.Drawing.Printing.PrintDocument:
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx[^].

To print the image itself, you will need to use one of the System.Drawing.Graphics.DrawImage methods, those which allows you to choose required rectangle size. Please see:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^].

Make sure you select the image size matching the page size in pixel, which will be available to you during runtime. In this case, the DrawImage method will resample the image for you, automatically. Just do you math on size and location.

—SA
 
Share this answer
 
Comments
CPallini 28-Jun-13 14:55pm    
5.
Sergey Alexandrovich Kryukov 28-Jun-13 17:11pm    
Thank you, Carlo.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900