15,917,731 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 Visual Basic questions
View Python 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 r.nd.k (Top 8 by date)
r.nd.k
16-Jan-12 15:09pm
View
Thanks !
r.nd.k
16-Jan-12 15:08pm
View
Thanks ! Brilliant idea
r.nd.k
16-Jan-12 15:00pm
View
mmm well the folder contains images ,those images have been added to it from code source
I guess I have to dispose them before deleting the folder
otherwise the folder cannot be deleted
r.nd.k
31-Dec-11 10:19am
View
Thnx but
var image = Clipboard.GetImage();
Always gives me null !
How can I fixe that?
r.nd.k
31-Dec-11 10:10am
View
Deleted
The process cannot access the file because it is being used by another process.
I Always Get this error ! I know I have to dispose the Image but how?
btw the framework elememt can be a type Image right?
r.nd.k
31-Dec-11 10:10am
View
Deleted
The process cannot access the file because it is being used by another process.
I Always Get this error ! I know I have to dispose the Image but how?
I used this one!
the framework elememt can be a type Image right?
void SaveToPng(FrameworkElement visual, string fileName)
{
var encoder = new PngBitmapEncoder();
SaveUsingEncoder(visual, fileName, encoder);
}
void SaveUsingEncoder(FrameworkElement visual, string fileName, BitmapEncoder encoder)
{
RenderTargetBitmap bitmap = new RenderTargetBitmap(
(int)visual.ActualWidth,
(int)visual.ActualHeight,
96,
96,
PixelFormats.Pbgra32);
bitmap.Render(visual);
BitmapFrame frame = BitmapFrame.Create(bitmap);
encoder.Frames.Add(frame);
using (var stream = File.Create(fileName))
{
encoder.Save(stream);
}
}
r.nd.k
31-Dec-11 10:08am
View
The process cannot access the file because it is being used by another process.
I Always Get this error ! I know I have to dispose the Image but how?
I used this one!
the framework elememt can be a type Image right?
void SaveToPng(FrameworkElement visual, string fileName)
{
var encoder = new PngBitmapEncoder();
SaveUsingEncoder(visual, fileName, encoder);
}
void SaveUsingEncoder(FrameworkElement visual, string fileName, BitmapEncoder encoder)
{
RenderTargetBitmap bitmap = new RenderTargetBitmap(
(int)visual.ActualWidth,
(int)visual.ActualHeight,
96,
96,
PixelFormats.Pbgra32);
bitmap.Render(visual);
BitmapFrame frame = BitmapFrame.Create(bitmap);
encoder.Frames.Add(frame);
using (var stream = File.Create(fileName))
{
encoder.Save(stream);
}
}
What I did was cutting the original image into pieces
each piece i memorized its data in a struct
struct ImagePuzzle
{
public System.Windows.Controls.Image pieces;
}
At the end I want to save each piece in a specific folder !
But I'm getting the previous error because I guess I have to dispose them !
How Can I do such thing?
r.nd.k
30-Dec-11 16:11pm
View
Thank you ! But isn't what you gave me for Windows form not wpf?
because I already tried it but (image1.Save) didn't exist!
Show More