Sign in to follow this  
Followers 0
sentry07

Embedded icons displayed incorrectly

3 posts in this topic

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 3.3.8.1.

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

post-60230-0-29005700-1342027007_thumb.p

refresh-16.ico

Folder-Blank.ico

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

#AutoIt3Wrapper_OutFile=Program.exe

#AutoIt3Wrapper_icon=Program.ico

#AutoIt3Wrapper_Compression=4

#AutoIt3Wrapper_Res_Comment=-

#AutoIt3Wrapper_Res_Description=Program.exe

#AutoIt3Wrapper_Res_Fileversion=0.1.0.0

#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=n

#AutoIt3Wrapper_Res_LegalCopyright=Author

#AutoIt3Wrapper_Res_Language=1033

#AutoIt3Wrapper_Run_AU3Check=n

://////=__=.

://////=__=..

://////=__=

://////=__=

://////=__=

#AutoIt3Wrapper_Res_Icon_Add=Folder-Blank.ico

#AutoIt3Wrapper_Res_Icon_Add=refresh-16.ico

#AutoIt3Wrapper_Run_Obfuscator=y

#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

GUISetState()

While 1

    Switch GUIGetMsg()

        Case -3

            Exit

    EndSwitch

WEnd

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  
Followers 0