Hi Mike,

One more question about @2x handling on MacOS.

Clearly, in the simple case of someone loading an ordinary "foo.png" and painting it on a retina display without doing anything special with the transform, it will be scaled up by 2x to retain proper size.

Also, clearly, if a "[email protected]" file exists, it will be loaded automatically and found to be twice as large and displayed with no scaling so that it is the same "size".

But, what if in the first step they manually specified the image file name as "[email protected]" (and assuming there is no "foo@[email protected]")? Will it display with its pixels scaled up to double sized because it was the direct image that they specified? Or, does the system recognize that it came from a file named @2x and assume that it is a double-screen-resolution image and paint it the same way it would have done if it was implicitly loaded as the higher resolution variant of "foo.png"?

Let me spell out the scenarios:

Scenario 1:
- app is retina-enabled
- app has WxH foo.png media (and no @2x versions)
- app loads image from "foo.png"
- app displays image with standard default scaling on a retina screen
=> result is image takes up 2W x 2H pixels on the retina screen

Scenario 2:
- app is retina-enabled
- app has WxH foo.png media
- app also has 2W x 2H [email protected] media
- app loads image from "foo.png"
- app displays image with standard default scaling on a retina screen
=> result is system also loads [email protected] and displays it with 2W x 2H retina pixels on the retina screen - the same physical size as in the previous example

Scenario 3:
- app is retina-enabled
- app has WxH foo.png media
- app also has 2W x 2H [email protected] media
- app loads image from "[email protected]" rather than "foo.png"
- app displays image with standard default scaling on a retina screen
=> result is ???
=> I'm guessing that it gets drawn twice the size as Scenario's 1 and 2 because it is no longer relative to the WxH base image?

Scenario 4:
same as Scenario 3, but foo.png doesn't exist, [email protected] is the only version found in the media for the app
=> result is ???
=> I'm guessing the result is the same as Scenario 3

Also, the convention is for the @2x image to be twice the pixel size of the regular image, but what if it isn't? Is it always drawn at a 0.5x relative scale because of the implication of the @2x file name, or will it be dynamically sized for "basew/@2xw, baseh/@2xh" which just usually works out to 0.5x if the author followed conventions?

                        ...jim

Reply via email to