Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - HOW TO: Render XAML markup into a device context
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOW TO: Render XAML markup into a device context

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: HOW TO: Render XAML markup into a device context
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 9:50am
Thanks, Oleg.
This worked! Support for XAML is a very valuable addition to XTP.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.