[Gambas-user] About the origin of Stock Icons

Gianluigi gradobag at gradobag.it
Mon Feb 20 17:10:14 CET 2023


Il 20/02/23 14:47, Gianluigi ha scritto:
> Il 20/02/23 14:44, Gianluigi ha scritto:
>> Il 20/02/23 14:29, Fabien Bodard ha scritto:
>>> because Stock["24" &/ sIcon return a null picture ? so a null Image
>>
>>
>> :-D
>>
>> I think I have it figured out, at least partially.
>>
>> I have deleted the old, messy IconsStockTest project and overwritten 
>> it with a fresh one and the project works even on the dark theme, see 
>> attached image.
>>
>> So if you change the theme you need to overwrite the project.
>>
>> What do you guys think?
>>
>> Regards
>>
>> Gianluigi
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> The forgotten image 


Hi Fabien,

so It Works:

Public Sub Form_Open()

   Dim sIcon As String

   '-- loads system icons if they exist
   For Each sIcon In Stock.Icons
     If Application.DarkTheme Then
       IconView1.Add(sIcon, sIcon, Stock["24" &/ 
sIcon].Image.Invert().Picture)
     Else
       IconView1.Add(sIcon, sIcon, Stock["24" &/ sIcon])
     Endif
   Next
   ' '-- load only stock icons without mixing them with system icons 
(from a post by Fabien)
   For Each sIcon In Stock.Icons
     If Application.DarkTheme Then
       IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/ 
sIcon].Image.Invert().Picture)
     Else
       IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/ sIcon])
     Endif
   Next

End

But the result is horrible :-(

Gianluigi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: now-work-two.png
Type: image/png
Size: 26402 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/3b5116dc/attachment-0001.png>


More information about the User mailing list