Print image from memory

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 2879
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 136 times
Been thanked: 76 times
Contact:

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

edk
Posts: 200
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 58 times
Been thanked: 136 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