I have version 20.1
When running on a 4k
monitor scaled at 200%, the status bar is only drawing small icons. We create
icons that are 16x16, 32x32 and 64x64. When running with the DPI set to 100%,
CodeJock paints the 16x16 icon when drawing the CXTPStatusBarPane entries. The
button size itself is 16x16 too.
Now scale the
desktop to 200%. Codejock still draws the 16x16 icon, but the button size is
32x32. This is a
regression.
The cause for this
is that Codejock is mixing code that uses XTP_DPI_X in
CXTPStatusBarPaintManager::DrawStatusBarPaneEntry with calls to
CXTPPaintManager::AdjustDpiIconSize. The latter returns 16x16. In earlier
versions of CodeJock, code scaled the Icon Extent using XTP_DPI. Hence, the
icon was drawn as the same size as the button.
New 20.1 code in
DrawStatusBarPaneEntry:
if (pIcon)
{
CSize szIcon =
CXTPPaintManager::AdjustDpiIconSize(pIcon, pIcon->GetExtent(),
XTP_SAFE_GET2(pPane,
GetStatusBar(),
GetCommandBars(), NULL),
rcItem.Size());
Pre 20.1:
if (pIcon)
{
CSize szIcon(XTP_DPI(pIcon->GetExtent()));
Also, when asking
for the icon by calling GetImage on the image manager, CodeJock is always
passing in 0 as the icon size ensuring that regardless of the desktop DPI and what images of varying sizes I load, CodeJock will always
obtain the smallest image available. So, even if I set the command bar options to auto scale the icon so it AND the button sizes actually match, CodeJock won't use my 32x32 icons and hence the 16x16 image is scaled during the paint op. Since we use PNG images, CJ eventually uses the GDI AlphaBlend API, one cannot even set halftoning on to try and get a better image.
In the very least, should not this status bar pane drawing code be written such that the scaling of the sizes match what this AdjustDpiIconSize are in agreement?
|