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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:37:26+00:00 2026-05-12T21:37:26+00:00

I want to use custom brushes with the InkCanvas. Their is a code snippet

  • 0

I want to use custom brushes with the InkCanvas.

Their is a code snippet from MSDN. (http://msdn.microsoft.com/en-us/library/ms747347.aspx)

If i use that code and move my mouse VERY fast i get space between the brushes(ellipses):
Screenshot

And my question is of course how to fix this but I’m also curious why this is happening (I want to learn from it) I thought maybe i did something wrong but even if i cut/paste the example it’s happening.

One little thing i noticed when reading the code was this comment in the CustomStroke class

// Draw linear gradient ellipses between
// all the StylusPoints in the Stroke

Seems to me like it should draw ellipses between the points not only at the points.

I’m using C#.NET.

Again in short:

  • Why is this happening
  • Help me fix it 🙂
  • 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-12T21:37:27+00:00Added an answer on May 12, 2026 at 9:37 pm

    Why this is happening

    The custom InkCanvas in the example draws an ellipse at every collected StrokePoint but makes no attempt to draw lines between them. The standard InkCanvas control is implemented by drawing lines between the points it is given. This is why the custom InkCanvas implementation from the example leaves gaps and the built-in one doesn’t.

    How to “fix” it

    The custom code could easily be extended to not leave gaps: In addition to drawing ellipses at each point, it could draw lines between each pair of points.

    Code to draw connecting lines might be added before the code to draw the ellipses, like this:

    // Draw connecting lines
    var geo = new StreamGeometry();
    using(geoContext = geo.Open())
    {
      geoContext.StartFigure(stylusPoints[0], false, false);
      geoContext.PolyLineTo(stylusPoints.Skip(1).Cast<Point>(), true, false);
    }
    drawingContext.DrawGeometry(null, connectingLinePen, geo);
    
    // Draw ellipses
    for(int i = 1; i < stylusPoints.Count; i++)
    {
      ... etc ...
    

    This code works by constructing a polyline StreamGeometry and then drawing it to the context. Using a StreamGeometry in this context is generally more efficient than creating a PathGeometry with a Polyline or doing a bunch of DrawLine calls directly on the drawingCanvas.

    Note: Using a better digitizer won’t solve the underlying problem, which is that the custom InkCanvas is actually designed to only show data at the sampled points and not in between.

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

Sidebar

Related Questions

I want to use Custom URL Scheme to transfer data from application to other
I'm currently investigating the possibility to use custom attributes derived from ActionFilterAttribute. I want
I want to use custom exception handling, for example instead of using (Exception ex)
I want to use a custom template file which shoud use the base layout
I want to use a custom property to interact between controllers. Or do I
I want to use a custom class that could handle querying easily. Are there
I am having an issue in iphone when i want to use a custom
I want to use an image or icon as a custom cursor in WPF
I want to use WCF pipeline to handle requests of some custom format (not
Hi I use a custom MembershipProvider. I want to know the current username during

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.