haha1234567 wrote:
I want to define a Image pointer like this(see attachment), but in c++,how can i do this ?
so is NOT correct:
unsigned long *LVTmplImg=(unsigned long *)calloc(imgWidth,imgHeight);
Message Edited by haha1234567 on
12-09-2007 07:17 AM
If you want to allocate an IMAQ image, you can't do that directly in C(++). An IMAQ image datatype is a lot more than just the actual bitmap data. Information such as the size, image type, possible
color bitmap etc have to be placed in there too. The actual bitmap data is just a pointer or memory area in that IMAQ data pointer and the implementation of that IMAQ structure is private and quite likely to change between IMAQ versions.
So use the functions that are provided by the IMAQ library to create such pointers. IMAQ does have a C type API you can call from your C++ code. But beware mixing C type API calls in your DLL and hoping you can pass those IMAQ pointers to LabVIEW and operate on them with LabVIEW VIs is likely to not work at all. LabVIEW uses it's own layer of an IMAQ support DLL, that resides between the IMAQ C API and the LabVIEW VIs to take care of complicated C details that aren't handled easily in LabVIEW directly and an IMAQ Resource in LabVIEW is likely not exactly the same as an IMAQ Handle in the C API.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390