hi all,
im currently developing a simple application that captures image, and perform some color matching on it..
i grouped all my grab codes into a function called grab(),coz i need to call it a few times throughout the program.
after calling the grab() function, i attempt to use the image(myImage) and perform color matching from another function.however,im getting this error:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information:
The image is not large enough for the operation.
at:
CWIMAQVision1.LearnColor(myImage, ColInfo, ViewRect)
wer myImage is the image from grab(), ColInfo is the color info, and ViewRect is the region.when i debug,i can see that there is no image height and width.so i suspect that the image is not passed to the LearnColor correctly.but myImage is a global variable,so i dont understand y the function cant access it..i've even tried pasting all the grab codesin the same function as LearnColor,but i am still getting the same error..

if possible,i want the grab function to be called from any function in the program,and subsequently use the image in it.this is because i would like my program to start from one function call,and all subsequent process will be called from there.
i have also posted this question in Measurement Studio for VB...so for those who are reading this for the second time,im sorry..

thank you..