Jump to content
Sign in to follow this  

Icons in toolbar are blurred compared to normal icons

Recommended Posts


Hi, all :bye:
When trying to enhance my own program starter tool, I decided to add a toolbar with icons. Now as you will see in the attached image, these icons appear to be reduced in color or kind of pixelated, although I used proper icons. The Icons are from the open source icon library with 32x32 pixels. Would you please help me change my source code so that the icons in the toolbar look as nice as the normal icon representations ?

#include <GUIConstantsEx.au3>
#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <WindowsConstants.au3>
#include <GuiImageList.au3>
#include <WinAPI.au3>
#include <Array.au3>
#include <StringConstants.au3>
#include <StaticConstants.au3>
#include <MsgBoxConstants.au3>
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Global $g_hReBar
Const $navOpenInNewTab = 0x0800
Global $g_hListView_topic
Global $g_hListView_subtopic
Global $ExtendY = 80
Global $g_iItem

; Basis-Formular erzeugen
$Form1_1 = GUICreate("AppStarter", 743, 292+$ExtendY, -1, -1, -1,BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

GUISetIcon(@ScriptDir & "Favourites.ico", -1)

Local $idBtnExit, $hToolbar, $hCombo, $hDTP, $hInput
Global Enum $e_idUser = 1000, $e_idOpen, $e_idSave, $idHelp11, $idHelp1,$idHelp2, $idHelp3

; create the rebar control

; create a toolbar to put in the rebar
$hToolbar = _GUICtrlToolbar_Create($Form1_1, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN))

$hNormal  = _GUIImageList_Create(32, 32, 5, 3)
_GUIImageList_AddIcon($hNormal, "address-book-new-3.ico")
_GUIImageList_AddIcon($hNormal, "Favourites.ico")
_GUIImageList_AddIcon($hNormal, "applications-utilities.ico")
_GUIImageList_AddIcon($hNormal, "Au3.ico")
_GUIImageList_AddIcon($hNormal, "applications-office-4.ico")
_GUIImageList_AddIcon($hNormal, "kgpg_identity.ico")

 _GUICtrlToolbar_SetImageList($hToolbar, $hNormal)

; Add buttons
_GUICtrlToolbar_AddButton($hToolbar, $e_idUser, 0)
_GUICtrlToolbar_AddButton($hToolbar, $e_idOpen, 1)
_GUICtrlToolbar_AddButton($hToolbar, $e_idSave, 2)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp11, 3)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp1, 4)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp2, 5)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp3, 6)

; add band with toolbar to beginning of rebar
_GUICtrlRebar_AddToolBarBand($g_hReBar, $hToolbar, "", 0)

; Icons hinzu
$icnExtension = GUICtrlCreateIcon("address-book-new-3.ico", -1, 13, 50, 32, 32)
$icnExtension = GUICtrlCreateIcon("Favourites.ico", -1, 13+40, 50, 32, 32)
$icnExtension = GUICtrlCreateIcon("applications-utilities.ico", -1, 13+80, 50, 32, 32)
$icnExtension = GUICtrlCreateIcon("Au3.ico", -1, 13+120, 50, 32, 32)
$icnExtension = GUICtrlCreateIcon("applications-office-4.ico", -1, 13+156, 50, 32, 32)
$icnExtension = GUICtrlCreateIcon("kgpg_identity.ico", -1, 13+196, 50, 32, 32)

; GUI jetzt sichtbar machen

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $e_idUser

Sorry, don't know how to attach the image ... please advise

Edited by torama

Share this post

Link to post
Share on other sites


In _GUIImageList_AddIcon() set bLarge parameter to True:

;~ _GUIImageList_AddIcon($hNormal, "applications-office-4.ico")
_GUIImageList_AddIcon($hNormal, "applications-office-4.ico", 0, True)
Edited by Zedna

Share this post

Link to post
Share on other sites

Her is the image ZSEdfnN.jpg and I will try the suggested solution asap. thank you

Share this post

Link to post
Share on other sites

Thank you a lot, that trick did the needed magic  :thumbsup: you both made ma day a lot better.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.