Page 1 of 1

Icon of files, volumes, apps

Posted: Wed Nov 08, 2017 4:11 pm
by paulclaude
There's a way to import the icon of an app or a volume, to display it as imagesource in a list (the files, the folders) ?
screenshot-08.11.2017_155247.png
screenshot-08.11.2017_155247.png (16.98 KiB) Viewed 4570 times

Re: Icon of files, volumes, apps

Posted: Wed Nov 08, 2017 6:54 pm
by richmond62
Is your screenshot from something inside a Livecode stack, or just from the Macintosh operating system's Finder?

Re: Icon of files, volumes, apps

Posted: Wed Nov 08, 2017 6:55 pm
by dunbarx
Hi.

You can always take a screen shot of the icon and get a PNG. Not sure if there is a more "direct" way.

Craig Newman

Re: Icon of files, volumes, apps

Posted: Wed Nov 08, 2017 7:17 pm
by FourthWorld
A more direct way would be to use LiveCode Builder to talk directly to the OS APIs to obtain that image data. A bit of work, but doable.

Re: Icon of files, volumes, apps

Posted: Thu Nov 09, 2017 3:06 pm
by MaxV
You can extract the icons this way:
  1. Import the screenshot image in Livecode
  2. Use another empty image as rectangle, call it "borders". Place it where you want to extract the image.
  3. Code: Select all

    put the rect of image "borders" into temp
    import snapshot from rect temp of this card
Tested and works!

Re: Icon of files, volumes, apps

Posted: Thu Nov 09, 2017 3:14 pm
by bogs
Max, that is awesome and simple. I am tucking it away for future use :D