Uli
Uli

Reputation: 2693

Adobe Air - Copy image to clipboard

I'm tying to modify this Air copy and paste tutorial from Adobe. How to copy an image to clipboard via keyboard Ctrl+C without selecting it first? (The example needs a click in the image before that works)

This is the related code: http://pastebin.com/geTPPwFd

Thanks Uli

Upvotes: 2

Views: 1495

Answers (1)

ericsoco
ericsoco

Reputation: 26253

var bmpData:BitmapData = new BitmapData(displayObject.width, displayObject.height);
bmpData.draw(displayObject);
Clipboard.generalClipboard.setData(ClipboardFormats.BITMAP_FORMAT, bmpData);

More here and here.

Upvotes: 3

Related Questions