Problem with IconMBS for 64bit

Got an odd problem with IconMBS for 64bit. I’m getting icons for some folder with the following code:

if theFolder = nil then Return Nil dim theIconM as new IconMBS(theFolder) if theIconM = nil then Return Nil dim theFamily as IconFamilyMBS = theIconM.IconFamily if theFamily = Nil then Return Nil dim theIcon as Picture theIcon = theFamily.IconImage(16) theIcon.Mask = theFamily.IconMask(16) theIcon = theIcon.ScaleImageAndMaskMBS(16, 16) Return theIcon

The result looks like this for 32bit:

For 64bit the gamma of the icons are different:

Bug or something that I need to correct?

Xojo 2017r3, macOS 10.11, MBS from 22.01.2018.

How do you build menu?

if you use NSMenuMBS class and get NSImageMBS, you’d better use the icon function on NSWorkSpaceMBS class.

Otherwise you could use folderitem.IconMBS which uses newer code path.

And of course check the picture in-between and see if it’s the scale or the picture already looks like this.

For me it seems that it’s not the gamma; the icons are not displayed 1:1. The artefacts are coming from a reduced/streched drawing.

@Carten Belling: could be true. The icons are too small to see clearly.

The culprit is

theIcon = theIcon.ScaleImageAndMaskMBS(16, 16)

Using NSWorkspaceMBS.iconForFile(theFolder) instead works fine.