gflCrop and GFL_RECT

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:

gflCrop and GFL_RECT

Post by madiazg » Tue Jan 29, 2008 11:13 pm

Hello, I have a problem with gflCrop and GFL_RECT.
if:

Code: Select all

var
  AreaAjusteFino : PGFL_RECT;
.
.
AreaAjusteFino.x := 10;
then Error: Access violation at address...

but

Code: Select all

  AreaAjusteFino : TFL_RECT;
.
.
.
  e2 := gflCrop(gfl_bmp2,nil,AreaAjusteFino)
then 'Incompatible types: PGFL_RECT and TGFL_RECT'

What am I doing badly?[/code]

I am using Turbo Delphi .

Regards...

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

Re: gflCrop and GFL_RECT

Post by xnview » Wed Jan 30, 2008 8:32 am

I don't know very well Delphi, but i think you must use TGFL_RECT
Pierre.

gispos
Posts: 8
Joined: Sat Mar 01, 2008 10:57 pm
Location: stuttgart

Re: gflCrop and GFL_RECT

Post by gispos » Mon Mar 03, 2008 1:29 pm

madiazg wrote:Hello, I have a problem with gflCrop and GFL_RECT.
if:

Code: Select all

var
  AreaAjusteFino : PGFL_RECT;
.
.
AreaAjusteFino.x := 10;
then Error: Access violation at address...

but

Code: Select all

  AreaAjusteFino : TFL_RECT;
.
.
.
  e2 := gflCrop(gfl_bmp2,nil,AreaAjusteFino)
then 'Incompatible types: PGFL_RECT and TGFL_RECT'

What am I doing badly?[/code]

I am using Turbo Delphi .

Regards...
PGFL_Rect is a Pointer !
You must get memory like New and finally Dispose or use this:

Code: Select all

AreaAjusteFino : TGFL_RECT;

e2 := gflCrop(gfl_bmp2,nil,@AreaAjusteFino)  // operator @

or 
pR: PGFL_RECT;
R: TGFL_RECT;

pR := @R;
pR.x := 10;
Gruß gispos

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

Post by madiazg » Fri Mar 07, 2008 10:41 pm

Thank you very much.

Post Reply