Good morning (o;
Is pasting a picture from a clipboard only possible when the clipboard was filled from the same app or should it also work when copying a picture from another application?
For example when I copy a PNG from SF Symbols this code tells me that there is no picture in the clipboard:
Var c As New Clipboard
If c.PictureAvailable Then
Var myPicture As Picture
myPicture = c.Picture
Canvas1.Backdrop = myPicture
Else
TextArea1.AddText("No picture..." + EndOfLine)
End If
c.Close
But with the same code using an image copied from Preview (macOS) or GIMP (etc.) works fine.
Check with the Apple documentation how to do so with The SF Symbol Font (‘cause I do not know).
Have-you searched in this Forum ?
Remember me: are-you running mcOS ?
Hmmm…you’re right…from Preview app it works…
But copying from SF Symbols to Preview works as well when choosing in Preview “New from Clipboard”. Also pasting into Affinity Designer 2 is fine.
In SF Symbols you can just right click on a symbol and then choose “copy as picture” with option as PNG or SVG.
Must then be another format Xojo doesn’t understand…
Check what’s on the clipboard with an app like Clipboard Viewer.
It may be a PDF or similar, but not a picture.
This tells me “Show Clipboard” in Finder:
So the Clipboard is just a file path?
Found it (o;
This is how SF Symbols stores a PNG in the clipboard:
If c.RawDataAvailable("public.file-url") Then
TextArea1.AddText("RawData in clipboard" + EndOfLine)
End If
In AppleScript Editor:
return clipboard info
It will return what is really in your Clipboard…
Already solved…as mentioned above it is a public.file-url UTI…
Pasting from SF Symbols works now in my little Scaler app (o;