unsigned char *bitmapImage;
bitmapImage = (unsigned char*)malloc(width*height*3);
for(i=0;i
bitmapImage[i*3] = (unsigned char)(sourcePixels[i][0]);
bitmapImage[i*3+1]=(unsigned char)(sourcePixels[i][1]);
bitmapImage[i*3+2]=(unsigned char)(sourcePixels[i][2]);
}
string fname = targetPath;
MSaveImage(fname, bitmapImage, width, height);