PDA

View Full Version : psImage in Button class



matthewd
8-May-2017, 09:24 PM
This property supports selecting an image size based on the piImageSize property and defaults to a 16x16 image. Should the class perhaps be changed so that piImageSize default to 24x24 instead of 16x16 on a high DPI display?

Windows appears to stretch a 16x16 bitmap to 24x24 if a .ICO doesn't have the size requested. This might look better than a tiny image if a developer hasn't updated their icons.

If it is not changed, perhaps a note should be added to the documentation that could point the developer in the right direction to adjusting the size automatically based on the DPI of the display? e.g. Use GetDeviceCaps to get LOGPIXELSY (logical pixels/inch in Y) to determine default size of button image. Maybe the system DPI should be a property in the application object to make it easier to access?

Of course developers could subclass the button class and add their own logic, but I thought it might be good to throw this out there...