Jex Posted November 22, 2007 Share Posted November 22, 2007 (edited) #include <GDIPlus.au3> $hImage = "Autoit.jpg" _GDIPlus_Startup() $Width = _GDIPlus_ImageGetWidth($hImage) $Height = _GDIPlus_ImageGetHeight($hImage) MsgBox("", "", $Width & "x" & $Height) GUICreate("Test", $Width, $Height) GUICtrlCreatePic($hImage, 0, 0, $Width, $Height) GUISetState() Sleep(3000) Not show image size true. Maybe bug? ( I'm using Beta 3.2.9.14 ) Edited November 22, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
therks Posted November 22, 2007 Share Posted November 22, 2007 $hImage = "Autoit.jpg" That's not a handle to the image, that's a string. $sImageFile = "Autoit.jpg" $hImage = _GDIPlus_ImageLoadFromFile($sImageFile) Try that. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
smashly Posted November 22, 2007 Share Posted November 22, 2007 (edited) HiIt's not a bug that I can see , your not using the _GDIPlus function correctly.._GDIPlus_ImageGetWidth() and _GDIPlus_ImageGetHeight() work with the handle to an image object not an image file.You need to load the file as an image object and use the handle of the object.CheersEdit: saunders beat me to it. Edited November 22, 2007 by smashly Link to comment Share on other sites More sharing options...
Jex Posted November 22, 2007 Author Share Posted November 22, 2007 (edited) Thanks for helps Edit : But if im use "_GDIPlus_ImageLoadFromFile($Image)" "GUICtrlCreatePic" not work. Example : That work without "_GDIPlus_ImageLoadFromFile($Image)" : #include <GDIPlus.au3> _GDIPlus_Startup() $Image = "Autoit.jpg" ;$hImage = _GDIPlus_ImageLoadFromFile($Image) $Width = 500;_GDIPlus_ImageGetWidth($hImage) $Height = 500;_GDIPlus_ImageGetHeight($hImage) GUICreate("Test", $Width, $Height) GUICtrlCreatePic($Image, 0, 0, $Width, $Height) GUISetState() Sleep(3000)oÝ÷ ضp¢¹0ØjºFåºÂ&j¡§E®W´ß¢&jªºZºÚ"µÍÚ[ÛYH ÑÑTË]LÉÝÂÑÑT×ÔÝ BÌÍÒ[XYÙHH ][ÝÐ]]Ú]É][ÝÂÌÍÚ[XYÙHHÑÑT×Ò[XYÙSØYÛQ[J ÌÍÒ[XYÙJBÌÍÕÚYHÑÑT×Ò[XYÙQÙ]ÚY ÌÍÚ[XYÙJBÌÍÒZYÚHÑÑT×Ò[XYÙQÙ]ZYÚ ÌÍÚ[XYÙJBÕRPÜX]J ][ÝÕÝ ][ÝË ÌÍÕÚY ÌÍÒZYÚ BÕRPÝÜX]TXÊ ][ÝÐ]]Ú]É][ÝË ÌÍÕÚY ÌÍÒZYÚ BÕRTÙ]Ý]J BÛY Ì Edited November 22, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
therks Posted November 22, 2007 Share Posted November 22, 2007 Well I must say, that is rather odd. If the image is loaded with the GDI function you are unable to use it with the picture control... hmm, I guess you'll have to dispose it? Hmm.... yup that works. Give this a try. #include <GDIPlus.au3> _GDIPlus_Startup() $Image = "Autoit.jpg" $hImage = _GDIPlus_ImageLoadFromFile($Image) $Width = _GDIPlus_ImageGetWidth($hImage) $Height = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_ImageDispose($hImage) GUICreate("Test", $Width, $Height) GUICtrlCreatePic("Autoit.jpg", 0, 0, $Width, $Height) GUISetState() Sleep(3000) Not really sure why it won't display the image if you don't release it, but I'm guessing it's an issue with the file already being in use. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
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