gflCrop and GFL_RECT

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

Moderators: helmut, 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 »

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

Re: gflCrop and GFL_RECT

Post by xnview »

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 »

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 »

Thank you very much.
Post Reply