<?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 : Make XAML markup DPI-aware?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Make XAML markup DPI-aware?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 09 Apr 2026 13:36:47 +0000</pubDate>
  <lastBuildDate>Thu, 17 Mar 2016 22:10:06 +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=22521</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[Make XAML markup DPI-aware? :   MacW wrote:Will this feature...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74599&amp;title=make-xaml-markup-dpiaware#74599</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8199">astoyan</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 17 March 2016 at 10:10pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by MacW" alt="Originally posted by MacW" style="vertical-align: text-bottom;" /> <strong>MacW wrote:</strong><br /><br />Will this feature be configurable?<br><br>Because my code has a lot of places where I manually scale the font-size I need to match the screen's DPI setting, and then hand over something like 14pt to the Codejock XAML parser. 14pt may be the result of scaling the desired 11pt size to a 140 DPI screen.<br><br>Codejock should <u>not scale</u> the 14pt again. Otherwise I would have to change al my code when I install the promised update. <br><br>There should be a switch for the markup context which allows me to tell if it should scale font sizes or not.<br><br></td></tr></table><div><br></div><div>Hello MacW,</div><div><br></div><div>Please provide a test XAML and try attach 2 screenshots, one of Codejock Markup rendered in 140DPI, another one from WPF application rendering the same markup in 140DPI.</div><div><br></div><div>Thank you.</div><div>Alexander</div>]]>
   </description>
   <pubDate>Thu, 17 Mar 2016 22:10:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74599&amp;title=make-xaml-markup-dpiaware#74599</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : Hello cpede,XTP_DPI should not...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74598&amp;title=make-xaml-markup-dpiaware#74598</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8199">astoyan</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 17 March 2016 at 10:06pm<br /><br />Hello cpede,<div><br></div><div>XTP_DPI should not appear in CXTPMarkupImage, it was a bug which we've just fixed. Please try the following below DIFF patch and let me know if it works fine for you:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>Index: Source/Markup/Controls/XTPMarkupImage.cpp</div><div>===================================================================</div><div>--- Source/Markup/Controls/XTPMarkupImage.cpp &nbsp; (revision 17587)</div><div>+++ Source/Markup/Controls/XTPMarkupImage.cpp &nbsp; (working copy)</div><div>@@ -102,7 +102,11 @@</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (NULL != m_pDeviceImage)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; szRet = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; szRet = m_pDeviceImage-&gt;GetSize();</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (NULL != m_pMarkupContext)</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; szRet = m_pMarkupContext-&gt;Scale(szRet);</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return szRet;</div><div>@@ -135,7 +139,12 @@</div><div>&nbsp; &nbsp; &nbsp; &nbsp; CSize size(0, 0);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (NULL != m_pDeviceImage)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = m_pDeviceImage-&gt;GetSize();</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (NULL != m_pMarkupContext)</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = m_pMarkupContext-&gt;Scale(size);</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>+</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!(size.cx == 0 || size.cy == 0))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XTPMarkupStretch stretch = GetStretch();</div><div>Index: Source/Markup/XTPMarkupContext.cpp</div><div>===================================================================</div><div>--- Source/Markup/XTPMarkupContext.cpp &nbsp;(revision 17587)</div><div>+++ Source/Markup/XTPMarkupContext.cpp &nbsp;(working copy)</div><div>@@ -483,6 +483,13 @@</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return NULL != m_pDpi ? m_pDpi-&gt;ScaleY(y) : y;</div><div>&nbsp;}</div><div>&nbsp;</div><div>+CSize CXTPMarkupContext::Scale(const SIZE&amp; size) const</div><div>+{</div><div>+ &nbsp; &nbsp; &nbsp; return NULL != m_pDpi&nbsp;</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? CSize(ScaleX(size.cx), ScaleY(size.cy))</div><div>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : size;</div><div>+}</div><div>+</div><div>&nbsp;CXTPMarkupObject* CXTPMarkupContext::CreateMarkupObject(CXTPMarkupType* pType)</div><div>&nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; CXTPMarkupObject* pObject = pType-&gt;CreateObject(this);</div><div>Index: Source/Markup/XTPMarkupContext.h</div><div>===================================================================</div><div>--- Source/Markup/XTPMarkupContext.h &nbsp; &nbsp;(revision 17587)</div><div>+++ Source/Markup/XTPMarkupContext.h &nbsp; &nbsp;(working copy)</div><div>@@ -263,6 +263,7 @@</div><div>&nbsp; &nbsp; &nbsp; &nbsp; float ScaleY(float y) const; // &lt;combine CXTPMarkupContext::ScaleX@int&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double ScaleX(double x) const; // &lt;combine CXTPMarkupContext::ScaleX@int&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; double ScaleY(double y) const; // &lt;combine CXTPMarkupContext::ScaleX@int&gt;</div><div>+ &nbsp; &nbsp; &nbsp; CSize Scale(const SIZE&amp; size) const; // &lt;combine CXTPMarkupContext::ScaleX@int&gt;</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //-----------------------------------------------------------------------</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Summary: Loads a chunk of script code in a specified language.</div></div><div></pre></td></tr></table></div><div><br></div><div>Thanks,</div><div>&nbsp; Alexander</div>]]>
   </description>
   <pubDate>Thu, 17 Mar 2016 22:06:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74598&amp;title=make-xaml-markup-dpiaware#74598</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : I was also surprised to find the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74588&amp;title=make-xaml-markup-dpiaware#74588</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 15 March 2016 at 4:02am<br /><br />I was also surprised to find the following code in&nbsp;CXTPMarkupImage two times:<div><span style="line-height: 13.44px;"><table width="99%"><tr><td><pre class="BBcode"></span></div><div>szRet = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div><span style="line-height: 13.44px;"></pre></td></tr></table></span></div><div>This breaks my Markup images because I use them together with some markup drawing elements.</div><div><br></div><div>I thought that Markup DPI awareness should be default off, but the line above does not look at this flag.</div><div><br></div><div>For v1700 I did the following fast fix:</div><div><span style="line-height: 13.44px;"><table width="99%"><tr><td><pre class="BBcode"></span></div><div><div>//szRet = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div>if (NULL != m_pMarkupContext &amp;&amp; m_pMarkupContext-&gt;IsDpiAware())</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>szRet = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div>else</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>szRet = m_pDeviceImage-&gt;GetSize();</div></div><div><span style="line-height: 13.44px;"></pre></td></tr></table></span></div><div><span style="line-height: 1.4;">In v1710 the correct solution would be to add a ScaleSize member to the&nbsp;CXTPDpi class, and a similar&nbsp;</span><span style="line-height: 13.44px;">ScaleSize&nbsp;</span><span style="line-height: 1.4;">method in&nbsp;CXTPMarkupContext calling this method if&nbsp;m_pDpi existed, and then finally change the line</span></div><div><span style="line-height: 13.44px;"><table width="99%"><tr><td><pre class="BBcode"></span></div><div>szRet = XTP_DPI(m_pDeviceImage-&gt;GetSize());</div><div><span style="line-height: 13.44px;"></pre></td></tr></table></span></div><div>to something like&nbsp;</div><div><span style="line-height: 13.44px;"><table width="99%"><tr><td><pre class="BBcode"></span></div><div><span style="line-height: 13.44px;">szRet =&nbsp;</span>m_pMarkupContext-&gt;ScaleSize(<span style="line-height: 13.44px;">m_pDeviceImage-&gt;GetSize());</span></div><div><span style="line-height: 13.44px;"></pre></td></tr></table></span></div><div><span style="line-height: 13.44px;">Please fix this.</span></div><div><span style="line-height: 13.44px;"><br></span></div><div><span style="line-height: 13.44px;">-cpede</span></div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Tue, 15 Mar 2016 04:02:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=74588&amp;title=make-xaml-markup-dpiaware#74588</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : Will this feature be configurable?Because...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73434&amp;title=make-xaml-markup-dpiaware#73434</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3104">MacW</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 19 May 2015 at 9:13am<br /><br />Will this feature be configurable?<br><br>Because my code has a lot of places where I manually scale the font-size I need to match the screen's DPI setting, and then hand over something like 14pt to the Codejock XAML parser. 14pt may be the result of scaling the desired 11pt size to a 140 DPI screen.<br><br>Codejock should <u>not scale</u> the 14pt again. Otherwise I would have to change al my code when I install the promised update. <br><br>There should be a switch for the markup context which allows me to tell if it should scale font sizes or not.<br><br>]]>
   </description>
   <pubDate>Tue, 19 May 2015 09:13:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73434&amp;title=make-xaml-markup-dpiaware#73434</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : That&amp;#039;s good news, Alexander...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73208&amp;title=make-xaml-markup-dpiaware#73208</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3104">MacW</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 15 April 2015 at 11:01am<br /><br />That's good news, Alexander <img src="http://forum.codejock.com/smileys/smiley1.gif" border="0" alt="Smile" title="Smile" /><br><br>Lets hope that it all works (because you write <i>'will support DPI scalling for most of the components'</i>).<br><br>I don't need much, I just use the XAML engine to render text, no graphics, no UI elements etc. So far I have been able to work around this by supplying the absolute font sizes to the markup at runtime.<br>]]>
   </description>
   <pubDate>Wed, 15 Apr 2015 11:01:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73208&amp;title=make-xaml-markup-dpiaware#73208</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : HelloMacW,All previous version...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73206&amp;title=make-xaml-markup-dpiaware#73206</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8199">astoyan</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 14 April 2015 at 11:39pm<br /><br />Hello&nbsp;<span style="font-size: 11px; line-height: 15.3999996185303px; : rgb248, 248, 252;">MacW,</span><div><br></div><div>All previous version of ToolkitPro, including the most recent 16.4.0, mostly do not support DPI scalling. But the next version which should be released in a few weeks will support DPI scalling for most of the components, it's already implemented and is currently in the testing stage. Note, for Markup DPI scalling will be disabled by default in order to provide backward compatibility, but it'll be easy to enable it by setting to TRUE an new bDpiAware argument of&nbsp;XTPMarkupParseText or calling CXTPMarkupContext::SetDpiAware. Once an update is out please re-test all your markup related functionality with the DpiAware option enabled to make sure nothing is broken and let me know if you find any issues.</div><div><br></div><div>Thank you.</div><div>Regards,</div><div>&nbsp; Alexander Stoyan</div>]]>
   </description>
   <pubDate>Tue, 14 Apr 2015 23:39:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73206&amp;title=make-xaml-markup-dpiaware#73206</guid>
  </item> 
  <item>
   <title><![CDATA[Make XAML markup DPI-aware? : I use the latest version of XTP.I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73057&amp;title=make-xaml-markup-dpiaware#73057</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3104">MacW</a><br /><strong>Subject:</strong> 22521<br /><strong>Posted:</strong> 21 January 2015 at 10:27am<br /><br />I use the latest version of XTP.<br><br>I tried to render XAML markup into a device context that has 300 DPI. <br><br><font color="#663300">XTPMarkupParseText(...)<br>XTPMarkupRenderElement(...,*pDC,Rect);<br>XTPMarkupReleaseElement(...);<br></font><br>But all measures used in the markup, e.g. <b>FontSize='24pt'</b> do not scale to the DPI settings of the output device context. Looking at the markup source code in XTP reveals that measurements like 24pt are transformed assuming a DPI setting of 96 DPI. <br><br>For example, look at <b>CXTPMarkupBuilder::ConvertLength</b> in Source\Markup\XTPMarkupBuilder.cpp.<br><br>Thís makes it impossible to render markup device-independently. All font-measurements (and others) have to be parametrized and calculated and inserted at runtime, before calling the XTP <i>MarkupParseText</i> and <i>MarkupRenderElement</i> methods.<br><br>There are now monitors with more than 96 DPI, font-scaling may be used in Windows or a programmer may want to render Codejock XAML markup into a printer or PDF device context.<br><br>Is there hope that this will be corrected in the foreseeable future or do I need to come up with my own solution to this hard-coded DPI dependency?<br>]]>
   </description>
   <pubDate>Wed, 21 Jan 2015 10:27:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22521&amp;PID=73057&amp;title=make-xaml-markup-dpiaware#73057</guid>
  </item> 
 </channel>
</rss>