[Gambas-user] About the origin of Stock Icons

Jorge Carrión shordi at gmail.com
Mon Feb 20 22:57:03 CET 2023


Well, I try another way from another point of view: If we can't compare
Pictures... we can compare files. So, I try to save the picture of control
to a temporary file and compare its shasum against the shasum of Stock's
pictures and.. It works!
A example Project is Attached

Extract de shasum of all Stock's Pictures takes a while, so it is only in
first project running and stored on a text file. Following runnings simply
load that file and use it for comparisons.

I am very pleased with the result and it would not have been possible
without your ideas.
Thank you so much.





El lun, 20 feb 2023 a las 18:35, Jorge Carrión (<shordi at gmail.com>)
escribió:

>
> El lun, 20 feb 2023 a las 18:21, Fabien Bodard (<gambas.fr at gmail.com>)
> escribió:
>
>> The other way :
>>
>> Store the pictures in an array of picture
>> private  $aPicture as new picture[]
>> private $aNames as new string[]
>> for each s...
>>
>>   $aPicture.Add(...)
>>   $aNames.Add(s)
>> next
>>
>> then fill the listview with the array
>>
>> for i = 0 to $aPicture.max
>>
>>   listview.add( $aNames[i], $aNames[i], $apicture[i])
>>
>>
>> next
>>
>> to get the item from the picture ?
>>
>> $aNames[$aPicture.Find(ListView1.Item.Picture)]
>>
>>
>> Well it is not really useful :)
>> synonym of
>> ListView1.Item.Key
>>
>> Some
> Something like that I've tried already, but using a collection...
>
> The basic idea is:
> Starting from any project (ours or made by others) that uses controls with
> stock icons, go through the controls class and to all the controls that
> have a Picture property, obtain the name of the assigned Picture.
> So, if our "Decorator" class has an image of the same name, replace it.
>
>  Best Regards
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/943fcea2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: showicons-0.0.1.tar.gz
Type: application/gzip
Size: 13216 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/943fcea2/attachment-0001.gz>


More information about the User mailing list