Base64 encoded icons in XY.
Base64 encoded icons in XY.
What's cool about base64? - it's a text, so it can be stored right inside script body(no need for extra files) and can be loaded in variable as any text data. With XY heavy scripting abilities and scripted menus, plus already base64 encode functions on board, adding support for base64 icons would be grate!
Win 7 SP1 x64 100% 1366x768
-
- Posts: 181
- Joined: 29 Sep 2022 14:20
Re: Base64 encoded icons in XY.
+1 i also think it would be incredibly easy for developer to add since (like you mentioned) all the base64 functions are there. i've been using base64 encoded text a lot more recently and find it quite easy to work with, in JS and PHP mainly.
Re: Base64 encoded icons in XY.
Why so? Right now, though base64 is on board, it's practically not used in XY. At the same time, most of i meet base64 in web "incode-text-icons", so why not adopt that?
Personally, i'd really love an ability to have icons for scripts/menus staying in memory for whole session(as base64 in perma-variables), without need to re-read Icons folder/exes, hunders of times.
Personally, i'd really love an ability to have icons for scripts/menus staying in memory for whole session(as base64 in perma-variables), without need to re-read Icons folder/exes, hunders of times.
Last edited by eil on 18 Dec 2022 14:32, edited 1 time in total.
Win 7 SP1 x64 100% 1366x768
-
- Site Admin
- Posts: 59751
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Base64 encoded icons in XY.
That's you. I don't see a more general use.
FAQ | XY News RSS | XY Twitter
Re: Base64 encoded icons in XY.
Using icons for customization of menus//buttons is already a general use, and base64 icons would allow to incorporate icons right inside the scripts, making 2 general features fuse together.
Win 7 SP1 x64 100% 1366x768
-
- Posts: 181
- Joined: 29 Sep 2022 14:20
-
- Site Admin
- Posts: 59751
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Base64 encoded icons in XY.
As a proof of concept, the next beta (v25.10.0122) will include support for base64-encoded images in SC makecoffee.
1. Add this script to your catalog:
2. Copy this Base64 block to the clipboard:
3. Run the above script. You should see a smiley face in a random place in your file list.
1. Add this script to your catalog:
Code: Select all
makecoffee <clp>, 5:=1; //show base64 image
Code: Select all
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAY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Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=
- Attachments
-
- 2023-11-18_162102.png (742 Bytes) Viewed 272 times
FAQ | XY News RSS | XY Twitter
Re: Base64 encoded icons in XY.
Indeed the smile appears. Hope this is a first step to introducing base64 encoded pics as icons.
Win 7 SP1 x64 100% 1366x768
-
- Site Admin
- Posts: 59751
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Base64 encoded icons in XY.
Sure. You haven't said what icons you have in mind, have you?
FAQ | XY News RSS | XY Twitter
Re: Base64 encoded icons in XY.
Well, if being greedy i'd wish this could be used anywhere where XY lets ico/png use. But first of base64 icons would be useful in script-menus, like popupmenu etc.
Win 7 SP1 x64 100% 1366x768
-
- Site Admin
- Posts: 59751
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Base64 encoded icons in XY.
Well, "incredibly easy" is a bit strong. But I probably can manage.GreetingsFromPoland wrote: ↑25 Nov 2022 15:57 +1 i also think it would be incredibly easy for developer to add since (like you mentioned) all the base64 functions are there. i've been using base64 encoded text a lot more recently and find it quite easy to work with, in JS and PHP mainly.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 59751
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Base64 encoded icons in XY.
BTW, this will send the currently selected image file as Base64 to the clipboard:
You can then print the image to the list with:
Of course, you can also skip the clipboard and do it directly:
Of course, you can also skip the base64 stuff and do it even more directly:
Code: Select all
copytext(base64encode(,<curitem>,3:=0)); //copy selected image as base64 to the clipboard
Code: Select all
makecoffee <clp>, 5:=1; //print base64 image from clipboard to the list
Code: Select all
makecoffee base64encode(,<curitem>,3:=0), 5:=1; //print selected image file to the list
Code: Select all
makecoffee <curitem>;
FAQ | XY News RSS | XY Twitter
Re: Base64 encoded icons in XY.
Yeap, all the tricks with makecoffee work(while it's used on images) and actually this really resembles a MDBU behaviour.
Will be waiting for further steps.
BTW, just thinking aloud how new icons can be stated say for user buttons or catalog items - there may be some prefix-descriptor to depict that next goes base64 code instead of usual path to icon/image. Smth like: bsic:: or bs64:: or bs64ic:: .
Will be waiting for further steps.
BTW, just thinking aloud how new icons can be stated say for user buttons or catalog items - there may be some prefix-descriptor to depict that next goes base64 code instead of usual path to icon/image. Smth like: bsic:: or bs64:: or bs64ic:: .
Win 7 SP1 x64 100% 1366x768