Hi,
Please say anyone how to use
PictureBox.Image.Save() Using C#
My requirement is to save the image which is in picture to Application Folder ... I mean the image is to be saved to the folder which is in the solution folder(Application.StartUpPath.. like that) and the path should be hotcoded...
Loading
Valarmathi VPosted Oct 28, 2008, 12:51 AM
Yes, Application.StartUpPath will go to debug folder only. usually we don't use the solution folder in runtime environment because of security issues.
if the XML files serves configuration information, you better include a configuration file.
if you are using xml file for some other purpose you have to give the location of the file. even though you are storing it in the solution folder (Project Name -> add new item -> XML file ) you need to give the full path.
vinodPosted Oct 24, 2008, 3:01 AM
The main problem is
I created an xml in my application by MyWindowsApplication -> Add New Item -> XML File and created data in that. ok it's fine. But when ever iam trying to Load(XmlDocument.Laod) that XML using Application.StratUpPath it is going to ....\bin\Debug\... instead of getting MyXML which i have creaed recently. and it showing file not found error....
Am i clear in explaining my dought.. if not again i will expalin it clearly ..
Valarmathi VPosted Oct 24, 2008, 2:24 AM
I think u can't access ur project folder(where forms, forms.cs are stored) during runtime or after deployment.
It is accessible only during compile time.
SO you can access only the debug folder during runtime.
vinodPosted Oct 23, 2008, 9:35 AM
But it is saving the image ....\bin\Debug\"MyImageFolder";
now i added a folder to my project(where we can see all the forms and forms.cs in Solution Explorer ). there in that folder can i save or place my image instead of saving the image at .....\bin\Debug\".." ?
Valarmathi VPosted Oct 23, 2008, 7:02 AM
if the picture is loaded in the picture box and you want to store it in solution folder, hope the following couple of lines can help you
string
filename = Application.StartupPath + "\\myImage.jpg";pictureBox1.Image.Save(filename);