Sign in to follow this  
Followers 0
Mackus101

Apply Hex Color to Main GUI from Pop Up Menu

3 posts in this topic

Hello Everybody,

This is my first official post even though I have been scouring the forums for a couple weeks now. I am a new program Hobbyist...just began learning Autoit/any language no earlier than the beginning of June. I am currently trying to figure out how to use the find Color under mouse and apply it from a pop up screen to a main GUI. I did find the main part of this code on one of these pages but I can't find where I originally started from...So thank you to whomever that was!

Issues I am facing:

  • When it does work it only works once
  • Can't seem to get the value of the Hex properly (tried different variations and my brain hurts now)
  • The main GUI doesn't refresh properly
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
Global $pos = MouseGetPos()
Global $pixel_hex = Hex(PixelGetColor($pos[0],$pos[1]), 6)
Global $pixel_last
Global $Popcolor, $ColorUpdate, $lblF8, $lblF9, $lblF10, $lblF11, $HexTopFirst, $HexTopSecond, $HexTopThird, $HexTopFourth, _
$HexBotFirst, $HexBotSecond, $HexBotThird, $HexBotFourth, $lblName1, $lblName2, $lblName3, $lblName4, $FirstColor, _
$SecondColor, $ThirdColor, $FourthColor
HotKeySet("{F8}","clip8")
HotKeySet("{f9}","clip9")
HotKeySet("{F10}","clip10")
HotKeySet("{f11}","clip11")
HotKeySet("{ESC}","endme")
;-----------------MAIN GUI---------------
$MainColor = GUICreate ("Main Color Find", 340,140)
$ColorUpdate = GUICtrlCreateButton("Find Colors",110,105,120,25)
;........NAME Labels............
$lblMainName1= GUICtrlCreateLabel("One", 30, 68, 50, 13)
$lblMainName2= GUICtrlCreateLabel("Two", 108, 68, 45, 13)
$lblMainName3= GUICtrlCreateLabel("Three", 195, 68, 100, 13)
$lblMainName4= GUICtrlCreateLabel("Four", 280, 68, 30, 13)
;........Graphics........
$FirstMain = GUICtrlCreateGraphic(35, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
$SecondMain = GUICtrlCreateGraphic(112, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
$ThirdMain = GUICtrlCreateGraphic(200, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
$FourthMain = GUICtrlCreateGraphic(282, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
GUISetState(@SW_SHOW)
;----------Main Loop---------------------  
While 1
   $nMsg = GUIGetMsg(1)
   Switch $nMsg[1]
   Case $MainColor
   Switch $nMsg[0]
     Case $GUI_EVENT_CLOSE
      Exit
     
     Case $ColorUpdate
      PopColor()
   
   EndSwitch
  
      Case $PopColor
      Sleep(100)
      Call("grab")
      Switch $nMsg[0]
      Case $GUI_EVENT_CLOSE
      GUIDelete($PopColor)
      Sleep(10)
      GUICtrlSetState($ColorUpdate, $GUI_Enable)       
      Case $ColorUpdate
      GUICtrlSetBkColor($FirstMain,$FirstColor)
      GUICtrlSetBKColor($SecondMain,$SecondColor)
      GUICtrlSetBKColor($ThirdMain,$ThirdColor)
      GUISetBkColor($FourthMain,$FourthColor)
      EndSwitch
   EndSwitch
WEnd
Func PopColor()
   $PopColor = GUICreate("Color Find Pop", 340,140)
   $ColorUpdate = GUICtrlCreateButton("Update Main",110,105,120,25)
   ;........F9 - F12 Labels.......
   $lblF8= GUICtrlCreateLabel("F8", 35, 7, 30, 20)
   $lblF9= GUICtrlCreateLabel("F9", 112, 7, 45, 20)
   $lblF10 = GUICtrlCreateLabel("F10", 200, 7, 50, 20)
   $lblF11 = GUICtrlCreateLabel("F11", 282, 7, 42, 20)
   ;........Top HEX Labels.......
   $HexTopFirst= GUICtrlCreateLabel("", 22, 32, 60, 13)
   $HexTopSecond= GUICtrlCreateLabel("", 102, 32, 60, 13)
   $HexTopThird = GUICtrlCreateLabel("", 188, 32, 60, 13)
   $HexTopFourth = GUICtrlCreateLabel("", 271, 32, 60, 13)
   ;........BOTTOM HEX Labels.......
   $HexBotFirst= GUICtrlCreateLabel("", 22, 85, 60, 13)
   $HexBoTSecond= GUICtrlCreateLabel("", 102, 85, 60, 13)
   $HexBoTThird = GUICtrlCreateLabel("", 188, 85, 60, 13)
   $HexBoTFourth = GUICtrlCreateLabel("", 271, 85, 60, 13)
   ;........NAME Labels............
   $lblName1= GUICtrlCreateLabel("One", 30, 68, 50, 13)
   $lblName2= GUICtrlCreateLabel("Two", 108, 68, 45, 13)
   $lblName3= GUICtrlCreateLabel("Three", 195, 68, 100, 13)
   $lblName4= GUICtrlCreateLabel("Four", 280, 68, 30, 13)
   ;........Graphics........
   $FirstColor = GUICtrlCreateGraphic(35, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
   $SecondColor = GUICtrlCreateGraphic(112, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
   $ThirdColor = GUICtrlCreateGraphic(200, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
   $FourthColor = GUICtrlCreateGraphic(282, 48, 18, 18, BitOR($GUI_SS_DEFAULT_GRAPHIC,$SS_BLACKFRAME,$SS_SUNKEN))
   GUISetState(@SW_Show)
EndFunc
func grab()
    $pos = MouseGetPos()
    $pixel_hex = Hex(PixelGetColor($pos[0],$pos[1]), 6)
    
        If $pixel_last <> $pixel_hex Then
        GUICtrlSetData($HexTopFirst, $pixel_hex)
  GUICtrlSetData($HexTopSecond, $pixel_hex)
  GUICtrlSetData($HexTopThird, $pixel_hex)
  GUICtrlSetData($HexTopFourth, $pixel_hex)
    EndIf
    $pixel_last = $pixel_hex
EndFunc

Func clip8()
    Local $color = "0x" & $pixel_last
   GUICtrlSetBkColor($FirstColor, $color)
   GUICtrlSetColor($HexBotFirst,"0x"&$Pixel_Last)
   GUICtrlSetData($HexBotFirst, $Pixel_Last)
   EndFunc
  
   Func clip9()
    Local $color = "0x" & $pixel_last
   GUICtrlSetBkColor($SecondColor, $color)
   GUICtrlSetColor($HexBotSecond,"0x"&$Pixel_Last)
   GUICtrlSetData($HexBotSecond, $Pixel_Last)
   EndFunc
  
   Func clip10()
    Local $color = "0x" & $pixel_last
   GUICtrlSetBkColor($ThirdColor, $color)
   GUICtrlSetColor($HexBotThird,"0x"&$Pixel_Last)
   GUICtrlSetData($HexBotThird, $Pixel_Last)
   EndFunc
  
   Func clip11()
    Local $color = "0x" & $pixel_last
   GUICtrlSetBkColor($FourthColor, $color)
   GUICtrlSetColor($HexBotFourth,"0x"&$Pixel_Last)
   GUICtrlSetData($HexBotFourth, $Pixel_Last)
EndFunc

Func endme()
   Exit
EndFunc

Questions:

  • Can my purpose be served better by applying read and write ini file?

    • Would it be possible to have the main GUI already have a saved HEX color if using ini that can be overwritting from pop up menu?
  • Would OnEvent be better?
Any help would be appreciated...been stressing out over this coding for the last few days!

Share this post


Link to post
Share on other sites



You're reusing the variable name for the buttons on both GUIs, so when you call PopColor, the variable that holds the value from the first GUI gets overwritten by the handle to the button on the second GUI. Once you do that, the button on GUI 1 will never work again.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Thanks for the reply BrewMan!

oh that was a mistake from seperating this code from a much bigger project...accidental copy paste and no double checking the variables. Lets say we Change the FIrst button to just $Find and then we change the second button to $update. Now what would be the best way to get those colors from the 2nd GUI onto the 1st GUI after pressing $update?

Is there any way to read the Hex value of a font? A way to read the Hex value of a Graphic Background? Since the GUICtrlRead, GetData, Etc. does not return a Hex value and as soon as the mouse is moved the pixel_last is now different. So how do I capture that state in which when the button is pressed records the value but then communicates that value when and only when $update is pressed.

My previous attempt I tried to write an INI file for every F8-11 it would iniwrite "0x"&Pixel_Last into the INI and then referenced a variable to be read in the script and then refreshed on button press such as $update but it didn't work the way I thought it would...seemed as though it lagged in recording/missed a button/didn't copy correctly.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • tcurran
      By tcurran
      Here are two functions to provide pixel-accurate height and width dimensions for a given string.
      The more commonly-used _GDIPlus_GraphicsMeasureString built-in UDF is problematic because it returns the width padded by roughly one en-space (for reasons related to the various ways Windows produces anti-aliased fonts).
      These are AutoIt translations of Pierre Arnaud's C# functions, described in his CodeProject article "Bypass Graphics.MeasureString limitations"
      The first is an all-purpose version that takes a window handle, string, font family, font size (in points), style, and (optionally) width of the layout column (in pixels) as parameters.
      The second, more efficient version is intended for applications where GDI+ fonts are already in use, and takes handles to the existing graphics context, string, font, layout and format as parameters.
      Both functions return a two-row array with the exact width [0] and height [1] of the string (in pixels).
      #include <GDIPlus.au3> #include <GUIConstantsEx.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringInPixels ; Description ...: Returns a pixel-accurate height and width for a given string using a given font, style and size. ; Syntax ........: _StringInPixels($hGUI, $sString, $sFontFamily, $fSize, $iStyle[, $iColWidth = 0]) ; Parameters ....: $hGUI - Handle to the window. ; $sString - The string to be measured. ; $sFontFamily - Full name of the font to use. ; $fSize - Font size in points (half-point increments). ; $iStyle - Combination of 0-normal, 1-bold, 2-italic, 4-underline, 8-strikethrough ; $iColWidth - [optional] If word-wrap is desired, column width in pixels ; Return values .: 2-row array. [0] is width in pixels; [1] is height in pixels. ; Author ........: Tim Curran; adapted from Pierre Arnaud's C# function ; Modified ......: ; Remarks .......: This version is longer and less efficient but works for all purposes. ; Related .......: <https://www.codeproject.com/Articles/2118/Bypass-Graphics-MeasureString-limitations> ; Link ..........: ; Example .......: Example-StringInPixels.au3 ; =============================================================================================================================== #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Func _StringInPixels($hGUI, $sString, $sFontFamily, $fSize, $iStyle, $iColWidth = 0) _GDIPlus_Startup() Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle Local $aRanges[2][2] = [[1]] $aRanges[1][0] = 0 ;Measure first char (0-based) $aRanges[1][1] = StringLen($sString) ;Region = String length Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate($sFontFamily) Local $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $iStyle) _GDIPlus_GraphicsSetTextRenderingHint($hGraphic, $GDIP_TEXTRENDERINGHINT_ANTIALIASGRIDFIT) _GDIPlus_StringFormatSetMeasurableCharacterRanges($hFormat, $aRanges) ;Set ranges Local $aWinClient = WinGetClientSize($hGUI) If $iColWidth = 0 Then $iColWidth = $aWinClient[0] Local $tLayout = _GDIPlus_RectFCreate(10, 10, $iColWidth, $aWinClient[1]) Local $aRegions = _GDIPlus_GraphicsMeasureCharacterRanges($hGraphic, $sString, $hFont, $tLayout, $hFormat) ;get array of regions Local $aBounds = _GDIPlus_RegionGetBounds($aRegions[1], $hGraphic) Local $aWidthHeight[2] = [$aBounds[2], $aBounds[3]] ; Clean up resources _GDIPlus_FontDispose($hFont) _GDIPlus_RegionDispose($aRegions[1]) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Return $aWidthHeight EndFunc ;==>_StringInPixels ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringInPixels_gdip ; Description ...: Returns a pixel-accurate height and width for a given string using a GDI+ font, layout and format ; Syntax ........: _StringInPixels_gdip($hGraphic, $sString, $hFont, $tLayout, $hFormat) ; Parameters ....: $hGraphic - Handle to a GDI+ graphics object. ; $sString - The string to be measured. ; $hFont - Handle to a GDI+ font. ; $tLayout - A $tagGDIPRECTF structure that bounds the string. ; $hFormat - Handle to a GDI+ string format. ; Return values .: 2-row array. [0] is width in pixels; [1] is height in pixels. ; Author ........: Tim Curran; adapted from Pierre Arnaud's C# function ; Modified ......: ; Remarks .......: This much more efficient version is for use with GDI+ fonts ; Related .......: ; Link ..........: <https://www.codeproject.com/Articles/2118/Bypass-Graphics-MeasureString-limitations> ; Example .......: Example-StringInPixels.au3 ; =============================================================================================================================== #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Func _StringInPixels_gdip($hGraphic, $sString, $hFont, $tLayout, $hFormat) Local $aRanges[2][2] = [[1]] $aRanges[1][0] = 0 ;Measure first char (0-based) $aRanges[1][1] = StringLen($sString) ;Region = String length _GDIPlus_GraphicsSetTextRenderingHint($hGraphic, $GDIP_TEXTRENDERINGHINT_CLEARTYPEGRIDFIT) _GDIPlus_StringFormatSetMeasurableCharacterRanges($hFormat, $aRanges) ;Set ranges Local $aRegions = _GDIPlus_GraphicsMeasureCharacterRanges($hGraphic, $sString, $hFont, $tLayout, $hFormat) ;get array of regions Local $aBounds = _GDIPlus_RegionGetBounds($aRegions[1], $hGraphic) Local $aWidthHeight[2] = [$aBounds[2], $aBounds[3]] _GDIPlus_RegionDispose($aRegions[1]) Return $aWidthHeight EndFunc ;==>_StringInPixels_gdip  
      _StringInPixels.au3
      Example-StringInPixels.au3
    • anusha
      By anusha
      Hi I have jus started using auto-it . Please correct me if I'm wrong.
      I need to read data from an input in text box and search in excel file and return value in next column of matched cell on GUI.
      I have written below code but i cannot use variable which has data stored. it works only when search string is hard coded.
      Please help out.
       
      Example()
      Func Example()
      Local $GuiMain = GUICreate("EXCEL TEST", 399, 180) ;creates main GUI
      ;~ Local $idOK = GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
      Local $iWidthCell = 70
      Local $idLabel = GUICtrlCreateLabel("PART NUMBER", 10, 30, $iWidthCell,50)
      Local $RUN_1 = GUICtrlCreateButton("OK", 70, 70, 85, 25)
      Local $Input_1 = GUICtrlCreateInput("PART NUMBER", 100, 20, 120, 20)
      Local $sMenutext = GUICtrlRead($Input_1, 1)
      GUISetState(@SW_SHOW, $GuiMain)

          While 1
          $MSG = GUIGetMsg()
          Select
              Case $MSG = $GUI_EVENT_CLOSE
                  Exit
              Case $MSG = $RUN_1
                  Local $oAppl = _Excel_Open()

      Local $sFilePath1 = "D:\Anu_WorkFolder\Components.xlsx"
      Local $oWorkbook = _Excel_BookOpen($oAppl, $sFilePath1, Default, Default, True)
      Local $aResult = _Excel_RangeFind($oWorkbook, $sMenutext , Default, Default, $xlWhole)
    • Miliardsto
      By Miliardsto
      Hello.
      Drag option works only on parent window but as we can see on the parent gui is showed up child gui (on the right side with the color).
      Desired action is when we want to drag whole program we can also drag child gui and child gui will drag with parent gui.
      How to do this?
       
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> GUIRegisterMsg($WM_NCHITTEST, "_NCHITTEST") $hGUI = GUICreate("Test", 500, 500, -1, -1) $cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30) $cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30) $cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30) GUISetState(@SW_SHOW, $hGUI) ; guis Global $hChild_[3] Global $countGUI = UBound($hChild_) - 1 ;MsgBox("","",$countGUI) ; licznik dla GUI Global $gui = 0 $hChild_[0] = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0xFF0000) GUISetState(@SW_SHOW, $hChild_[0]) $hChild_[1] = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x00FF00) GUISetState(@SW_HIDE, $hChild_[1]) $hChild_[2] = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x0000FF) GUISetState(@SW_HIDE, $hChild_[2]) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_0 _All_Hide() GUISetState(@SW_SHOW, $hChild_[0]) $gui = 0 Case $cButton_1 _All_Hide() GUISetState(@SW_SHOW, $hChild_[1]) $gui = 1 Case $cButton_2 _All_Hide() GUISetState(@SW_SHOW, $hChild_[2]) $gui = 2 EndSwitch WEnd Func _All_Hide() GUISetState(@SW_HIDE, $hChild_[0]) GUISetState(@SW_HIDE, $hChild_[1]) GUISetState(@SW_HIDE, $hChild_[2]) EndFunc Func _NCHITTEST($hWnd, $uMsg, $wParam, $lParam) If $hWnd = $hGUI Then Local $aPos = WinGetPos($hWnd) If Abs(BitAND(BitShift($lParam, 16),0xFFFF)- $aPos[1]) < 500 Then Return $HTCAPTION EndIf Return $GUI_RUNDEFMSG EndFunc  
    • IAMK
      By IAMK
      Hello,
       
      I have a script which uses a GUI with two buttons. It gets shown and hidden., and pressing the buttons (including their hotkeys) highlights the button, making you able to press enter the next time.
      However, I don't want that.
       
      I've tried using WinActivate() to make enter do things on another program, but the enter is still tied to the AutoIT GUI (which still has the button highlighted).
       
      Here's the important part of my code:
      $MY_GUI = GUICreate("Check.exe", 400, 300, ((@DesktopWidth / 2) - 200), -500) WinSetOnTop($MY_GUI, "", 1) ;Keeps the window on the top. $Button1 = GUICtrlCreateButton("Pass (Ctrl+P)", 40, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Fail (Ctrl+F)", 240, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $GUIText = GUICtrlCreateLabel("", 20, 10, 360, 230) GUICtrlSetFont(-1, 13, 400, 0, "MS Sans Serif") GUICtrlSetData($GUIText, Execute($stepMessage[$step])) $showGUI = "True" GUISetState(@SW_SHOW) While($showGUI = "True") $buttonPressed = GUIGetMsg() Switch $buttonPressed Case $Button1 ;Pass $pass = "True" $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) Case $Button2 ;Fail $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) While($message = "") $message = InputBox("Check.exe", "Please enter the reason the step failed." & @CRLF, "", "", 300, 200, ((@DesktopWidth / 2) - 150), -400) WEnd Return $message EndSwitch WEnd Local $pass = "False" ;Whether "Pass" or "Fail" was pressed. Local $failLog = xxxfunc($pass) ;Returns a message to log if the step failed. ##THIS CALLS THE CODE SNIPPET ABOVE## FileWrite($file, _Now() & ": Step " & $step & getStatus($pass) & "and took " & Ceiling(TimerDiff($timer) / 1000) & " seconds." & @CRLF) If($failLog <> "") Then FileWrite($file, "Logged comment: " & $failLog & @CRLF) EndIf WinActivate("[TITLE:ProgramName]") ;Hotkeys: HotKeySet("^{p}", "pressPass") HotKeySet("^{f}", "pressFail") Func pressPass() $buttonPressed = $Button1 EndFunc Func pressFail() $buttonPressed = $Button2 EndFunc  
      The GUI's button/hotkey pressing works correctly.
      The same WinActivate code works in another script of mine.
      Together, WinActivate is not take "Active" away from the GUI's last-pressed button. How do I fix this?
       
      Thank you in advance.
    • fatpig
      By fatpig
      Dear AutoIT Community.
      I am currently working on a program that will display lots of images in a scroll down GUI.
      I create the GUI based on the number of images, which works fine.
      But all images I place using GuiCtrlCreatePic above a threshold of around 32000 pixels (cant say exactly) are placed at negative locations and finally will reach 0 again
      and will then populate on top of the images placed there before.
      For $i = 1 To $Images[0] ; Get picture dimensions $hImage = _GDIPlus_ImageLoadFromFile($ImgRep & $Images[$i]) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_ImageDispose($hImage) ; Resize & place images in GUI $Pic[$i] = GUICtrlCreatePic($ImgRep & $Images[$i], $Spacer, Round($yPos, 0), $MaxImgWidth, $MaxImgWidth * ($iY / $iX)) $yPos = $yPos + $MaxImgWidth * ($iY / $iX) + $Spacer $log = $log & "|" & $yPos $currentlut = $Images[1] Next I have found a limit at 32767 pixels for some GUI elements when googling around.
      Can someone tell me how to circumvent that?
      thanks!
      cheers
      Felix