This should provide the answer:
Clipboard handling with .NET[
^].
Sorry, it is C#, but if you want to get some good help or code samples, you need to understand at least some of C#; just VB.NET won't help you much.
After all, all you need to know is this: use
System.Windows.Forms.Clipboard.SetImage
(for
System.Windows.Forms
). For WPF, this is
System.Windows.Clipboard.SetImage
.
[EDIT]
The methods
SetImage
adds data in the Bitmap format (
CF_BITMAP
in windows,
public static readonly string System.Windows.Forms.DataFormats.Bitmap
). This format is common for all bitmaps and has nothing to do with bitmap files and their details, such as compression, quality loss, etc. So the clipboard contains data about bitmap and not about bitmap file; this is irrelevant to the difference between JPEG, PNG and BMP.
About clipboard formats, see
http://msdn.microsoft.com/en-us/library/ms649013(v=vs.85).aspx[
^].
As you can see from this link, alternatively you can create (unregistered) private format, or register your custom format in the system. For more information, see:
http://msdn.microsoft.com/en-us/library/y444e6db.aspx[
^]. I do not recommend it; dealing with CB_BITMAP format is much better; it makes it possible to exchange images and image fragments between all applications in the system no matter what formats they support.
—SA