开发者

How to capture the image in picturebox and make it downloadable in c# application?

开发者 https://www.devze.com 2023-03-19 09:39 出处:网络
im developing a c# application (Photo Album Viewer), Im having Picturebox (Displa开发者_开发百科ys the selected image in List ) and listbox (Lists the images available ibn database table ).

im developing a c# application (Photo Album Viewer), Im having Picturebox (Displa开发者_开发百科ys the selected image in List ) and listbox (Lists the images available ibn database table ). I can upload and store the images easily. Now i want to download the image i.e. selected in the listbox is there any standard procedure to capture the image in picture box and download the selected image?


I think what you are looking for is something like this (this is barebones, and would need a lot more error checking, etc.). Make a button to save the image (or however you are going to handle that aspect of it).

    private void SaveMe_Click(object sender, EventArgs e)
    {
        SaveFileDialog save = new SaveFileDialog();
        save.Filter = "JPEG files (*.jpg)|*.jpg";//change for your needs
        if (save.ShowDialog() == DialogResult.OK)
        {
            pictureBox1.Image.Save(save.FileName);
        }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消