Oliver Bleckmann
just a hint, but I sugest you to dive into the options of the graphics object! you will need to set some options for better image quality like shown below (just an example). and, you should probably print from the source of your image box, e.g. by loading the hopefully "high quality" source into a bitmap. remember, screen elements on windows are drawn 96dpi (default) only (maybe still 72dpi mac os!?). so printing them at 300dpi on paper will result in either very small pictures or (bad) resized and blur images. further more you will have to bother with blurry results esp. blurry fonts, this may relate to an issue to be found under the keyword SnapsToDevicePixels (e.g. on WPF UIElements) because a pixel may have device specific dimensions. same for saving images (see encoder parameters). having written my own printing module I can tell you, printing is no easy job.
//use a graphics object to draw the resized image into the bitmap
using (Graphics graphics = Graphics.FromImage(result))
{
//set the resize quality modes to high quality
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality
//draw the image into the target bitmap
graphics.DrawImage(image, 0, 0, result.Width, result.Height);
}
еще одна вещь, не рисуйте в дюймовом тесте с некоторыми родными единицами, такими как
GraphicsUnit.Pixel
(Я думаю, что это подразумевает snaptodevicepixel) см.
http://msdn.microsoft.com/de-de/library/system.drawing.graphicsunit(v=против 110).aspx[
^]