Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 253635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:46:42+00:00 2026-05-11T21:46:42+00:00

In WPF, I’m starting to use classes such as LineGeometry, EllipseGeometry, GeometryGroup, Path… in

  • 0

In WPF, I’m starting to use classes such as LineGeometry, EllipseGeometry, GeometryGroup, Path… in order to draw 2D graphics. I chose these over shapes because I saw it could be faster thanks to the freezing feature.

I need to draw text along with geometry, with specific fonts. The text needs to be positionnable with the same coordinate system as the geometry. And I need to be able to apply a transform such as RotateTransform.

What would be the best way? I’ve run across the GlyphRunDrawing class but it’s really complicated.

Thanks a lot in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:46:42+00:00Added an answer on May 11, 2026 at 9:46 pm

    To create a text geometry just use FormattedText.BuildGeometry, for example, to get a geometry of “Text to display” in font Tahoma size 16 pixels at point (5,5) use:

        FormattedText text = new FormattedText("Text to display",
            CultureInfo.CurrentCulture,
            FlowDirection.LeftToRight,
            new Typeface("Tahoma"),
            16,
            Brushes.Black);
        Geometry geometry = text.BuildGeometry(new Point(5, 5));
    

    If you need to do this in XAML you can wrap up this code in a MarkupExtention

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

WPF, Browserlike app. I got one page containing a ListView. After calling a PageFunction
WPF's view model oriented way of doing things makes it very tempting to just
WPF doesn't provide the ability to have a window that allows resize but doesn't
WPF GridSplitter makes my Grid wider than my Window! I've got a WPF Grid
WPF validation system performs intial validatation of an object (I mean - all fields
Learning WPF nowadays. Found something new today with .Net dependency properties. What they bring
Some WPF controls (like the Button ) seem to happily consume all the available
Using WPF, I have a TreeView control that I want to set its ItemTemplate
So WPF doesn't support standard sorting or filtering behavior for views of CompositeCollections, so
In WPF, is it possible for a DataTrigger to bind to an attached property?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.