Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to make a NSImage object for my retina enabled app?
Answer: You can use code like this:
Function NewRetinaImage(pic as Picture, mask as Picture = nil) As NSImageMBS
// first make a NSImageMBS from it
dim n as new NSImageMBS(pic, mask)

// now set to half the size, so we have 2x pixels for the image
n.size = new NSSizeMBS(n.width/2, n.height/2)

// and return
Return n
End Function
The thing to do is to have 2x the pixels, but assign a size to the image which gives it the right size in points.
You can pass the NSImageMBS from here to NSMenuItemMBS. For Retina displays, the full resolution is used. For others it will be reduced.

Feedback, Comments & Corrections

The biggest plugin in space...

MBS FileMaker tutorial videos