1
QB64 Discussion / Re: How to copy a portion of the screen and save it to a bitmap or PNG file in QB64?
« on: March 09, 2019, 05:19:14 pm »@From Ariel:
I checked how Steve's library works and to have it work with InForm you won't actually need the _SOURCE call I imagined initially. You'll need to pass it the actual handle of the PictureBox's helper canvas. In your sample code above, make the following change:Code: QB64: [Select]
'No need for BeginDraw DrawScr 'No need for _SOURCE Control(DrawScr).HelperCanvas exportimage1$ = "testimage.png" KILL exportimage1$ 'delete the old file 'Again, no need for EndDraw DrawScr
That did it but I had to enclose the code inside of the BeginDraw and EndDraw or it didn't even generate an image at all. This may have something to do with the picture box being inside a form vs on the root object IDK. But It works!!!
[ You are not allowed to view this attachment ]