Artifact in loaded image.

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
Guest

Artifact in loaded image.

Post 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
lechoo
Posts: 5
Joined: Tue Feb 22, 2005 2:20 pm
Contact:

Post by lechoo »

That's my post above. I forgot to log in.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post 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
Pierre.
lechoo
Posts: 5
Joined: Tue Feb 22, 2005 2:20 pm
Contact:

Post 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
Post Reply