heard$
heard

03/12/2007 :: 20:38

Anonyme

Hi Loic,
I'm having trouble with redisplaying an image.

Here is my issue:

gdpro_id=gdpro.LoadFromFile('filename')
gdprotemp_id=gdprotemp.SetNativeImage(gdpro_id)
gdview.DisplayFromImageRef(gdprotemp_id)

(all is good, now I draw a rectangle)

gdprotemp_id=gdprotemp.DrawFillRectangle(0,0,100,100)
gdview.DisplayFromImageRef(gdprotemp_id)

(all is good, I see the black rectangle)
(now I want to clear the rectangle)

gdprotemp_id=gdprotemp.SetNativeImage(gdpro_id)
gdview.DisplayFromImageRef(gdprotemp_id)

I still see the black rectangle)

If I do this:
gdview.DisplayFromImageRef(gdpro_id)

I still see the black rectangle)

Please help,
Regards
Heard




Loïc$2006306
Loïc

03/14/2007 » 11:19

Registered

Hi heard,

Your 2 first lines are not valid.

You do:

gdpro_id=gdpro.LoadFromFile('filename')
gdprotemp_id=gdprotemp.SetNativeImage(gdpro_id)

After the first call the gdpro_id contains a GdPicture State and not an image ID...


You need to do like that:

gdpro.LoadFromFile('filename')
gdpro_id=gdpro.GetNativeImage()



or like that:

gdpro_id=gdpro.CreateImageFromFile('filename')


Best regards,

Loïc Carrère


Edited by @lcarrere  
back to forum