LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getImagePixelPtr

Why did I get this result?
 
the imout.cpp:
 
void __declspec(dllexport) __stdcall imgGen(unsigned char *LVTmplImg,unsigned char tImg[380][380],unsigned char outImg[380][380],int LineWidthT,int imgWidth, int imgHeight)
{
      
     int boder;          
        unsigned char* tp = (unsigned char*)malloc(imgWidth);
       
  if(imgWidth%2!=0)
        imgWidth=imgWidth+1;
  else imgWidth=imgWidth;
     boder=(((LineWidthT-imgWidth)/2)-2)/2;
       
      
           for (int x=0; x<imgHeight;x++)
    
     {
       memcpy (tImg[x], LVTmplImg+(boder-1+x)*LineWidthT+boder, imgWidth);
     }
   
     FVLImage srcImage; 
  srcImage.New(imgWidth,imgHeight,FVLGetPixelFormat (FVLPixelFormat888));
        for(int i=0;i<imgWidth;i++)
        for (int j=0; j<imgHeight;j++)
  {
   srcImage.WritePixel(tImg[i][j],i,j);
   outImg[i][j]=(unsigned char)srcImage.ReadPixel(i,j);
  }
}
 
 
0 Kudos
Message 1 of 2
(2,658 Views)
Hi

I looked over your VI and the C code. It looks like the dll resizes the image and
copy the lines in disorder. What should the code do and where is it from ?

ps: In LabVIEW it`s a delict not to wire the eeror cluster through the code Smiley Happy

best regards

Lars
0 Kudos
Message 2 of 2
(2,612 Views)