Page 1 of 1

Print image from memory

Posted: Mon Dec 04, 2017 9:50 pm
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

Re: Print image from memory

Posted: Mon Dec 04, 2017 10:30 pm
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   

Re: Print image from memory

Posted: Tue Dec 05, 2017 6:24 am
by mol
You are great!