gflGetColorAt

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

Moderators: XnTriq, 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 » Thu Jul 19, 2007 8:18 pm

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: 32077
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflGetColorAt

Post by xnview » Fri Jul 20, 2007 6:58 am

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 » Fri Jul 20, 2007 8:16 am

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: 32077
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Fri Jul 20, 2007 2:06 pm

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 » Sat Jul 21, 2007 11:48 am

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: 32077
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Mon Jul 23, 2007 12:10 pm

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 » Sun Aug 05, 2007 3:43 pm

Hello.
with "pixel_color: GFL_COLOR;" produces the mistake of "Undeclared identifier GFL_COLOR"

User avatar
xnview
Author of XnView
Posts: 32077
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Mon Aug 06, 2007 7:03 am

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

Post Reply