Hi,
I try to copy graphics from a printerhdc (generated by GDI) to a window hdc:
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 ?
Greetings,
Nordwind64
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 ?
Greetings,
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...
:NaN:
I know this is not what you want, but it might give you some clue regarding what is taking and what isnt...
:NaN:
Hi NaN,
yes, I tested it with BitBlt. It don't work, too...
I use WinXP Home.
Regards,
Nordwind64
yes, I tested it with BitBlt. It don't work, too...
I use WinXP Home.
Regards,
Nordwind64
You can't copy an image between different devices. You have to use GetDIBits and SetDIBits.
Hi
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.).
Regards,
Nordwind64
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.).
Regards,
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 ;)
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...
Regards,
Nordwind64
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...
Regards,
Nordwind64