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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:55:11+00:00 2026-05-24T11:55:11+00:00

I am using stylus input to draw lines in a canvas. I want to

  • 0

I am using stylus input to draw lines in a canvas. I want to change the color of the stroke with the pen pressure. so I used:

DrawingAttributes dattribute = new DrawingAttributes();
inkcan.EditingMode = InkCanvasEditingMode.Ink;

if (stylusInput.pressureFactor < 0.5)
dattribute.Color = Colors.Red;
else
dattribute.Color = Colors.Blue;

inkcan.DefaultDrawingAttributes = dattribute;

but I have found that the color changes only when I lift off and retouch the pen to tablet surface. I am not sure how to fix that problem.

Any help would be greatly appreciated.

  • 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-24T11:55:12+00:00Added an answer on May 24, 2026 at 11:55 am

    Look at this question: InkCanvas Eraser

    In the MSDN it states:

    If you change the EraserShape, the cursor rendered on the InkCanvas is
    not updated until the next EditingMode change.

    The effect you are experiencing might be caused by the EditingMode being changed when you pull the pen off the canvas and put it back down.

    If so, you could toggle the EditingMode property as I suggested in the linked answer.

    EDIT

    Have a look at this a 3rd down it says:

    Off course, life is never as simple as that, so there is one more
    little issue to handle. Apparently, the InkCanvas uses different
    renderers for the final result compared to while the strokes are being
    drawn. To show a transparency based on the pressure while the
    drawing action is still in progress, we need to use the protected
    property called DyamicRenderer which gets/sets the object used to
    render the strokes on a drawing context while the stroke is being
    drawn. This rendering object must be a descendent of DynamicRenderer.
    All you need to do here is override the OnDraw method and change the
    brush that is used. When you assign a new value to this property, the
    InkCanvas actually changes an internal ‘PlugIn list’ which is called
    whenever data is entered using the stylus.

    This might be it.

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

Sidebar

Related Questions

I'm using the new RichTextBox control in SL4Beta and want to create styles for
I am using jquery ui datepicker this way: $('<input type=text />').datepicker({ buttonImage: http://localhost:2000/proj/styles/calendar/images/calendar/cal.gif }).appendTo(container);
It seems that even when using shivs you can't do something like input[type=search] to
iam using rails with formtastic for my admin backend. i want to be able
I am using Twitter's Bootstrap to build a form (served by django). I want
I'm using a special input type for the iPhone mobile safari browser: <li><textarea placeholder=Store
I have a multitoch-enabled tablet PC running Windows 7. However, when using the stylus
Hy, I have a live username validation using ajax : <td id=user_process_live><input type=text id=user_live_ver
Basically I want user to click on any .editable item, which makes an input
I was thinking of using these styles for easier cell rollover effects in a

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.