Click here to Skip to main content
11,709,033 members (62,471 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0
how to save picture box image in folder which contains in solution explorer folder image and retrive image and display in picture box in C# windows application

i want to save in folder(Folder name:Image) only...that folder(Folder name:Image) is in solution explorer...if i copy my project to other drive...how to save image...it show error kmow...
Posted 14-Feb-12 20:24pm
Edited 15-Feb-12 0:01am
v2
Comments
manognya kota at 15-Feb-12 2:26am
   
Its little unclear.From where do you want to save to where ? and from where you want to retrieve and display?
kaushikjoshi at 15-Feb-12 2:42am
   
please clear the question.
Do you want to save image in a folder and path save to sql after that retrieve or any other way?
itsureshuk at 15-Feb-12 5:25am
   
i want to save in folder(Folder name:Image) only...that folder(Folder name:Image) is in solution explorer...if i copy my project to other drive...how to save image...it show error kmow...
ProEnggSoft at 15-Feb-12 6:53am
   
You can use Application.StartupPath property. See solution 2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use the PictureBox class's ImageLocation property to load image from a file into the picture box and use PictureBox.Image.Save method to save the image of the PictureBox to a file. You can see an example here.
http://stackoverflow.com/questions/1063505/c-sharp-how-to-save-a-picturebox-control-as-a-jpeg-file-after-its-edited[^]

If your problem is solved you may accept the solution, otherwise please post your queries.

PES
  Permalink  
v2
Comments
ProEnggSoft at 15-Feb-12 5:27am
   
Thank you :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Regarding saving the file to a folder under your solution,
you can use the Application.StartupPath property. This gives the folder of the executable file of the application. e.g.
pictureBox1.Image.Save(Application.StartupPath + "\\Image\\picture1.jpg");


PES
  Permalink  
Comments
Deoki Nandan at 26-Mar-12 6:04am
   
If I want to save filename as text of textbox containing name of person then what will I have to do ? please reply ASAP. I need it.
AchyuthaAA at 13-Jun-13 8:00am
   
how to save image in a particular folder in wpfpage "image.save" is not the correct option.
Please help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 580
1 Maciej Los 235
2 Peter Leow 219
3 OriginalGriff 214
4 Mika Wendelius 170
0 OriginalGriff 9,348
1 Sergey Alexandrovich Kryukov 8,727
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 22 Jun 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100