TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abhas mangal
NA
7
0
Retrieve strokes from InkCanvas
Feb 7 2007 12:04 AM
hi friends, I want to implement undo and redo functionality such that when an graphical object is moved from one place to a different place and if undo option is selected then the object strokes are removed from the new place and added to the original place. For this,I need to retrieve strokes when the object is particularly selected by the user in the SelectionChanged Event of InkCanvas. I have written the following code : void inkcanvas1_SelectionChanged(object sender, EventArgs e) { StrokeCollection tempcol = inkcanvas1.GetSelectedStrokes(); removecl.Add(tempcol.Clone()); aftmovundo = 1; } In the function which implements the undo functionality I have written the following code : inkcanvas1.Strokes.Remove(redolist.scol[redolist.scol.Count - 1]); inkcanvas1.Strokes.Add(removecl.Clone()); Here strokes stored in removecl are not properly added into inkcanvas for e.g. if 80 strokes are saved in removecl then only 75 from them are added to inkcanvas. I don't know why this problem is taking place. The redolist contains the strokes of the object moved to the new position. Please guide me I am really caught up in an unpredictable error.
Reply
Answers (
0
)
how to use Windows Presentation Foundation
Use .net 2.0 components in WPF (.NET 3.0)