When i am trying to print an image to a printer for a 700kb file it is sending 120MB of data over to the printer. I can see this because I see the printer spooling 120MB. why would this happend?
Here is the code for the PrintDocument.PrintPage
private void PrintPage(object sender, PrintPageEventArgs ev)
{
sw.WriteLine("start,PrintPage," + DateTime.Now.ToLongTimeString());
if (_running && _currentPage != null)
{
RectangleF PrintArea = ev.Graphics.VisibleClipBounds;
RectangleF NewImageSize = new RectangleF();
Double SF = Convert.ToDouble(PrintArea.Width) / Convert.ToDouble(_currentPage.Width);
NewImageSize.Width = Convert.ToInt32(_currentPage.Width * SF);
NewImageSize.Height = Convert.ToInt32(_currentPage.Height * SF);
//You can influence the quality of the resized image
ev.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
ev.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
ev.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Default;
//Draw the image to the printer
ev.Graphics.DrawImage(_currentPage, NewImageSize);
_currentPage.Dispose();
_currentPage = null;
//Trace.WriteLine(string.Format("IsFinished {0}, Count {1}", (_queue.IsFinished ? "True" : "False"), _queue.Count));
ev.HasMorePages = (!((_queue.IsFinished) && (_queue.Count == 0)));
}
sw.WriteLine("end,PrintPage," + DateTime.Now.ToLongTimeString());
}