Print image from memory

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Print image from memory

Post by mol »

I'm sure that my problem was resolved already on our forum, but I can't find it.
How can I print image without saving it to file?
I need to create some graphs and print them. I don't want to use temporary files.

Regards, Marek
edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Print image from memory

Post by edk »

Marek, maybe something like this (I have not tested, I write from my head on my smartphone.)

Code: Select all

//hBitmap := is some memory bitmap handle like GRAPH BITMAP (...) STOREIN

select printer default preview
start printdoc
start printpage
hDC := OpenPrinterGetPageDC()
BT_DrawBitmap ( hDC, 100,  100, 500, 500, BT_STRETCH, hBitmap )   
end printpage
end printdoc   
Post Reply