I'm getting strange artifact in bottom right corner when loading this image.
This is propably somehow related to loadParams but I have no idea how. Any ideas what am I doing wrong?
Code: Select all
gflLibraryInit();
GFL_ERROR gflErr;
GFL_FILE_INFORMATION imgInfo;
GFL_LOAD_PARAMS loadParams;
GFL_BITMAP *currentBitmap = NULL;
AnsiString ppp = "C:\\temp\\capA00008.jpg";
gflErr = gflGetFileInformation(ppp.c_str(), -1, &imgInfo);
if (currentBitmap) gflFreeBitmapData(currentBitmap);
gflGetDefaultLoadParams(&loadParams);
loadParams.Origin = GFL_TOP_LEFT;
loadParams.ColorModel = GFL_BGR;
loadParams.LinePadding = 2;
Image1->Picture->Bitmap->Width = imgInfo.Width;
Image1->Width = imgInfo.Width;
Image1->Picture->Bitmap->Height = imgInfo.Height;
Image1->Height = imgInfo.Height;
gflErr = gflLoadBitmap(ppp.c_str(), ¤tBitmap, &loadParams, NULL);
SetBitmapBits(Image1->Picture->Bitmap->Handle, imgInfo.Width * imgInfo.Height * 3, currentBitmap->Data);
Image1->Refresh();
gflFreeFileInformation(&imgInfo);
gflLibraryExit();
Adam