Click here to Skip to main content
11,721,053 members (81,317 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Can anybody share the code for uploading image using c# desktop application
Posted 29-Mar-13 0:07am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try These C# Code it's working:
private void Button_changeImage_LinkClicked(object sender, ButtonClickedEventArgs e)
        {
            objLog.WriteLog("Came to Edit Image of Student on Admission Form");
 
            string imagename;
            FileDialog openFileDialog_scanImage = new OpenFileDialog();
            openFileDialog_scanImage.Filter = "Image File (*.jpg;*.bmp;)|*.jpg;*.bmp;";
            try
            {
                if (openFileDialog_scanImage.ShowDialog() == DialogResult.OK)
                {
                    imagename = openFileDialog_scanImage.FileName.ToString();
                    Bitmap newimg = new Bitmap(imagename);
 
                    image_student.SizeMode = PictureBoxSizeMode.StretchImage;
 
                    image_student.Image = (Image)newimg;
 
                }
                openFileDialog_scanImage = null;
            }
            catch (System.ArgumentException ae)
            {
              MessageBox.Show(ae.Message.ToString());
 
            }
 

        }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hello Professional

there is several control method and classes like Picture box control and File Reader Write method by that you do this.

may these link will help you for your query......

http://www.c-sharpcorner.com/UploadFile/8ea152/fetch-image-from-database-in-windows-form-application/[^]


Happy to help
  Permalink  

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 500
1 OriginalGriff 334
2 Mika Wendelius 160
3 F-ES Sitecore 140
4 Maciej Los 80
0 Sergey Alexandrovich Kryukov 2,199
1 OriginalGriff 959
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web04 | 2.8.150901.1 | Last Updated 29 Mar 2013
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