Jump to content

Recommended Posts

Posted

Hello

If I do:

$hImage=  _GDIPlus_ImageLoadFromFile(@DesktopDir&'\sigmet-airmet\control\ACC\radar.png')

........

_GDIPlus_ImageDispose($hImage)

 

Then, I can not modify, delete, reload  the file:      @DesktopDir&'\sigmet-airmet\control\ACC\radar.png'

Do you know the way?

Thanks

Javier  

 

 

 

Posted

Yes.

Not at the end of the program, at the end of the funcion where is   $hImage=  _GDIPlus_ImageLoadFromFile(@DesktopDir&'\sigmet-airmet\control\ACC\radar.png')

In the same program and In other funcion I have tried to reload @DesktopDir&'\sigmet-airmet\control\ACC\radar.png' and I can not (not delete also)

Posted

OK, one way to prove if it is being locked is to try to delete the file in file explorer - you should get a message like 'The action can't be completed because the folder is open in another program'

Back up my hard drive? - I can't even find reverse gear.

Posted

Yes. It have hapened.

The file is open in my program, and I can not reload from my program because it is in use.

I dont know how can close the file from my program.

Posted

I dont'n open the file with Fileopen.

Anyway I have tried :

$file: Fileopen( @DesktopDir&'\sigmet-airmet\control\ACC\radar.png')

Fileclose($file)

and dont'n work

The file is open with :      $hImage=  _GDIPlus_ImageLoadFromFile(@DesktopDir&'\sigmet-airmet\control\ACC\radar.png')

 

Windows dont'n  allow modify the file because it is in use by a program.

Once the program is closed the flie can be delete, modify,...

 

 

Posted

Try the following.  I have the test.au3 and the images.png file in the same directory.  The first part of the program opens the image and displays its height.  It then closes the image and reopens it to show its width.  It then closes it once more.

#include <GDIPlus.au3>

; Initialize GDI+ library

_GDIPlus_Startup()

$hImage= _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images.png")

MsgBox(0, "test", "Image height is " & _GDIPlus_ImageGetHeight($hImage))

_GDIPlus_ImageDispose($hImage)

 

$hImage= _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images.png")

MsgBox(0, "test", "Image width is " & _GDIPlus_ImageGetWidth($hImage))

_GDIPlus_ImageDispose($hImage)

 

 

images.png

test.au3Fetching info...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...