Print image from memory

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Posts: 3170
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 202 times
Been thanked: 107 times

Print image from memory

Post by mol » Mon Dec 04, 2017 9:50 pm

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

Posts: 441
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 128 times
Been thanked: 362 times

Post by edk » Mon Dec 04, 2017 10:30 pm

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