Hi!
Coming from Java, I am new to Xojo, so please forgiv me, if I am overseeing the obvious…
So I have a MemoryBlock, which starts with 4 bytes holding the size and then the data itself.
Usually, the data is only a small amount, which means 2 or 3 of the leading size bytes are 00 00 00 00.
Clipboard.AddRawData acceppts only a string and is truncated after the size-byte because it thinks it is a null terminated string.
So what I am looking for is a wary to put the whole MemoryBlock into the clipboard.
This is some sample code (not pretty, just a prototype):
Dim c as new Clipboard
Dim mb as New MemoryBlock(0)
Dim bs as New BinaryStream(mb)
bs.WriteLong(128) // ToDo: Put the actual size into the fist 4 bytes. Put value 128 for first test.
bs.Write(blobdata)
bs.Close
msgbox(str(mb.size))
c.AddRawData(mb, type)
c.Close
Thank you very much,
Bernhard