<?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 : How to draw Markup with CMetaFileDC?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : How to draw Markup with CMetaFileDC?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 06:18:27 +0000</pubDate>
  <lastBuildDate>Tue, 08 Jul 2008 07:11:08 +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=11337</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[How to draw Markup with CMetaFileDC? : Hi oleg,  it works great!  ...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37958&amp;title=how-to-draw-markup-with-cmetafiledc#37958</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1867">WindFlashing</a><br /><strong>Subject:</strong> 11337<br /><strong>Posted:</strong> 08 July 2008 at 7:11am<br /><br /><P>Hi oleg,</P><DIV>&nbsp;&nbsp; it works great!</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; thanks!</DIV>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 07:11:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37958&amp;title=how-to-draw-markup-with-cmetafiledc#37958</guid>
  </item> 
  <item>
   <title><![CDATA[How to draw Markup with CMetaFileDC? : Hi,  You can Render it to Buffer...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37933&amp;title=how-to-draw-markup-with-cmetafiledc#37933</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11337<br /><strong>Posted:</strong> 08 July 2008 at 6:21am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>You can Render it to Buffer DC and then stretch to pDC:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>BOOL CDocSrvrItem::OnDraw(CDC* pDC, CSize&amp; rSize)<BR>{<BR>&nbsp;// Remove this if you use rSize<BR>&nbsp;UNREFERENCED_PARAMETER(rSize);</DIV><DIV>&nbsp;CDocDoc* pDoc = GetDocument();<BR>&nbsp;ASSERT_VALID(pDoc);</DIV><DIV>&nbsp;// TODO: set mapping mode and extent<BR>&nbsp;//&nbsp; (The extent is usually the same as the size returned from OnGetExtent)<BR>&nbsp;pDC-&gt;SetMapMode(MM_TEXT);<BR>&nbsp;pDC-&gt;SetWindowOrg(0,0);<BR>&nbsp;pDC-&gt;SetWindowExt(3000, 3000);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;CXTPMarkupContext* pContext = XTPMarkupCreateContext(0);<BR>&nbsp;<BR>&nbsp;CXTPMarkupUIElement* pElement = XTPMarkupParseText(pContext, _T("&lt;Ellipse Stroke='Yellow' StrokeThickness='3' Fill='Blue' Width='100' Height='100'/&gt;"));<BR>&nbsp;<BR>&nbsp;XTPMarkupMeasureElement(pElement, 100, 100);<BR>&nbsp;<BR>&nbsp;CWindowDC dcWindow(0);<BR>&nbsp;CDC dc;<BR>&nbsp;dc.CreateCompatibleDC(&amp;dcWindow);<BR>&nbsp;<BR>&nbsp;CBitmap bmp;<BR>&nbsp;bmp.CreateCompatibleBitmap(&amp;dcWindow, 100, 100);<BR>&nbsp;<BR>&nbsp;CBitmap* pOldBitmap = dc.SelectObject(&amp;bmp);<BR>&nbsp;<BR>&nbsp;dc.FillSolidRect(0, 0, 100, 100, 0xFF);<BR>&nbsp;<BR>&nbsp;if (pElement)<BR>&nbsp;{<BR>&nbsp;&nbsp;XTPMarkupRenderElement(pElement, dc, CRect(0, 0, 100, 100));<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;XTPMarkupReleaseElement(pElement);<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;pDC-&gt;StretchBlt(0, 0, 100, 100, &amp;dc, 0, 0, 100, 100, SRCCOPY);<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;dc.SelectObject(pOldBitmap);</DIV><DIV>&nbsp;XTPMarkupReleaseContext(pContext);</DIV><DIV><BR>&nbsp;return TRUE;<BR>}<BR></DIV>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 06:21:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37933&amp;title=how-to-draw-markup-with-cmetafiledc#37933</guid>
  </item> 
  <item>
   <title><![CDATA[How to draw Markup with CMetaFileDC? : I want to draw Markup with CMetaFileDC...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37930&amp;title=how-to-draw-markup-with-cmetafiledc#37930</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1867">WindFlashing</a><br /><strong>Subject:</strong> 11337<br /><strong>Posted:</strong> 08 July 2008 at 4:25am<br /><br /><P>I want to draw Markup with CMetaFileDC in CDocObjectServerItem::OnDraw(CDC* pDC, CSize&amp; rSize), but it fails to render.</P><DIV>BOOL CMySrvrItem::OnDraw(CDC* pDC, CSize&amp; rSize)<BR>{<BR>&nbsp;if (!pDC)<BR>&nbsp;&nbsp;return FALSE;</DIV><DIV>&nbsp;// Remove this if you use rSize<BR>&nbsp;UNREFERENCED_PARAMETER(rSize);</DIV><DIV>&nbsp;// TODO: set mapping mode and extent<BR>&nbsp;//&nbsp; (The extent is usually the same as the size returned from OnGetExtent)<BR>&nbsp;pDC-&gt;SetMapMode(MM_ANISOTROPIC);<BR>&nbsp;pDC-&gt;SetWindowOrg(0,0);<BR>&nbsp;pDC-&gt;SetWindowExt(3000, 3000);</DIV><DIV>&nbsp;// TODO: add drawing code here.&nbsp; Optionally, fill in the HIMETRIC extent.<BR>&nbsp;//&nbsp; All drawing takes place in the metafile device context (pDC).<BR>&nbsp;if (m_pUIElement)<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPMarkupDrawingContext dc(pDC-&gt;m_hDC);<BR>&nbsp;&nbsp;CRect rc(0, 0, 3000, 3000);<BR>&nbsp;&nbsp;m_pUIElement-&gt;Measure(&amp;dc, rc.Size());<BR>&nbsp;&nbsp;m_pUIElement-&gt;Arrange(rc);<BR>&nbsp;&nbsp;m_pUIElement-&gt;Render(&amp;dc);<BR>&nbsp;}</DIV><DIV>&nbsp;return TRUE;<BR>}</DIV><DIV>&nbsp;</DIV><DIV>Please help me.</DIV>]]>
   </description>
   <pubDate>Tue, 08 Jul 2008 04:25:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11337&amp;PID=37930&amp;title=how-to-draw-markup-with-cmetafiledc#37930</guid>
  </item> 
 </channel>
</rss>