[Image-SIG] Printing under Windows98 using ImageWin

Howard Lightstone howard at eegsoftware.com
Fri Jun 27 14:21:32 EDT 2003


I am still pretty baffled about this.  I am using ImageWin.draw() to try 
drawing an RGB image to a device context (acquired from 
win32print/win32ui).

I am *pretty* sure the handle opened ok because WritePrinter commands 
cause actual data to appear on the printer.

I use win32ui.CreateDCFromHandle() to create a DC from the printer 
handle.  Then I use GetHandleAttrib() on the DC to get something back to 
write to using the DIB draw() method.  (This scheme comes from 
examples I may or may not have seen somewhere and from comments in 
the ImageWin code.  It does seem complicated but using the printer 
handle from win32printer.OpenPrinter directly also does not work).

Nothing prints.  The result back from StretchDIBits 
(in DIB.c/ImagingDrawDIB) is a positive number (of scan lines), leading 
me to believe that Windows wasn't complaining.  Where did the data go?

I am assuming that I have some clipping/coordinate problem but it is 
pretty baffling.

Any ideas where to search next?



More information about the Image-SIG mailing list