且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用c#桌面应用程序上传图像

更新时间:2022-11-05 13:04:23

试试这些C#代码它正在运行:

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());

            }


        }


查看此文章



http://msdn.microsoft.com /en-us/library/ms229715%28VS.100%29.aspx [ ^ ]


Hello Professional



那里是这样的几种控制方法和类,如 Picture box control File Reader Write 方法。



这些链接可以帮助您查询......



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





乐于助人
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