Search the Community
Showing results for tags '_GDIPlus_ImageLoadFromFile'.
-
Hi I am having problems loading an image using _GDIPlus_ImageLoadFromFile. Each attempt fails at the "Load error" line of code which shows an error code of 1. The same error code is returned if the file does not exist yet these files do exist and I am supplying the full path of the file required within the local filesystem. Also, if I copy and paste the text of the file path from the debug statement in the code into a command prompt and hit enter, it will display the image in question. These are all jpg files created using INetGet. Where might I be going wrong please? Any help would be appreciated. My code is below. If FileExists($aImgLst[$j]) Then FnuDebug("jpg: " & $aImgLst[$j]) $hBitmap1 = _GDIPlus_ImageLoadFromFile($aImgLst[$j]) If @error<>0 then MsgBox(0,"", "Load error " & @error & ", handle=" & $hBitmap1) $hBitMap2 = _GDIPlus_ImageScale($hBitMap1, $dScale, $dScale) If @error<>0 then MsgBox(0,"", "Scale error " & @error) If _GDIPlus_ImageSaveToFile($hBitMap2,$aImgLst[$j] & "Small") <> True Then MsgBox(0,"", "Image error: " & @error & " (" & $hBitMap2 & ")") EndIf EndIf Thank you.
-
Hi! It took me an hour to find out, that FileMove() doesn't work in _Example1(). But what's the reason? #Include <GDIPlus.au3> $sSource = 'C:\Wallpaper\AnyImage.jpg' $sDest = 'C:\Wallpaper\16_10\AnyImage.jpg' _Example1() ;~ _Example2() Func _Example1() _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sSource) _GDIPlus_ShutDown() FileMove($sSource, $sDest, 1 + 8) EndFunc Func _Example2() FileMove($sSource, $sDest, 1 + 8) EndFunc I wrote a small script to sort wallpapers by their aspect ratio (16:10, 16:9, 4:3, ...), but it doesn't work, because FileMove() doesn't move any images to the desired destination. At least it creates the directory structure.What could be the solution for this problem? _Example2() works as expected. My system: - AutoIt v3.3.6.1 - SciTE v1.79 - Windows 7 Ultimate (64-Bit) Bye