Store Object2D / Group2D in Clipboard Raw Data

“com.apple.pict” is the UTI for old QuickDraw Image file format

[code] Dim Clip As New Clipboard

// RawData for QuickDraw Image (old PICT): “com.apple.pict”
If App.g2D <> Nil Then
// Parametes are not compatible with this function:
’ Clip.AddRawData(“com.apple.pict”,App.g2D)

// Parametes are not compatible with this function:
'Clip.AddRawData("org.oasis-open.opendocument.graphics",o2D)

// Parametes are not compatible with this function:
'Clip.AddRawData("com.apple.pict",App.g2D)

// Parametes are not compatible with this function:
Clip.AddRawData("PICT",App.g2D)

End If
Clip.Close

// Nota: g2D = Group2D
// o2D = Object2D

// Handled !
Return True[/code]

Nota: the following line compiles nicely… but is not what I want.

Clip.AddRawData("com.apple.pict","App.g2D")

You’re doing it backwards
Clipboard.AddRawData ( Data As String, DataType As String )
http://documentation.xojo.com/index.php/Clipboard.AddRawData

Hi Norman,

“Doing backward”: That does not astonish me, in the absolute, but I consulted the page of reference so much of time…

After reading the AddRawData page:

  1. I understand why I made the mistake. My coding looks like what we do using FolderItem.

  2. I do not understand why I made the mistake since there is an example that shows I wrote it backward !!!

Have a nice Sunday…

NBorman,

I checked:

Clip.AddRawData(App.g2D,"com.apple.pict")

and it returns the very same error message.

I also tried:

[code]Dim CLip As New Clipboard
Dim a As New ArcShape

a.ArcAngle = 1.57
a.StartAngle = -1.57
a.FillColor = RGB(255, 0, 127)

Clip.AddRawData(a,“com.apple.pict”)

Clip.Close
[/code]
(from memory.)

And get the same error reported.