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
Lahiru Mahagamage
NA
45
1.3k
How to delete file opened by a Canvas
Jan 12 2018 4:00 AM
hello guys,
I'm
opening a .bmp image created on a folder on a InkCanvas
to draw on like below. And when i'm closing it i want the TempFile to be deleted. but
when i try to delete it says the file is used by another process
. is there anyway to do this? I'm using WPF C#. Please help me out.
Thanks you! :)
img =
new
BitmapImage(
new
Uri(TempFile, UriKind.Relative));
myImageBrush =
new
ImageBrush(img);
myCanvas =
new
Canvas();
myCanvas.Width = img.Width;
myCanvas.Height = img.Height;
myCanvas.Background = myImageBrush;
cw.ImgPO.Height = img.Height;
cw.ImgPO.Children.Add(myCanvas);
Reply
Answers (
6
)
Converting Celsius to Farenheit
Expert advice on app development