简体   繁体   中英

Print with GDI+ has no effect

I added GDI+ to my Win32 Application for drawing gradients quite a while ago. I worked around some problems considering mixed GDI and GDI+ output and everything works fine.

Now i started to use GDI+ also for printing, but all calls to GDI+ seem to be ignored, that work fine on screen. I double checked that there is no clipping region. Also the coordinates are on paper. I also eliminated all GDI output for testing. Still a blank page is shown. I tried several printers. A test with the GDI+ printing samples works without problems. I added the code used in my application to the sample, and it also works without problems.

Any idea?

I recently had a similar problem - creating a Graphics object from a DC applied a scaling factor that wasn't obvious, and my stuff was all rendering off the page. Fixing it was a simple one-liner:

graphics.SetPageUnit(UnitPixel);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM