Hello,
I discovered something strange!
While developing a webcam snap program which copies an image from the clipboard that, there is a maximum of images to 'grab' after around 350 images the programs stops capturing!?!? (no error, no nothing)
Well the solution is to use FreeImage() after the image is 'used' (modified and written to disk in JPG format).
Now the program runs for more than 1500 images so far (every sec one 'shot').
See this snip-it of code:
Code: Select all
Procedure snapshot()
Protected Img, Res
Shared hWndC, Index.l, fName.s, CapMovie.l
ClearClipboard()
SendMessage_(hWndC, #WM_CAP_EDIT_COPY, 0, 0)
Delay( 1) ; extra since every x seconds it fails..
Img = GetClipboardImage( #PB_Any)
Res = SaveImage( Img, fName.s, #PB_ImagePlugin_JPEG, 10)
If Res = 0
Debug "OOPS, no file save.."
EndIf
FreeImage( Img) ; <<== Or else around 350 images the app stops capturing!!!
Debug "snapshot, ends"
EndProcedure