Multiple Pictures on Clipboard?

I have tried many different ways to put multiple pictures onto the clipboard. No matter what I have tried (outside of not using the clipboard) I can only get the “last” picture onto the clipboard.

I have been moderately successful with taking a screen shot of the objects and then putting them onto then clipboard, however I always get ALL of the objects vs. the ones I selected using Drawinto.

How should I be approaching this?

Thank you much in advance.

Do you need to have this “clipboard” available to external apps? or just for cutting/pasting inside your own?

If needed for external… I do not believe it is possible, clipboard usually contains one object.

If for internal… use an array or dictionary…

FYI… Snapdragon misses you :slight_smile:

Clipboard for External apps. I already have methods (Using Array of Picture Classes) for Internal Copy/Paste to handle the multiple pictures etc.

I just downloaded b101 last night so I am going to get back testing it and using it for my flows.

I think I am just going to continue down the road of just “drawing” another offline copy of the “Selected” images and return them to my Copy method. Then I just need to figure out the dynamic width/height. Love graphing theory :wink: I all of a sudden appreciate your routing code that much more now. :slight_smile:

Mac? Win? Linux?
We have plugin classes which may help.

I opened a feature request to enable to native ability for Xojo to add functionality to the Clipboard Class to handle multiple pictures in an array index. Request is Cross Platform for Mac, Linux, and Windows.

<> : Add a Picture Array/Index to the Clipboard Class To Allow Multiple Pictures to System Clipboard

For the Mac, I have this tool that you can use to analye what’s in the clipboard (which has 3 APIs on OSX, so it shows 3 windows for each API). You’ll also find that only the CarbonPasteboard API lets you see multiple items in a clipboard. I guess it never really caught on.

The Macoslib has the CarbonPasteboard API letting you add multiple items, but it might well be that other apps do not read any more than the first item. You have to try it out.

Of course, first you have to find an example program that can copy multiple images (Apple’s own preferrably, e.g. Preview and TextEdit) and paste them back. If that works, then use my tool to see how the clipboard contents look in detail.

The app is here: (made with RB)

Dave: it is possible to put many things in the Clipboard in/at the same time (images, text, etc.) when running on OS X. On Windows, I do not know. If someone knows (yes, you YOU!), please advice.

How do you get information about what you have in the Clipboard:

a. Run AppleScript Editor
b. Copy / Paste:

return clipboard info

c. Copy an image from Preview (load an image in Preview, then…)

d. Run the AppleScript and you may get:

{{TIFF picture, 2188610}, {«class 8BPS», 1431838}, {«class BMP », 2181494}, {«class TPIC», 823236}, {«class PNGf», 284800}, {«class jp2 », 116172}, {GIF picture, 116104}, {JPEG picture, 355613}}

How may times the same image in the Clipboard at that moment ?

In one of my projects, I store a default name (TEXT) for the resized image (Picture) IN THE SAME CLIPBOARD.


BTW: I just learn something reading that page !

Ask if this is not really clear.

I forgot: do you know how Copy / Paste works (internally) ?

If your application allows PNG Pastes, the API will send the PNGf data to your application.

If the application you want to Paste data in does not understand the RawData code, no Paste will be done.

That is basically how the things works “internally” (OS, not Xojo).