Print Page | Close Window

HOW TO: Render XAML markup into a device context

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=10780
Printed Date: 28 September 2024 at 4:54pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOW TO: Render XAML markup into a device context
Posted By: MacW
Subject: HOW TO: Render XAML markup into a device context
Date Posted: 26 May 2008 at 10:14am
Hi,

is there a way to render markup into an arbitrary device context?
Without the need to use one of the markup-enabled XTP Controls I mean?

I see that some of your samples use a CXTPMarkupContext class, but there is no documentation for this class anywhere. I know XTP documentation is sparse, but there is absolutely nothing on this class, or the promised "render" function which allows me to render markup into a DC. Any help appreciated.



Replies:
Posted By: Oleg
Date Posted: 26 May 2008 at 10:25am
Hi,
 
Here small sample:
 
CXTPMarkupContext* pMarkupContext = XTPMarkupCreateContext();
 
CXTPMarkupUIElement* pMarkupUIElement = XTPMarkupParseText(pMarkupContext , lpszCaption);
// Optional
XTPMarkupSetDefaultFont(pMarkupContext (HFONT)pFont->GetSafeHandle(), pDC->GetTextColor());
 
XTPMarkupRenderElement(pMarkupUIElement, pDC->GetSafeHdc(), rcText);
 
XTPMarkupReleaseElement(pMarkupUIElement);
XTPMarkupReleaseContext(pMarkupContext);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MacW
Date Posted: 27 May 2008 at 9:50am
Thanks, Oleg.
This worked! Support for XAML is a very valuable addition to XTP.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net