<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : DPI awareness for icons in Ribbon</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : DPI awareness for icons in Ribbon]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 00:01:51 +0000</pubDate>
  <lastBuildDate>Sat, 17 Jun 2017 15:34:50 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=23038</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon :   markr wrote:&amp;gt;But, can&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75886&amp;title=dpi-awareness-for-icons-in-ribbon#75886</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 17 June 2017 at 3:34pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by markr" alt="Originally posted by markr" style="vertical-align: text-bottom;" /> <strong>markr wrote:</strong><br /><br />&gt;&nbsp;But, can't we get the closest icon size in the resources, without scaling it?<div><br></div><div>That's what I'd like to know as well.&nbsp;</div><div><br></div><div>Scaling will almost always result in a lower quality experience when compared to simply choosing the closest fit (without scaling).</div><div><br></div><div>- Mark R.</div></td></tr></table>Hello,<br><br>The scaling of Ribbon icons have been fixed. Also some samples updated. Fix will be available soon in next release.<br><br>As I wrote icons will be scaled only if option&nbsp;IsDPIIconsScallingEnabled() is TRUE &nbsp;or &nbsp;size of icon is bigger than button.<br><br>Regards,<br>&nbsp;Oleksandr Lebed]]>
   </description>
   <pubDate>Sat, 17 Jun 2017 15:34:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75886&amp;title=dpi-awareness-for-icons-in-ribbon#75886</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Hello Frederik,Logic of option...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75878&amp;title=dpi-awareness-for-icons-in-ribbon#75878</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 12 June 2017 at 4:05pm<br /><br />Hello Frederik,<br><br>Logic of option '<b>m_bAutoResizeIcons</b>&nbsp;== TRUE' &nbsp;- calculate best size of normal and large icons for current font size (Size of Ribbon depend on font size). &nbsp;Also current font depend on current DPI so m_bAutoResizeIcons also gives resizing for HighDPI.&nbsp;<br><br>That is why I think&nbsp;IsDPIIconsScallingEnabled &nbsp;is redundant. Also using these two options (TRUE) together give awful result. But there are cases where customers don't want use many icon sets for different DPI &nbsp;and they need this icon's scaling. So I'm going to change appointment of IsDPIIconsScallingEnabled(pButton) -&nbsp;allow any icon scaling only if it is TRUE &nbsp;else - will be used only original size of icons, except icon is bigger than button/control.<br><br>Now I fix using IsDPIIconsScallingEnabled() in&nbsp;CXTPPaintManager::DrawControlToolBarParent&nbsp;&nbsp;<font color="#999999">/*case as on your screenshot*/</font>&nbsp;and going to add it in other places (drawing Combobox, Edit control, some themes (CXTPCommandBarsOffice2000Theme, CXTPCommandBarsOfficeXPTheme)<br><br>Regards,<br>&nbsp;Oleksandr Lebed]]>
   </description>
   <pubDate>Mon, 12 Jun 2017 16:05:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75878&amp;title=dpi-awareness-for-icons-in-ribbon#75878</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : ... this is the result of calling...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75876&amp;title=dpi-awareness-for-icons-in-ribbon#75876</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1263">Fredrik</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 12 June 2017 at 4:49am<br /><br /><div>... this is the result of calling SetDPIScallingOptions(TRUE, TRUE) and using m_bAutoResizeIcons = TRUE:</div><div><br></div><div><img src="uploads/1263/SetDPIScallingOpti&#111;ns.png" height="194" width="566" border="0" /><br></div><div><br></div><div>Thought they would be independent of each other? The reason I tried was just to see whether it is possible to get auto resized icons in backstage in v18 - it seems to be broken - or at least the behaviour has changed between 17 and 18.</div>]]>
   </description>
   <pubDate>Mon, 12 Jun 2017 04:49:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75876&amp;title=dpi-awareness-for-icons-in-ribbon#75876</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Hello,Fix for icon&amp;#039;s scaling...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75870&amp;title=dpi-awareness-for-icons-in-ribbon#75870</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 09 June 2017 at 5:41am<br /><br />Hello,<br>Fix for icon's scaling for Ribbon's buttons with style <b>xtpButtonIconAndCaptionBelow</b> and when set some value for&nbsp;<span style="font-family: &quot;Courier New&quot;, Courier, mono; white-space: pre; : rgb248, 248, 252;">pCommandBars-&gt;</span><span style="font-family: &quot;Courier New&quot;, Courier, mono; white-space: pre; : rgb248, 248, 252;">m_pOptions-&gt;szLargeIcons</span><br><br>in &nbsp;Source\CommandBars\XTPPaintManager.cpp<br><div><table width="99%"><tr><td><pre class="BBcode">CSize CXTPPaintManager::GetIconSize(CXTPControl* pButton)</div><div>{</div><div>&nbsp; &nbsp; XTPButtonStyle buttonStyle = pButton-&gt;GetStyle();</div><div><br></div><div>&nbsp; &nbsp; CSize szIcon = buttonStyle == xtpButtonIconAndCaptionBelow</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp;&amp; pButton-&gt;GetParent()-&gt;GetType() != xtpBarTypePopup ?</div><div>&nbsp; &nbsp; &nbsp; &nbsp; pButton-&gt;GetParent()-&gt;GetLargeIconSize(/**/ <font color="#00cc00"><b>m_bAutoResizeIcons </b></font>/*/ <b><font color="#ff0000">TRUE </font></b>/**/) : pButton-&gt;GetIconSize();</div><div><br></div><div>&nbsp; &nbsp; return szIcon;</div><div>}</pre></td></tr></table><br><br>Regards,<br>&nbsp;Oleksandr Lebed</div>]]>
   </description>
   <pubDate>Fri, 09 Jun 2017 05:41:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75870&amp;title=dpi-awareness-for-icons-in-ribbon#75870</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : &amp;gt;But, can&amp;#039;t we get the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75772&amp;title=dpi-awareness-for-icons-in-ribbon#75772</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=669">markr</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 04 May 2017 at 1:11pm<br /><br />&gt;&nbsp;But, can't we get the closest icon size in the resources, without scaling it?<div><br></div><div>That's what I'd like to know as well.&nbsp;</div><div><br></div><div>Scaling will almost always result in a lower quality experience when compared to simply choosing the closest fit (without scaling).</div><div><br></div><div>- Mark R.</div>]]>
   </description>
   <pubDate>Thu, 04 May 2017 13:11:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75772&amp;title=dpi-awareness-for-icons-in-ribbon#75772</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : But, can&amp;#039;t we get the closest...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75494&amp;title=dpi-awareness-for-icons-in-ribbon#75494</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 14 January 2017 at 1:30pm<br /><br />But, can't we get the closest icon size in the resources, without scaling it?<div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Sat, 14 Jan 2017 13:30:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75494&amp;title=dpi-awareness-for-icons-in-ribbon#75494</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Hello Mark,In your case algorithm...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75491&amp;title=dpi-awareness-for-icons-in-ribbon#75491</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 13 January 2017 at 4:23pm<br /><br />Hello Mark,<div><br></div><div>In your case algorithm needs 56x56 icons and take nearest exist 48x48 then scale they to 56x56.</div><div><br></div><div>You can see what exactly size is needed in method CXTPPaintManager::GetAutoIconSize.</div><div><br></div><div>On my virtual <span style="line-height: 16.8px;">test</span><span style="line-height: 16.8px;">&nbsp;</span><span style="line-height: 1.4;">machine&nbsp;</span><span style="line-height: 16.8px;">Win7 &nbsp;with</span><span style="line-height: 1.4;">&nbsp;125 % DPI GetControlHeight() returns 29, then</span></div><div>int nHeight = GetControlHeight() - XTP_DPI_Y(4); &nbsp;// 29 - 5 = 24</div><div><br></div><div>then for small icons we get 24x24 and for large 48x48</div><div><br></div><div>100%: &nbsp;23 - XTP_DPI_Y(4) &nbsp;-&gt; 23 - 4 = 19 -&gt; 16x16 and 32x32</div><div>120%: &nbsp;27 - XTP_DPI_Y(4) &nbsp;-&gt; 27 - 5 = 22 -&gt; 16x16 and 40x40</div><div>125%: &nbsp;29 - XTP_DPI_Y(4) &nbsp;-&gt; 29 - 5 = 24 -&gt; 24x24 and 48x48</div><div>135%: &nbsp;31 - XTP_DPI_Y(4) &nbsp;-&gt; 31 - 5 = 26 -&gt; 24x24 and 48x48</div><div>150%: &nbsp;35 - XTP_DPI_Y(4) &nbsp;-&gt; 35 - 6 = 29 -&gt; 24x24 and 56x56</div><div>175%: &nbsp;41 - XTP_DPI_Y(4) &nbsp;-&gt; 41 - 7 = 34 -&gt; 32x32 and 64x64</div><div>200%: &nbsp;47 - XTP_DPI_Y(4) &nbsp;-&gt; 47 - 8 = 39 -&gt; 32x32 and 72x72<br><br>Regards,<br>&nbsp;Oleksandr Lebed</div>]]>
   </description>
   <pubDate>Fri, 13 Jan 2017 16:23:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75491&amp;title=dpi-awareness-for-icons-in-ribbon#75491</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Any thoughts on this? Am I doing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75482&amp;title=dpi-awareness-for-icons-in-ribbon#75482</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=669">markr</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 12 January 2017 at 11:46am<br /><br />Any thoughts on this? Am I doing something wrong?<div><br></div><div>- Mark R.</div>]]>
   </description>
   <pubDate>Thu, 12 Jan 2017 11:46:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75482&amp;title=dpi-awareness-for-icons-in-ribbon#75482</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Hello Lebed,I&amp;#039;ve been running...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75430&amp;title=dpi-awareness-for-icons-in-ribbon#75430</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=669">markr</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 07 December 2016 at 1:32pm<br /><br />Hello Lebed,<div><br></div><div>I've been running some tests based on the information you provided above, and I'm not quite getting the results I expect.</div><div><br></div><div>For my test, I took one application toolbar which normally has icon sizes of 32x32 and attempted to add support for 125% and 150% DPI scaling. So I created two new icon sets - one for 125% scaling (40x40) and another for 150% scaling (48x48).</div><div><br></div><div>The command bars are created within a dialog window:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div><span ="Apple-tab-span" style="white-space:pre">	</span>m_pCommandBars = (CXTPCommandBars*)CXTPCommandBars::CreateObject();</div><div><span ="Apple-tab-span" style="white-space: pre;">	</span>m_pCommandBars-&gt;GetPaintManager()-&gt;m_bAutoResizeIcons = TRUE;</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>m_pCommandBars-&gt;GetCommandBarsOptions()-&gt;SetDPIScallingOptions(TRUE, FALSE);</div><div><span ="Apple-tab-span" style="white-space: pre;">	</span>m_pCommandBars-&gt;SetSite(this);</div></div><div></pre></td></tr></table></div><div><br></div><div>And the toolbar icons are set:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div><span ="Apple-tab-span" style="white-space:pre">	</span>VERIFY(XTPImageManager()-&gt;SetIcons(IDB_PNG_SEARCH_32, nIDs, ARRAYSIZE(nIDs), CSize(32, 32)));</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>VERIFY(XTPImageManager()-&gt;SetIcons(IDB_PNG_SEARCH_40, nIDs, ARRAYSIZE(nIDs), CSize(40, 40)));</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>VERIFY(XTPImageManager()-&gt;SetIcons(IDB_PNG_SEARCH_48, nIDs, ARRAYSIZE(nIDs), CSize(48, 48)));</div></div><div></pre></td></tr></table></div><div><br></div><div>The results of this test:</div><div><ol><li>Set display to 100% (normal) scaling, and the toolbar shows the 32x32 icons &#091;expected&#093;</li><li>Set display to 125% scaling, and the toolbar shows the 40x40 icons &#091;expected&#093;</li><li>Set display to 150% scaling, and toolbar display seems to be incorrect. The resulting images are slightly malformed.</li></ol><div>Here's how the 48x48 icons appear in my toolbar (notice how they are jagged):</div><div><br></div><div><img src="uploads/669/ic&#111;ns_48.png" height="106" width="981" border="0" /><br></div></div><div><br></div><div>Am I doing something incorrectly, or are my operating assumptions somehow incorrect?</div><div><br></div><div>Thanks again for your time on this.</div><div><br></div><div>- Mark R.</div>]]>
   </description>
   <pubDate>Wed, 07 Dec 2016 13:32:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75430&amp;title=dpi-awareness-for-icons-in-ribbon#75430</guid>
  </item> 
  <item>
   <title><![CDATA[DPI awareness for icons in Ribbon : Hello Mark,I did this with test...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75425&amp;title=dpi-awareness-for-icons-in-ribbon#75425</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23038<br /><strong>Posted:</strong> 06 December 2016 at 11:25am<br /><br />Hello Mark,<br><br>I did this with test icon set. For RibbonSample I need set of nice Office icons for all sizes.<br>I will try to do this because sample really is&nbsp;<span style="line-height: 16.8px;">not&nbsp;</span>looking very good now&nbsp;<img src="http://forum.codejock.com/smileys/smiley6.gif" border="0" alt="Unhappy" title="Unhappy" />]]>
   </description>
   <pubDate>Tue, 06 Dec 2016 11:25:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23038&amp;PID=75425&amp;title=dpi-awareness-for-icons-in-ribbon#75425</guid>
  </item> 
 </channel>
</rss>