Vincent Povirk madewokherd@gmail.com wrote:
You can't rely on the area we're drawing to be rectangular. We use AlphaBlend to draw rotated images, any text that isn't a solid color, and any brushes other than solid or hatch brushes. Anything we can't do accurately with gdi32 will use AlphaBlend, and the number of cases will only increase.
I tested printing quite a bit of different documents with an application I have here and all of them get printed correctly with the patch. Before the printed pages were just blank. What do you think is better for a user?
Can't we fix wineps?
Can we read the bits back from wineps and write new bits with the image applied?
Of course we can't. Printer drivers just convert input commands into direct output to a printing device on the fly.
If neither of those things are possible, the best we can do is to do ALL of our drawing through alpha_blend_pixels (by using a GpGraphics without an hdc), compose the result internally, and blit the result with a mask based on the resulting alpha values when GdipFlush or GdipDeleteGraphics is called.
Did you test it under Windows? Does it really do it that way?
But until we have a line/curve drawing implementation using alpha_blend_pixels, that would cause those operations to fail.
PNG (with transparency) and JPEG/BMP images do print with my patch same way as they look like under Windows. May be I'm missing something, but IMO it's better to print something (and fix any probable problems later) instead of printing empty pages.