Format of SetClipboardImage()?

Mac OSX specific forum
jamirokwai
Addict
Addict
Posts: 802
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Format of SetClipboardImage()?

Post by jamirokwai »

Hi there,

I tried to copy a new image to the clipboard. Then, I'd like to paste it into Preview.app using "New from clipboard", but the image won't appear.
Hope somebody knows what I am talking about. Which format does the setclipboardimage()-function copy? Why doesn't that work in Preview.app?

I used this:

Code: Select all

If CreateImage(0, 26, 20)
    StartDrawing(ImageOutput(0))
      Box(0, 0, 26, 20, RGB(255, 255, 255))
      Circle(13, 10, 5, RGB(255, 0, 0))
    StopDrawing()
    SetClipboardImage(0)
  EndIf
Thanks in advance :-)

Edit: The format of the clipboard-image is TIFF, says Finder. Can I change this? Would be great to have .png as format for Clipboard-images :-)
Regards,
JamiroKwai
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Format of SetClipboardImage()?

Post by IdeasVacuum »

I think you would need to save the created image as png in order for it to be png when sent to the clipboard. On Windows, the PB functionality can be replaced with API calls - perhaps that is a possibility on Mac OS too?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
jamirokwai
Addict
Addict
Posts: 802
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Format of SetClipboardImage()?

Post by jamirokwai »

IdeasVacuum wrote:I think you would need to save the created image as png in order for it to be png when sent to the clipboard. On Windows, the PB functionality can be replaced with API calls - perhaps that is a possibility on Mac OS too?
Hi IdeasVacuum,

thanks for your answer. I doubt, that would work.
In my the App I am developing, the image is a JPG. It gets converted to TIFF while copying to clipboard.
Regards,
JamiroKwai
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Format of SetClipboardImage()?

Post by IdeasVacuum »

...it isn't jpg format in the (PB Help) code you posted? That said, Tiff is a good format but you don't want to convert jpg if it can be avoided. So, starting with Tiff is comparatively a good thing, unless the receiving app cannot accept Tiff of course. I'm surprised the default is Tiff, on Windows the default is bmp.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Format of SetClipboardImage()?

Post by Shardik »

jamirokwai wrote:I tried to copy a new image to the clipboard. Then, I'd like to paste it into Preview.app using "New from clipboard", but the image won't appear.
Perhaps it's a Lion issue. On my Snow Leopard 10.6.8 it's just
working fine. Perhaps some other MacOS X users should test
this too...
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Format of SetClipboardImage()?

Post by Polo »

Doesn't work here on Lion.
jamirokwai
Addict
Addict
Posts: 802
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Format of SetClipboardImage()?

Post by jamirokwai »

Ah, Lion could be the problem. Damn!
Maybe, you are right, Shardik.
Regards,
JamiroKwai
Post Reply