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);
}
}