How can I process an image in .NET for full page printing at a quality like Windows Photo Gallery?

I write print routing in C # using the .NET PrintDocument class, handling the OnPrintPage event.

I managed to maximize the margins and print the image in landscape mode, but it just doesn’t look as good as printing the same image file from the Windows Photo / Photo Album (formerly Windows Picture and Fax Viewer), the default image preview program in Windows Vista

I noticed the Sharpen Image for Printing option , but what does it do?

I thought about first printing copies of the image from the Windows photo album, and then sending sheets through the printer a second time to print the custom overlays that I need, but it's hard to make it line up every time, because the printer sucks the sheet without the necessary accuracy ... so I really need ALL the drawing commands inside C #, including the image.

Does anyone know how to pre-process a bitmap so that it prints as well as Windows Photo Gallery does? Are there any simple print drivers that can intercept photo gallery print output as a standard image file (bmp, png, etc.) that can be read by the .NET Image class? I am here for creativity.

+3
source share
2 answers

Paint.Net uses the Windows image and fax viewer to print it, and it was previously open source.

The quick Google for the “Paint.Net source” seems to activate it, albeit in earlier incarnations, before they shut it down again. I would look at their source and see how they cause dialogue

+1
source

If you are trying to make a small image and print a large version of it, this can help create a larger version of your image in memory and then print this larger version. Typically, you do this:

Bitmap largeBitmap = new Bitmap(800, 600);
using (Graphics g = Graphics.FromImage(largeBitmap))
{
    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
    g.DrawImage(smallImage ...) // I forget which of the 30 
        // overloads you need here
}
// then print largeBitmap

GDI + ; . "" , , , , .

0

Source: https://habr.com/ru/post/1717957/


All Articles