if (Clipboard.ContainsImage()) { MessageBox.Show("Clipboard contains an image."); } else { MessageBox.Show("Clipboard does not contain an image."); }
Bitmap bmp = new Bitmap("image.jpg"); Clipboard.SetImage(bmp); if (Clipboard.ContainsImage()) { MessageBox.Show("Image copied to the clipboard successfully!"); } else { MessageBox.Show("Failed to copy image to the clipboard."); }Package library: System.Windows.Forms.