10-11-2006 03:45 AM
10-16-2006 10:08 AM
I have seen Windows fail to put something in the clipboard when requested, if it is having to work hard at swapping memory in and out of its pagefile. Perhaps the function imaqImageToClipboard( frame, NULL ); you mention has an error return value that you could check?
JR
10-16-2006 11:02 AM
Hallo JR,
I did as you recommended and checked the error codes of all functions involved. I now believe that the problem can be narrowed down to the "imaqImageToClipboard" function. In the case a bitmap cannot be displayed in the canvas "ClipboardGetBitmap" says that in fact that there is no bitmap available in the clipboard (second function parameter "Available" is 0). This is despite the fact that copying the image to the clipboard seems to has succeeded ("imaqImageToClipboard" returns with "no error").
I have experimented with using "ProcessSystemEvents" and "ProcessDrawEvents" functions before and after calling the "imaqImageToClipboard" function finding that when using "ProcessSystemEvents" immediately after "imaqImageToClipboard" all images are displayed in the canvas. But I would think that it is not the intention to slow down the program by being obliged to use these two functions together to make the program work properly. Or is there another - may be faster - way of displaying an "Image *image" in a canvas?
Thanks for your help.
Thomas