mikell Posted June 13, 2011 Share Posted June 13, 2011 (edited) Hello GUICtrlSetImage() forces a pic control created with GUICtrlCreatePic() to resize, and I can't find why. I searched evrywhere on the forum and the only solution I could find to work was to delete and recreate the pic control... it works but makes my image flicker The strangest thing is that I made this script and compiled it in 2009 and this old exe works nice, while the .au3 I used to compile it actually doesn't work.... Help please ! Edit : If I put no style or exstyle for the border of my Pic, then no problem. it occurs only if I use $SS_SUNKEN, $WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, etc Is there a way to solve this ? Edited June 13, 2011 by mikell Link to comment Share on other sites More sharing options...
KaFu Posted June 13, 2011 Share Posted June 13, 2011 Works fine for me. Did you declare the width and height of the control explicitly? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $s_AU_Path = StringTrimRight(@AutoItExe, StringLen(@AutoItExe) - StringInStr(@AutoItExe, "\", 2, -1)) & "\Examples\GUI" GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered GUISetBkColor(0xE0FFFF) $n = GUICtrlCreatePic($s_AU_Path & "\mslogo.jpg", 50, 50, 255, 40) GUISetState() Sleep(2000) GUICtrlSetImage($n, $s_AU_Path & "\msoobe.jpg") Sleep(2000) GUICtrlSetImage($n, $s_AU_Path & "\logo4.gif") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
mikell Posted June 13, 2011 Author Share Posted June 13, 2011 Yes I did The problem occurs when I give a border style to the pic On your script with this line, you can see the pic grow $n = GUICtrlCreatePic($s_AU_Path & "\mslogo.jpg", 50, 50, 255, 40, $SS_SUNKEN) Link to comment Share on other sites More sharing options...
rover Posted June 15, 2011 Share Posted June 15, 2011 Yes I did The problem occurs when I give a border style to the pic On your script with this line, you can see the pic grow $n = GUICtrlCreatePic($s_AU_Path & "\mslogo.jpg", 50, 50, 255, 40, $SS_SUNKEN) use the SS_CENTERIMAGE style #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $s_AU_Path = StringTrimRight(@AutoItExe, StringLen(@AutoItExe) - StringInStr(@AutoItExe, "\", 2, -1)) & "\Examples\GUI" GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) GUISetBkColor(0xE0FFFF) ;draw black border around pic control to highlight ;the image size/placement issue without the SS_CENTERIMAGE style GUICtrlCreateLabel("", 48, 48, 258, 43, $SS_BLACKFRAME) GuiCtrlSetState(-1,$GUI_DISABLE) $n = GUICtrlCreatePic($s_AU_Path & "\mslogo.jpg", 50, 50, 255, 40, BitOR($SS_CENTERIMAGE, $SS_SUNKEN), $WS_EX_CLIENTEDGE) GUISetState() Sleep(2000) GUICtrlSetImage($n, $s_AU_Path & "\msoobe.jpg") Sleep(2000) GUICtrlSetImage($n, $s_AU_Path & "\logo4.gif") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() I see fascists... Link to comment Share on other sites More sharing options...
mikell Posted June 16, 2011 Author Share Posted June 16, 2011 (edited) Thanks a lot ! This $SS_CENTERIMAGE feature is not very explicite when reading the helpfile ... Edit: though I still don't understand why my 2009 script didn't get this trouble Edited June 16, 2011 by mikell Link to comment Share on other sites More sharing options...
guinness Posted June 16, 2011 Share Posted June 16, 2011 (edited) It's to be expected as AutoIt has been updated quite a bit since 2009 Edited June 16, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
mikell Posted June 16, 2011 Author Share Posted June 16, 2011 (edited) I know this a bit But I wonder what precisely in the update(s) caused the troubleCuriosity only For educational purpose Edited June 16, 2011 by mikell 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