Search This Blog

Clipboard to Copy Image in C# ,Net

To Copy the Image on the Clipboard the code would be..

First we need to open a Image File using OpenFileDialog.

1) Create an Object of OpenFileDialog , two Button and one PictureBox on the windows form

2) From the first button click event copy the Image to the Clipboard using the code below.

if (openFileDialog1.ShowDialog() == DialogResult.OK)

{

Image imageForCopy = Image.FromFile(openFileDialog1.FileName);

Clipboard.SetImage(imageForCopy);

}

3) From the second button click event set the Image from Clipboard to the Picture Box and clear the Clipboard.

pictureBox1.Image = Clipboard.GetImage();

Clipboard.Clear();


Submitted By Nipesh Shah @ 10/5/2011 12:04:22 PM

Link Within Related Posts Plugin for WordPress, Blogger...
There was an error in this gadget