Jump to content
Sign in to follow this  

Embedded icons displayed incorrectly

Recommended Posts


Hey guys,

I've got a script that I'm embedding two .ICO files. The .ICO files are single image containers with a single size 16x16 icon. I'm embedding them with the AutoIT3Wrapper directives and recalling them with GUICtrlSetImage, like so:

#AutoIt3Wrapper_Res_Icon_Add=C:\Dropbox\Scripting\AutoIT Scripts\Crestron SCFTP Client\Folder-Blank.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Dropbox\Scripting\AutoIT Scripts\Crestron SCFTP Client\refresh-16.ico

$btnLocalFolder = GUICtrlCreateButton("", 636, 334, 25, 25, $BS_ICON)
GUICtrlSetImage(-1, @ScriptFullPath, -5) ; Folder icon
$btnLocalRefresh = GUICtrlCreateButton("", 662, 334, 25, 25, $BS_ICON)
GUICtrlSetImage(-1, @ScriptFullPath, -6) ; Refresh icon

When I point GUICtrlSetImage directly to the ICO files, they show up the correct size on my GUI. When I'm using embedded resources, the icons show up at what looks like 32x32 and go off the buttons. I've ResHacked the compiled .EXE and the two icons show up the correct size. Attached is an image showing the GUI on top and ResHack's view of the icon behind it. Also attached are the two .ICO files. I'm using AutoIT ver

So am I doing something wrong or is this possibly a bug?




Share this post

Link to post
Share on other sites

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****



















#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0

#AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%%scriptfile%_Obfuscated.au3"

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>

$hGui = GUICreate('My Program', 250, 260)

$btnLocalFolder = GUICtrlCreateButton("", 36, 34, 25, 25, $BS_ICON)

GUICtrlSetImage(-1, @ScriptFullPath, -5, 0) ; Folder icon

$btnLocalRefresh = GUICtrlCreateButton("", 62, 34, 25, 25, $BS_ICON)

GUICtrlSetImage(-1, @ScriptFullPath, -6, 0) ; Refresh icon


While 1

    Switch GUIGetMsg()

        Case -3




Edited by AZJIO

Share this post

Link to post
Share on other sites

Got it. That makes total sense, and yet it doesn't. I understand the optional parameter to select an icon size, but when there's only one icon size in the file, it shouldn't resize the icon if you don't select it. The helpfile even says that it will select the first resolution of the image. There's only one resolution.

Oh well. Lesson learned. Program fixed. Thanks :)

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