gflGetColorAt

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

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias
Contact:

gflGetColorAt

Post by madiazg »

Hello, on having used

var
gfl_bmp: PGFL_BITMAP;
pixel_color: PGFL_COLOR;
......

gflGetColorAt(gfl_bmp,10,10,pixel_color);


produces the following mistake:

Access violation at address....

Why does this happen?
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflGetColorAt

Post by xnview »

madiazg wrote:Hello, on having used

var
gfl_bmp: PGFL_BITMAP;
pixel_color: PGFL_COLOR;
......

gflGetColorAt(gfl_bmp,10,10,pixel_color);


produces the following mistake:

Access violation at address....

Why does this happen?
Do you use the last build?
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias
Contact:

Post by madiazg »

I am using the last version (GFL SDK v2.70) and Delphi 7.0.
The image is RGB/8bits.
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

madiazg wrote:I am using the last version (GFL SDK v2.70) and Delphi 7.0.
The image is RGB/8bits.
I have not this problem, even with x,y=0? With all pictures?
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias
Contact:

Post by madiazg »

Yes, with all the images and any position x, y

I have copied in system32 libgfl270.dll and libgfle270.dll (Windows XP)

I am modifying the program of example GFL_SDK_Demo.dpr and alone I add in var:
pixel_color: PGFL_COLOR;

and I add:

Code: Select all

  if not (bpp in [1, 4, 8, 24, 32]) then begin
    MessageDlg('Only 1, 4, 8, 24 or 32 BitsPerPixel are supported in this demo !', mtError, [mbOK], 0);
    gflFreeBitmap(gfl_bmp);
    exit;
  end;


{Pixel Color}

  gflGetColorAt(gfl_bmp,10,10,pixel_color);


  // Create Delphi Bitmap. If paletted, minimize memory by setting size after pixel format

  bmp := TBitmap.Create;
  bmp.PixelFormat := IntToPixelFormat(bpp);
  bmp.Width := gfl_bmp.Width;
  bmp.Height := gfl_bmp.Height;
  NewPalette := 0;
Also I have tried in TurboDelphi.

I have used others (gflResize, gflGetNumberOfColorsUsed...) with good results.

I have the same problem with gflSetColorAt (gfl_bmp, 10,10, pixel_color)
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

madiazg wrote:Yes, with all the images and any position x, y

I have copied in system32 libgfl270.dll and libgfle270.dll (Windows XP)

I am modifying the program of example GFL_SDK_Demo.dpr and alone I add in var:
pixel_color: PGFL_COLOR;
No you must use a var GFL_COLOR not PGFL_COLOR!
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias
Contact:

Post by madiazg »

Hello.
with "pixel_color: GFL_COLOR;" produces the mistake of "Undeclared identifier GFL_COLOR"
User avatar
xnview
Author of XnView
Posts: 43444
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

madiazg wrote:Hello.
with "pixel_color: GFL_COLOR;" produces the mistake of "Undeclared identifier GFL_COLOR"
TGFL_COLOR
Pierre.
Post Reply