ListIconGadget Graphic size limit for Win & Linux

Everything else that doesn't fall into one of the other PB categories.
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

ListIconGadget Graphic size limit for Win & Linux

Post by flaith »

Hello all,

What is the size of a Graphic when i add a image inside a ListIconGadget ?
Because there is no limit with Linux :?
“Fear is a reaction. Courage is a decision.” - WC
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Probably 32x32 pixels, at least if you want to support XP.
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

Trond wrote:Probably 32x32 pixels, at least if you want to support XP.
That's what i thought, thanks
“Fear is a reaction. Courage is a decision.” - WC
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Or maybe 48x48, but no more than that on XP. On Vista I don't know, on Linux there is no limit as you said.
User avatar
Comtois
Addict
Addict
Posts: 1433
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

doc say 16x16
AddGadgetItem(): Add an item (with an optional image in the standard 16x16 icon size).
http://www.purebasic.com/documentation/ ... adget.html

[EDIT]
May be 32x32 using
ChangeListIconGadgetDisplay() ?
Please correct my english
http://purebasic.developpez.com/
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

What is the size of a Graphic when i add a image inside a ListIconGadget ?
Because there is no limit with Linux
The default sizes on Windows are 16x16 in "report" view and 32x32 in "icon" view. But it is possible to use any size you want in both modes via API:

Code: Select all

#ICONSIZE = 115

OpenWindow(0,0,0,640,480,"void",#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0,0,0,640,480,"Name",250)

SetGadgetAttribute(0,#PB_ListIcon_DisplayMode,#PB_ListIcon_LargeIcon)

For i=1 To 10 : AddGadgetItem(0,-1,"Gadget Item #" + Str(i)) : Next

CreateImage(0,#ICONSIZE,#ICONSIZE)
StartDrawing(ImageOutput(0))
For i=0 To #ICONSIZE-1 : Box(0,i,#ICONSIZE,1,RGB(255,255 - (i * 180 / (#ICONSIZE-1)),0)) : Next
StopDrawing()

himListView = ImageList_Create_(#ICONSIZE,#ICONSIZE,#ILC_COLOR32 | #ILC_MASK,1,0)
ImageList_Add_(himListView,ImageID(0),0)

SendMessage_(GadgetID(0),#LVM_SETIMAGELIST,#LVSIL_NORMAL,himListView)
SendMessage_(GadgetID(0),#LVM_SETIMAGELIST,#LVSIL_SMALL,himListView)

While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend

ImageList_Destroy_(himListView)
Last edited by Fluid Byte on Mon Nov 24, 2008 8:23 pm, edited 1 time in total.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

Thanks Fluid Byte, it's a nice piece of code. :D
“Fear is a reaction. Courage is a decision.” - WC
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

The selection colour is not correctly alpha blended onto the image in that example.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Trond wrote:The selection colour is not correctly alpha blended onto the image in that example.
Replace

Code: Select all

#ILC_COLORDDB
with

Code: Select all

#ILC_COLOR32 | #ILC_MASK
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Post Reply