Jump to content

Icons in toolbar are blurred compared to normal icons


torama
 Share

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 ****
#AutoIt3Wrapper_Icon=Favourites.ico
#AutoIt3Wrapper_UseUpx=n
#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)
GUISetBkColor(0xB9D1EA)


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

; create the rebar control
$g_hReBar = _GUICtrlRebar_Create($Form1_1, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS))

; 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
;------------------------------------------------------------------------------------
GUISetState(@SW_SHOW)

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

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

Edited by torama
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...