Jump to content

GUICtrlCreateIcon help


Recommended Posts

is it possible to get the height + width of the picture, then make the height and width of the icon using GUICtrlCreateIcon change accordingly?

CODE
#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 633, 447, 193, 125)

$Pic1 = GUICtrlCreateIcon("3DX.dll", 1, 128, 32, @IconHeight, @IconWidth, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$i =0

While 1

sleep(1000)

GUICtrlSetImage($Pic1, "3DX.dll",$i)

$i+=1

if $i = 12 then Exit

WEnd

btw, yes, I know @IconHeight, @IconWidth dont exist, but just as an example of what I am looking for...

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

is it possible to get the height + width of the picture, then make the height and width of the icon using GUICtrlCreateIcon change accordingly?

CODE
#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 633, 447, 193, 125)

$Pic1 = GUICtrlCreateIcon("3DX.dll", 1, 128, 32, @IconHeight, @IconWidth, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$i =0

While 1

sleep(1000)

GUICtrlSetImage($Pic1, "3DX.dll",$i)

$i+=1

if $i = 12 then Exit

WEnd

btw, yes, I know @IconHeight, @IconWidth dont exist, but just as an example of what I am looking for...

Icons have standard sizes. The default for GuiCtrlCreateIcon() is 32x32. What size do you want?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Icons have standard sizes. The default for GuiCtrlCreateIcon() is 32x32. What size do you want?

I actually just figured it out its -1,-1

because I have different sizes, I needed it to change. thank you for your help :)

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

I lied, -1,-1 doesnt change the size :)

That brings us back to my previous question.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

the size changes :)

1 is 170x315

1 is 300x300

1 is 240x240

theres a list.

Weird, non-standard sizes. What size would you prefer?

$Ico = GUICtrlCreateIcon("File.ico", -1, 240, 240)

GUICtrlSetImage($File2.ico, -1)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Weird, non-standard sizes. What size would you prefer?

$Ico = GUICtrlCreateIcon("File.ico", -1, 240, 240)

GUICtrlSetImage($File2.ico, -1)

so then there is no way to change the picture size according to the size of the photo?

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

so then there is no way to change the picture size according to the size of the photo?

Not that I'm aware of.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Re-create your icons all the same size.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

as GEO stated icons "generally" have standard sizes

seems to that you are mixing "icons" and "pics" (bmp, jpg, etc)

???

8)

I think what he did was take some images and simply use an app to convert them to icons with no regard for size.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

@All Please read the thread. This is about icons. Icons can ( and should ) contain more than one image of varying sizes.

He needs to create the icons so that they all have the same size for what he is trying to do. And the size he chooses doesn't really matter within reason. I think Vista can handle up to 256x256 but I'm not positive. It may even be higher. For XP, I don't know the size limit.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

He needs to create the icons so that they all have the same size for what he is trying to do. And the size he chooses doesn't really matter within reason.

is it possible to get the height + width of the picture, then make the height and width of the icon using GUICtrlCreateIcon change accordingly?

[...]

btw, yes, I know @IconHeight, @IconWidth dont exist, but just as an example of what I am looking for...

GEOSoft: I dont think he wants to have the icons all at the same size.

He wants to get the width an height of the icons, and change the size of GuictrlcreateIcon to the width and height of the file.

But icons arent images. Maybe you can rename the name of the icons to their size: "240x240.ico" and read the size from there???

Edited by kip
Link to comment
Share on other sites

GEOSoft: I dont think he wants to have the icons all at the same size.

He wants to get the width an height of the icons, and change the size of GuictrlcreateIcon to the width and height of the file.

But icons arent images. Maybe you can rename the name of the icons to their size: "240x240.ico" and read the size from there???

That might work.

I still think having the icons all the same size is better. That doesn't mean that the image for the Icon has to use all of the space that's available. Remember that icons usually have a transparent background. If he created for example all of his Icons at 300x300 then centered the image from the current 240x240 icon in that, the 240x240 would still apear that size but it would be in a 300x300 container. See what I'm saying? There is one that is outside the 300 range but it's so close that I'm sure it could be resized to fit.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

From his code example it would seem to me that he's trying to create some kind of viewer for looking at icons in a dll file. That could be where the problem of not knowing the icon sizes stems from. I imagine there must be some way of examining icon libraries for the formats their icons are in, I know that Microangelo (an icon editing suite) comes with an application specially for viewing libraries and their icons within, I wouldn't know where to start though, and I wouldn't be surprised if it's not something the WinAPI covers.

Link to comment
Share on other sites

  • 2 months later...

From his code example it would seem to me that he's trying to create some kind of viewer for looking at icons in a dll file. That could be where the problem of not knowing the icon sizes stems from. I imagine there must be some way of examining icon libraries for the formats their icons are in, I know that Microangelo (an icon editing suite) comes with an application specially for viewing libraries and their icons within, I wouldn't know where to start though, and I wouldn't be surprised if it's not something the WinAPI covers.

I am still trying to inquire about this problem, any takers? :) lol

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
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...