[PR #540] Fixes #453 ink strokes not captured until stylus up #1143

Open
opened 2026-02-26 09:33:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NickeManarin/ScreenToGif/pull/540
Author: @theJosher
Created: 10/19/2019
Status: 🔄 Open

Base: masterHead: issues/ink-strokes-not-captured-until-stylus-up


📝 Commits (9)

  • 2f14456 Merge pull request #1 from NickeManarin/master
  • bb05fc4 adding overlay and logic to pull partial stroke from inking thread
  • 8375b57 Removed unused members
  • 160411a Fixed reset problem
  • 3fd19c1 Code cleanup and discard re-init of overlay
  • f85b908 Fixed overlay distortion issues by tweaking DrawingGroup instead of margins
  • 6ce3ee8 code review - changed order of private and static 😄
  • c76a89a uppercase
  • cf73ba3 slightly lighter PathGeometry

📊 Changes

3 files changed (+157 additions, -2 deletions)

View changed files

📝 ScreenToGif/Controls/InkCanvasExtended.cs (+122 -1)
📝 ScreenToGif/ImageUtil/ImageMethods.cs (+27 -0)
📝 ScreenToGif/Windows/Board.xaml.cs (+8 -1)

📄 Description

This fixes #453 by using reflection to get a frozen copy of DrawingGroups from the inking thread's real-time visual. Under normal use cases, it seems strokes are transitioned from the inking thread to the UI thread's InkCanvas when completed (e.g. stylus up). However, in our sort of unique case of animating the drawing process, we do want to see the real-time visual incrementally, so this fix pulls over the partial stroke as DrawingGroups into an image overlay that is Z-ordered above the InkCanvas. This extra partial-stroke-copy logic is only performed when a capture is desired (via thetimer), and the inking overlay is emptied when no partial stroke is alive.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NickeManarin/ScreenToGif/pull/540 **Author:** [@theJosher](https://github.com/theJosher) **Created:** 10/19/2019 **Status:** 🔄 Open **Base:** `master` ← **Head:** `issues/ink-strokes-not-captured-until-stylus-up` --- ### 📝 Commits (9) - [`2f14456`](https://github.com/NickeManarin/ScreenToGif/commit/2f14456dff7e85bc3ac80070f5cfeebb9ebea339) Merge pull request #1 from NickeManarin/master - [`bb05fc4`](https://github.com/NickeManarin/ScreenToGif/commit/bb05fc4cd8173044a3e2b5dd040e5a354e9d8d8f) adding overlay and logic to pull partial stroke from inking thread - [`8375b57`](https://github.com/NickeManarin/ScreenToGif/commit/8375b57067933dd1de6fae9c1882d34c5887ece6) Removed unused members - [`160411a`](https://github.com/NickeManarin/ScreenToGif/commit/160411a87b660efe9ae5e21b5fb68e433348e5f4) Fixed reset problem - [`3fd19c1`](https://github.com/NickeManarin/ScreenToGif/commit/3fd19c108d3cc055ff602511795de82804cdab40) Code cleanup and discard re-init of overlay - [`f85b908`](https://github.com/NickeManarin/ScreenToGif/commit/f85b908d4c8d0399a107ff99902a699fc6e24f96) Fixed overlay distortion issues by tweaking DrawingGroup instead of margins - [`6ce3ee8`](https://github.com/NickeManarin/ScreenToGif/commit/6ce3ee81d150ef960b5949676fa9ed000f9d51e7) code review - changed order of private and static :smile: - [`c76a89a`](https://github.com/NickeManarin/ScreenToGif/commit/c76a89a618276b651693b8777a3dd4f040d6f79f) uppercase - [`cf73ba3`](https://github.com/NickeManarin/ScreenToGif/commit/cf73ba39173226d475213868be9e03e7ff833003) slightly lighter PathGeometry ### 📊 Changes **3 files changed** (+157 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `ScreenToGif/Controls/InkCanvasExtended.cs` (+122 -1) 📝 `ScreenToGif/ImageUtil/ImageMethods.cs` (+27 -0) 📝 `ScreenToGif/Windows/Board.xaml.cs` (+8 -1) </details> ### 📄 Description This fixes #453 by using reflection to get a frozen copy of DrawingGroups from the inking thread's real-time visual. Under normal use cases, it seems strokes are transitioned from the inking thread to the UI thread's InkCanvas when completed (e.g. stylus up). However, in our sort of unique case of animating the drawing process, we do want to see the real-time visual incrementally, so this fix pulls over the partial stroke as DrawingGroups into an image overlay that is Z-ordered above the InkCanvas. This extra partial-stroke-copy logic is only performed when a capture is desired (via thetimer), and the inking overlay is emptied when no partial stroke is alive. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1143
No description provided.