Jump to content

Icon sizes


Abilio_KID
 Share

Recommended Posts

I'm trying to test a few things with the GUI. I have Windows 2000 but I'm trying to show a XP icon on the GUI. It has 4 sizes : 16x16, 32x32, 64x64 and 128, 128. I already know how to resize the icon but I want to use the higher version of it and not the stretched one.

Is this a limitation for using Windows 2000? The icon also has transparents pixels that work well but the size thing is confusing me. Nothing much but here it goes :

#include <GUIConstants.au3>
Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GUICreate("Some useless thingy", 400, 280)
$icon = GUISetControl("icon", "My 1337 Icon.ico", 50, 50); to create the Icon
GUISetControl($icon, "", 50, 50, 128, 128); testing how it would appear 'stretched'
GUIShow()

while 1
   $msg = GUIMsg()
   if $msg = -3 then
      exit
   endif
wend
Link to comment
Share on other sites

ARRRRGGGHHH, I don't get it. Now this code works without compiling :

#include <GUIConstants.au3>

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

FileInstall("F:\AutoIt scripts\Icon.ico", @TempDir, 1)

GUICreate("Some useless thingy", 400, 280)
$icon = GUISetControl("icon", @TempDir & "\Icon.ico", 50, 50)

GUIShow()
while 1
    $msg = GUIMsg()
    if $msg = -3 then
        FileDelete( @TempDir & "\Icon.ico" )
        exit
    endif
wend

However, when compiling I can't see the icon and the file is not installed in temp folder as it should. Maybe some bug? Using latest beta.

Link to comment
Share on other sites

Oh well, I found the problem... :ph34r:

Aparently the code should have been like this :

#include <GUIConstants.au3>

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

FileInstall("F:\AutoIt scripts\Icon.ico", @TempDir & "\Icon.ico", 1); <<<< needed to repeat the filename

GUICreate("Some useless thingy", 400, 280)
$icon = GUISetControl("icon", @TempDir & "\Icon.ico", 50, 50)

GUIShow()
while 1
    $msg = GUIMsg()
    if $msg = -3 then
        FileDelete( @TempDir & "\Icon.ico" )
        exit
    endif
wend

Nevermind, me needs to sleep :(

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...