[Mono-winforms-list] Clipboard.SetDataObject() doing nothing
Christoph Teuber
christoph.teuber at gmx.li
Fri Jun 19 17:40:56 EDT 2009
Hello,
thanks for doing this, but unfortunately it still doesn't seem to work.
I tried
Mono JIT compiler version 136402 (tarball Thu Jun 18 16:14:38 CEST 2009)
and pasting an image to the clipboard has no effect.
I did append a small test application to demonstrate the behaviour. The
.exe-Version has been compiled with VisualStudio 2008.
It has two buttons to load an image and puts it into the clipboard (a
file called "test.jpg" needs to be in the program directory). After
pasting the image, the formats are listed in a combobox and selecting
one of them loads the clipboard contents into the picturebox above.
Under Windows, this works without problems.
Under mono on Ubuntu 9.04, no format will be found after storing the
data. Another strange thing is, that old clipboard contents reappears if
the formats are listed again. If text is in the clipboard before the
image is stored, it seems to be gone because listing the formats results
in 0 entries. Listing them for a second time, returns the old string
formats as results. Even clearing the clipboard doesn't work.
System.Drawing.Image implements ISerializable, so this can't be the
problem.
Concerning large objects in the clipboard, I think you're wrong. Under
Windows, there is no problem with cutting some detail out of a picture,
pasting it into the clipboard, copying it over the net and pasting it
into another application on the remote computer. No path is used there.
Greetings
Christoph
Carlos Alberto Cortez wrote:
> Hey!
>
> Sorry for the late answer. Basically in trunk we now support custom
> formats in the Clipboard - observe, however that only types
> implementing ISerializable can properly be 'copied/pasted'.
>
> Anyway, just as a general recommendation, you should avoid putting any
> large object in the Clipboard as possible - for example, both Windows
> and Gnome, when copying/pasting pictures usually only put the path in
> the clipboard, and then they proceed to use that path when needed.
>
> About the protocol, probably you can keep your eyes out of it ;-) The
> basic answer to your issues, is that the used protocol is old and is
> not as unified -format wise- as you could expect. The basic
> interaction between them is basically compatible with text -as you can
> copy text between apps and even window managers and toolkits- but
> *usually* other types should be used as application-dependant.
>
> If you want to take a look at the protocol, read
> http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki and
> http://www.jwz.org/doc/x-cut-and-paste.html
>
> Carlos.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoCliptest.exe
Type: application/x-ms-dos-executable
Size: 10752 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090619/d6c670db/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoCliptest.zip
Type: application/zip
Size: 5503 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090619/d6c670db/attachment-0001.zip
More information about the Mono-winforms-list
mailing list