Page 1 sur 1

ToolBarImage (icônes trop petites)

Publié : jeu. 25/juin/2026 18:14
par promadoc
Bonjour à tous

J'ai essayé plusieurs méthodes mais le résultat est toujours le même: Les icônes sont trop petites presqu'illisible:

Code : Tout sélectionner


If CreateToolBar(0, WindowID(#WinMenu))
  For i=100 To 116
      ToolBarImageButton(i,ImageID(i))
      ToolBarSeparator()
      ToolBarImageButton(#PB_Any,ImageID(199))
      ToolBarSeparator()
  Next i
EndIf


Re: ToolBarImage (icônes trop petites)

Publié : jeu. 25/juin/2026 22:31
par Mindphazer
Code incomplet, donc qu'on ne peut pas compiler, donc inutile
Comment sont définies tes images ? Quel format ? Quelle taille en pixels ?
Que donne l'exemple du manuel chez toi ?

Code : Tout sélectionner

  If OpenWindow(0, 0, 0, 150, 25, "Barre d'outils", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    
    CreateImage(0, 16, 16)
    StartDrawing(ImageOutput(0))
      Box(0, 0, 16, 16, RGB(255, 255, 255))
      Box(4, 4, 8, 8, RGB(255, 0, 0))
    StopDrawing()
    
    CreateImage(1, 16, 16)
    StartDrawing(ImageOutput(1))
      Box(0, 0, 16, 16, RGB(255, 0, 0))
      Box(4, 4, 8, 8, RGB(255, 255, 255))
    StopDrawing()
    
    If CreateToolBar(0, WindowID(0))
      ToolBarImageButton(0, ImageID(0))
      ToolBarImageButton(1, ImageID(1))
    EndIf
    
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow 
  EndIf

Re: ToolBarImage (icônes trop petites)

Publié : ven. 26/juin/2026 7:42
par Mesa
Depuis pb 630:

Code : Tout sélectionner

- Ajouté : L'option #PB_Menu_NativeImageSize pour CreateImageMenu() et CreatePopupImageMenu() permet des icônes plus grandes dans les menus (Windows). 
Ça ne marche pas ?

M.

Re: ToolBarImage (icônes trop petites)

Publié : ven. 26/juin/2026 8:27
par kernadec
bjr
Sinon voila une autre solution pour avoir des menu toolbar style "ribbon"
Utiliser la lib de: Thorsten1867
https://www.purebasic.fr/german/viewtop ... 87#p351487

Cordialement

Re: ToolBarImage (icônes trop petites)

Publié : ven. 26/juin/2026 18:35
par promadoc
Il fallait seulement ajouter ceci: #PB_ToolBar_Large et le tour est joué! C tellement simple... Merci à vous tous