Hot Door CORE Forum

Full Version: image shrunk in label widget
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there something specific that may cause an image to be displayed at a reduced size?

I have a grouping of several buttons containing images within a panel. Two of the images are 28x25 px and two are 28x20. On a Retina Display Mac, the larger images (2x, 56x50) appear to be reduced to about half the size they should be. The smaller images display correctly. All images display correctly on a high-res Windows display, as well as lower res on both platforms. All buttons are defined like this:

Code:
this->LeftBtn = hdi::core::Button(hdi::core::Rect(marginWidth, vMarker, 28, 25), hdi::core::ImageWithRolloverIDs(AT_Left_PNGI_RSRC_ID,
    AT_Left_3TO2X_PNGI_RSRC_ID,
    AT_Left_2X_PNGI_RSRC_ID,
    AT_Left_DARK_PNGI_RSRC_ID,
    AT_Left_3TO2X_DARK_PNGI_RSRC_ID,
    AT_Left_2X_DARK_PNGI_RSRC_ID));
this->LeftBtn.setStyle(hdi::core::Button::NormalStyle);
this->LeftBtn.setEnabled(true);
this->LeftBtn.setBackgroundRollover(true);
this->LeftBtn.setClickCallback(HDI_CORE_CALLBACK(azzo::Plugin, this, __btnLeftCB));
this->LeftBtn.setDoubleClickCallback(HDI_CORE_CALLBACK(azzo::Plugin, this, __btnLeftCB));
this->__docPanel.addWidget(this->LeftBtn);
this->widgGrp.add(LeftBtn);

I ran a test to confirm that the Retina Mac was indeed pulling in the 2x image, and it was. Making the button size slightly larger didn't help. All images are 8-bit RGB PNG saved from Photoshop CC.

Any suggestions would be much appreciated. If you feel it may be a bug, I'd be happy to send the images and all relevant code snippets.
(06-24-2018, 04:07 PM)Rick Johnson Wrote: [ -> ]On a Retina Display Mac, the larger images (2x, 56x50) appear to be reduced to about half the size they should be.

Do you mean they appear as 28 x 25 or 14 x 12?

Also, have you checked the resolution?

Brendon
Brendon, you're right about the resolution. The images were saved at 144 dpi. It's interesting that sometimes this affected the display, but usually it didn't. Anyway, it's good to know that ensuring they're saved at 72 dpi eliminates the problem.
Oops, I guess I spoke too soon. 72 dpi fixed the problem for standard-res Mac, but Retina-display MacBook Pro still showed tiny icons. I put different colored dots in the various sizes (2x, 3to2x, etc.) and confirmed it was pulling in the 2x image, then shrinking that to about 25% of its natural size. The solution, it turns out, is in Photoshop, do not use File > Save As > PNG; use File > Export > Quick Export as PNG instead.