Wednesday, March 13, 2013

Using Clipboard

Clipboard.SetText(txtClipboard.Text);
txtClipboard.Text = Clipboard.GetText();
Clipboard.Clear();

//get the selected image into clipboard
OpenFileDialog selImage;

if (selImage.ShowDialog() == DialogResult.OK)
{
    Image myImage = Image.FromFile(selImage.FileName);
  Clipboard.SetImage(myImage);
}

clipBoardImage.Image = Clipboard.GetImage();

No comments:

Post a Comment