Search code examples
cocoansimage

Retina @2x high-resolution graphics wrongly used on standard display


It appears that some images are incorrectly drawn, using their high-resolution equivalent, while others are fine. why is that ?


Solution

  • NSImage seems to forcefully choose @2x high-res images when drawn images are stretched

    To avoid this, you can either choose to use NSDrawThreePartImage or NSDrawNinePartImage

    These functions will avoid stretching by tiling-up patterns.

    And if you really can’t use the above but want to avoid the 2x representation being used:

    [NSImage setMatchesOnlyOnBestFittingAxis:YES]