Copy card to clipboard as image

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dbeugeling
Posts: 12
Joined: Thu Feb 12, 2015 12:22 pm

Copy card to clipboard as image

Post by dbeugeling » Sun May 28, 2023 9:32 pm

Hello,

I want to copy a card as an image of that card to the clipboard.

Does somebody know how this is done?

Thanks,

Dirk

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Copy card to clipboard as image

Post by richmond62 » Sun May 28, 2023 11:32 pm

Screenshot_2023-05-29_01-29-30.png
-

Code: Select all

on mouseUp
   import snapshot from card "KARD"
   set the name of the last image to "XXX"
   copy image "XXX"
   delete image "XXX"
end mouseUp
Attachments
copier.livecode.zip
Stack.
(29.98 KiB) Downloaded 66 times

dbeugeling
Posts: 12
Joined: Thu Feb 12, 2015 12:22 pm

Re: Copy card to clipboard as image

Post by dbeugeling » Mon May 29, 2023 11:39 am

Hello Richmond62!,

Thank you!
You helped me twice already.
Awesome!!

Dirk

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Copy card to clipboard as image

Post by jiml » Mon May 29, 2023 6:24 pm

Also:

Code: Select all

on mouseUp pMouseButton
   export snapshot from this card to sImage as JPEG
   set the clipboardData["image"] to sImage
end mouseUp

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”