LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

about getimagepixelpointer

hi, everybody,
 
i have question again, this time is about GetImagePixelPointer.vi and VC-dll.
 
In Vc dll-code, I put a Picture in a memory like this:
----------------------------------
unsigned long *endImg;
int LineWidthT;
...
for (x=0; x<imgWidth; x++)
       for (y=0; y<imgHeight; y++)
{
(endImg+y*(LineWidthT)+x)=expa.ReadPixel(x,y);
.....
 
}
.....
---------------------------------------
but it can store only one picture, how should i define this imagePointer "endimg", so that i can store many pictures in this?  I mean this endImg is a 1-dim array like
--------------------------------------
 
unsigned long *endImg;
int LineWidthT;
...
 
for (k=0,;k<lev;k++)
 
for (x=0; x<imgWidth; x++)
       for (y=0; y<imgHeight; y++)
{
  *(endImg+LineWidthT*(y+imgHeight*k)+x)=expa.ReadPixel(x,y);
.....
 
}
.....
--------------------------------------
the compilling is successful, but it does'nt work in Labview, have you  some idears?
 
thanks
0 Kudos
Message 1 of 2
(2,424 Views)

GetImagePixelPointer.vi will return to you the actual memory pointer to the image area of an IMAQ image handle. Such a handle can only contain one bitmap image at one time. So there is no way to store more than one image in there. GetImagePixelPointer.vi will also return to you the LineWidth and PixelSize whose product will give you the rowSize, which is after how many bytes a new row starts in memory. This is usually not the same as the ImageWidth * PixelSize, due to the internal image border and byte padding.

Rolf Kalbermatter


Message Edited by rolfk on 02-27-2008 10:40 AM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(2,395 Views)