Page 1 of 1

Artifact in loaded image.

Posted: Fri Mar 03, 2006 12:00 pm
by Guest
Hi,
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(), &currentBitmap, &loadParams, NULL);
SetBitmapBits(Image1->Picture->Bitmap->Handle, imgInfo.Width * imgInfo.Height * 3, currentBitmap->Data);

Image1->Refresh();

gflFreeFileInformation(&imgInfo);
gflLibraryExit(); 
regards
Adam

Posted: Fri Mar 03, 2006 12:01 pm
by lechoo
That's my post above. I forgot to log in.

Posted: Wed Mar 08, 2006 1:02 pm
by xnview
lechoo wrote:That's my post above. I forgot to log in.
It's better to use :

Code: Select all

currentBitmap->BytesPerLine * currentBitmap->Height

Posted: Thu Mar 16, 2006 10:05 am
by lechoo
xnview wrote:
lechoo wrote:That's my post above. I forgot to log in.
It's better to use :

Code: Select all

currentBitmap->BytesPerLine * currentBitmap->Height
Now it works. Thanks a lot.

regards