Mono implementation of Clipboard.GetImage()

Danilo Bargen <[email protected]>
Newsgroups gmane.comp.gnome.winforms
Message-ID <[email protected]>
Hello

I'm struggling with retrieving image data from the clipboard using the
System.Windows.Forms.Clipboard.GetImage() method. This is the code I'm
using:

> if ((image = Clipboard.GetImage()) != null)
> {
>     // (...)
> }
> else
> {
>     MessageBox.Show("No image data in clipboard.");
>     Close();
> }

I'm using Ubuntu 10.10 and Mono 2.6.7.

According to Microsoft docs [1], GetImage() should return "an Image
representing the image data in the data object or a null reference if
the data object does not contain any data that is in the Bitmap format
or can be converted to that format". I would assume that even though
Linux probably saves image data (e.g. from a screenshot or by copying
an image from the web) to the clipboard in a different format than
bitmap, C#/Mono should convert it accordingly. This does not seem to
work though.

Additionally, the MonoDevelop debugger does not seem to know GetImage():
> global::System.Windows.Forms.Clipboard.GetImage -
> Unknown Member: GetImage


Can someone help me with this issue? Is this a Mono problem?

Danilo

[1] http://msdn.microsoft.com/en-us/library/system.windows.forms.dataobject.getimage(v=VS.80).aspx
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.