If you want to snag clipboard data from a different application into the context of your running .Net application, here’s how you can do it:
private static Image GetImageFromCopyPasteBuffer()
{
Thread t = new Thread(new ThreadStart(GetClipboardBitmap));
t.SetApartmentState(ApartmentState.STA);
t.Start();
t.Join();
return _clipBoardImage;
}
private static void GetClipboardBitmap()
{
IDataObject data = Clipboard.GetDataObject();
if (data == null || !data.GetDataPresent(DataFormats.Bitmap, true))
throw new ApplicationException("No clipboard image data was present.");
_clipBoardImage = (Image)data.GetData(DataFormats.Bitmap);
}
Hope this helps!