Windows Develop Bookmark and Share   
 index > Windows Forms General > Large file sent to printer when printing .gif files
 

Large file sent to printer when printing .gif files

Hello all,

I am able to print .gif files successfully using the code below inthe PrintPageEventHandler event.

Image img = System.Drawing.Bitmap.FromFile(@"D:\TestLabel.gif");

e.Graphics.DrawImage(img, rf);

The actual .gif file is about 50kb. However, when printing, about 1.5mb of data gets sent to the printer, so it takes a few seconds to print out. Is there a way to decrease the file size sent to the printer? Thank you.

TL

userxid  Tuesday, January 02, 2007 9:50 PM
Bitmap.FromFile() unpacks the .gif into a native, potentially very large Windows bitmap. This needs to work like this because neither GDI nor the printer driver know anything about compressed bitmap formats. One way to try to limit the size of the data sent to the printer might be PageSettings.Resolution. Try setting it to PrintResolutionKind.Low and see what happens...
nobugz  Wednesday, January 03, 2007 1:49 PM
Bitmap.FromFile() unpacks the .gif into a native, potentially very large Windows bitmap. This needs to work like this because neither GDI nor the printer driver know anything about compressed bitmap formats. One way to try to limit the size of the data sent to the printer might be PageSettings.Resolution. Try setting it to PrintResolutionKind.Low and see what happens...
nobugz  Wednesday, January 03, 2007 1:49 PM

You can use google to search for other answers

Custom Search

More Threads

• simulating mobile phone control
• Change appearance of scrollbars of a control
• Converting RTF into plain text
• problem in closing a form ????????
• How can I handle this situation, MDIForm, RichTextBox, Datagrid in .net 2003?
• What about Application Forms ??
• Validation control box
• Help with threading
• Calculate size of each tabpage
• Clicking doesn't bring MDI windows to the front!