jamegon Posted July 12, 2019 Posted July 12, 2019 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
ozymandius257 Posted July 12, 2019 Posted July 12, 2019 Sounds like the file is being left open - have you tried _GDIPlus_Shutdown() at the end of your program? Back up my hard drive? - I can't even find reverse gear.
jamegon Posted July 12, 2019 Author Posted July 12, 2019 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)
ozymandius257 Posted July 12, 2019 Posted July 12, 2019 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.
jamegon Posted July 12, 2019 Author Posted July 12, 2019 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.
ozymandius257 Posted July 12, 2019 Posted July 12, 2019 Don't suppose it's going to be as simple as using FileClose is it? Back up my hard drive? - I can't even find reverse gear.
jamegon Posted July 12, 2019 Author Posted July 12, 2019 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,...
ozymandius257 Posted July 12, 2019 Posted July 12, 2019 Beyond me then I'm afraid - hopefully some autoit guru's out there can help. Back up my hard drive? - I can't even find reverse gear.
Werty Posted July 12, 2019 Posted July 12, 2019 (edited) nvm Edited July 14, 2019 by Werty Some guy's script + some other guy's script = my script!
franktic Posted July 12, 2019 Posted July 12, 2019 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) test.au3Fetching info...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now