I try to copy graphics from a printerhdc (generated by GDI) to a window hdc:

invoke GetDeviceCaps,PD.hDC,HORZRES

mov bigx,eax
invoke GetDeviceCaps,PD.hDC,VERTRES
mov bigy,eax
invoke StretchBlt,WINDOWHDC,0,0,800,600,PD.hDC,0,0,bigx,bigy,SRCCOPY

But no graphics were copied...
Printing the printerdc to paper, it ok

I tested GetDeviceCaps -> RASTERCAPS / RC_STRETCHBLT, but the printerhdc can use StretchBlt.
BitBlt don't works, too.

Any suggestions ?

Posted on 2003-10-26 14:31:24 by Nordwind64
Have you tried testing it without the stretch but just regular bitblt?

I know this is not what you want, but it might give you some clue regarding what is taking and what isnt...

Posted on 2003-10-26 17:12:27 by NaN
Hi NaN,

yes, I tested it with BitBlt. It don't work, too...
I use WinXP Home.

Posted on 2003-10-26 23:28:52 by Nordwind64
You can't copy an image between different devices. You have to use GetDIBits and SetDIBits.
Posted on 2003-10-27 11:45:21 by Sephiroth3

but I can BitBlt / StretchBlt from HDC to PRINTERHDC ! That works !!!
And the are no error messages and StrechtBlt returns nonzero (If the function succeeds, the return value is nonzero.).

Posted on 2003-10-27 13:24:26 by Nordwind64
Even so, your still not any further than you are... i would suggest trying Sephiroth3's suggestion, and cursing at M$ afterwards if it was the correct solution ;)
Posted on 2003-10-27 18:48:47 by NaN
ok, thank you.
I'm writing a printer preview, maybe I should genate a normal HDC with the printergfx and copy it to printerhdc to print. And use the hdc for previewing...
Generating DIB's is very slow...

Posted on 2003-10-27 23:42:14 by Nordwind64