Xojo Conferences
XDCMay2019MiamiUSA

[MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Dropping email attachments onto Xojo app?
Next thread: [MBS] EPS Export fails with error, Mac.


Re: [MBS] AuthorizationMBS   -   Garth Hjelte
  [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType   -   Tim Jones
   Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType   -   Tim Jones
   Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType   -   Christian Schmitz
   Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType   -   Christian Schmitz

[MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType
Date: 17.04.15 02:02 (Thu, 16 Apr 2015 18:02:13 -0700)
From: Tim Jones
According to the docs for NSWorkspaceMBS.iconForfileType:

The returned image has an initial size of 32 pixels by 32 pixels.

Is there a way to get the other sizes directly? Specifically, I need to retrieve the 16x16 and 128x128 sizes.

Thanks,
Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType
Date: 17.04.15 17:46 (Fri, 17 Apr 2015 09:46:05 -0700)
From: Tim Jones

> On Apr 17, 2015, at 7:50 AM, Christian Schmitz <<email address removed>> wrote:
>
>
>> I’ll give this a shot, but my concern is that scaling the 32x32 to 128x128 will result in a blocky image.
>>
>
> No worries. The NSImage you get here has several image representations for the different resolutions the icon supports.
>

Ah - might be a good idea to update that entry and maybe provide an example.

Thanks!
Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType
Date: 17.04.15 15:50 (Fri, 17 Apr 2015 16:50:53 +0200)
From: Christian Schmitz

> I’ll give this a shot, but my concern is that scaling the 32x32 to 128x128 will result in a blocky image.
>

No worries. The NSImage you get here has several image representations for the different resolutions the icon supports.

Sincerely
Christian

Re: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType
Date: 17.04.15 08:08 (Fri, 17 Apr 2015 09:08:47 +0200)
From: Christian Schmitz

>
> Is there a way to get the other sizes directly? Specifically, I need to retrieve the 16x16 and 128x128 sizes.
>

you get an NSImageMBS. There you can call setSize method to set the size you need.

Drawing it, should scale icon to the size.

Sincerely
Christian