15,791,229 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by daphne35 (Top 4 by date)
daphne35
13-Feb-14 4:32am
View
Here are some parts of the code :
In the Xaml file :
<window.datacontext>
<local:displayviewmodel>
<inkcanvas grid.row="1" x:name="myInkcanvas0">
<Image x:Name="img0" Source="{Binding Path0}" />
<inkcanvas grid.row="1" x:name="myInkcanvas1">
<Image x:Name="img1" Source="{Binding Path1}"/>
<Button Content="Save" Click="Save"/>
In the main cs file :
private void Save(object sender, RoutedEventArgs e)
{
SaveFile(((DisplayViewModel)this.DataContext).Path0, myInkcanvas0);
SaveFile(((DisplayViewModel)this.DataContext).Path0, myInkcanvas1);
}
private void SaveFile(string sPath, InkCanvas cnv)
{
FileStream stream = new FileStream(sPath, FileMode.Open, FileAccess.ReadWrite);
RenderTargetBitmap rtb = new RenderTargetBitmap(1200, 300, 0, 0, PixelFormats.Default);
rtb.Render(cnv);
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(rtb));
encoder.Save(stream);
stream.Close();
}
--> Exception : the process can not access to the file myfile.png because it is used by another process.
daphne35
30-Jan-14 4:29am
View
Thank you for your reply. I want this verification takes place at the same time the plot. You think it will work?
Moreover squares are part of the Strokes, I can get the coordinates of each square of the Stroke?
Thanks
daphne35
27-Jan-14 5:18am
View
I found the solution myself, I don't use two inkcanvas anymore because I can apply transformations directly on the image...
Thank you anyway.
daphne35
25-Jan-14 10:32am
View
hello,
I put an image that contains a green object on black background in an InkCanvas to be able to draw over. I also apply transformations to Inkvanvas (crushing, translation).
The fact of using a second InkCanvas allows me to draw in the departure area when the InkCanvas has been reduced and still have a black background behind.
I hope my explanation is not too confusing ...
thank you