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 927051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:47:20+00:00 2026-05-15T19:47:20+00:00

I have a scribbale inkpresenter in my silverlight app that I’m using multiple times

  • 0

I have a scribbale inkpresenter in my silverlight app that I’m using multiple times in different shapes, I want to calculate how much percent of the inkpresenter has been scribbled,

My problem is that since the shape of the ink presenter can be circular or poly I don’t know how i can get the units/pixels there is available on the scribbable surface.

As far as i understand is that the actualWidth and actualHeight properties will only help me for rectangular shape by calculating

units = uielemnt.Actualwidth * uielement.ActualHeight

but for costum shapes I’m not sure how the actualWidth/Height are calculated.

  • 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-15T19:47:20+00:00Added an answer on May 15, 2026 at 7:47 pm

    WPF Answer

    In WPF you can just use Geometry.Combine to combine the stroke geometries, then call GetArea on the combined geometry to get the total area covered.

    Silverlight Answer

    In Silverlight you don’t have Geomerty.Combine or Geometry.GetArea, and you also don’t have RenderTargetBitmap. So in Silverlight I think you have to do the calculations yourself.

    Here are the setup steps:

    1. Convert the geometries to cubic bezier curves (approximate arcs, all else are exact)
    2. Split all curves at their x minima and x maxima
    3. Rearrange coordinates so each curve goes from low x to high x
    4. Sort by x then y of first coordinate
    5. Start at minimum x coordinate with no active curve segments

    Here is the main loop:

    1. Add any bezier curves that start at the current x coordinate to the active list
    2. Remove any bezier curves that end at the current x coordinate from the active list
    3. Compute intersections of active bezier curves. Find next x coordinate of such intersection.
    4. Let “end x” be earliest of next line intersection and next start or stop coordinate of a bezier curve
    5. Compute area from current x to “end x” then set current to end
    6. Repeat until “end x” reaches macimum x coordinate of any curve

    Here is the inner loop that computes the area:

    1. Go through active curves in increasing y.
    2. Every time a curve is passed flip the “inside” bit for the original geometry for that curve.
    3. Every time y changes any “inside” bit is set, compute the area between the previous bezier curve and the current one and add it to the grand total area

    That’s it.

    More details on Silverlight answer

    Formulas to convert segments of a PathGeometry into a cubic bezier approximation:

    • BezierSegment: Cubic control points are P0, P1, P2, P3 (no change)
    • LineSegment: Cubic control points are P0, P0, P1, P1
    • QuadraticBezierSegment: Cubic control points are P0, (P0+2P1)/3, (2P1+P2)/3, P2
    • ArcSegment: Divide into octants and for each, compute unit tangent vectors T0, T1 at start & end pointing toward arc, generate control points (approximation) of P0, P0 + T0 * 4/3*(Sqrt(2)-1)*R, P1 + T1 * 4/3(Sqrt(2)-1)*R, P1, then modify with size and RotationAngle
    • Poly…Segment: Break into individual segments, then use above formulas on each

    Computing intersections of active Bezier curves:

    • Since the curves have already been split at their minima / maxima, each is a smooth, continuous function of x, you can use these techniques to compute their intersection
    • It can save some computation if you check y minima/maxima to see if there is any possible overlap before actually computing the intersection
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a n-tire web application and search often times out after 30 secs. How
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
Have you determined a maximum number of characters allowed in FCKEditor ? I seem
Have you managed to get Aptana Studio debugging to work? I tried following this,
Have had to write my first proper multithreaded coded recently, and realised just how
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the

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.