Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to drag Image from SWT App to OS?
How to drag Image from SWT App to OS? [message #442502] Sun, 05 September 2004 09:56 Go to next message
Wolfgang Werner is currently offline Wolfgang WernerFriend
Messages: 10
Registered: July 2009
Junior Member
Hello,

I'm trying to perform a drag&drop operation from my SWT app to the
operating system. I need this
function on Windows and Mac OS X.

After patching DragSource.java the basic drag&drop mechanism works - I'm
able to transfer Text via
drag&drop to text processing applications.

But how to transfer image data? I already tried the ImageTransfer example,
but the dragged data is
not accepted by the image processing application. I think I have to create
the data in a compatible
format and flag that format accordingly - is that right?

Any hint is greatly appreciated!
Best regards, Wolfgang
Re: How to drag Image from SWT App to OS? [message #442533 is a reply to message #442502] Tue, 07 September 2004 17:49 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You need to write a Carbon specific subclass of Transfer that implements the
JPEG data transfer to and from Java. For example, you could use
kScrapFlavorTypePicture ('PICT') as the native format and ImageData as the
Java format. The kScrapFlavorTypePicture transfers a PictHandle:

http://developer.apple.com/documentation/Carbon/Reference/Qu ickDraw_Ref/qdref_main/data_type_39.html#//apple_ref/c/tdef/ Picture

You can run the ClipboardExample which is found in project
org.eclipse.swt.examples in org.eclipse.swt.examples.clipboard Run Adobe
Photoshop, copy an image and click on the "Get Available Types" button in
the ClipboardExample and you will see a list of data types that Adobe
Photoshop uses to exchange data.

Once you have written this, you may wish to contribute it to the open source
community : )

"Wolfgang Werner" <wwerner@picturesafe.de> wrote in message
news:chenrp$jq5$1@eclipse.org...
> Hello,
>
> I'm trying to perform a drag&drop operation from my SWT app to the
> operating system. I need this
> function on Windows and Mac OS X.
>
> After patching DragSource.java the basic drag&drop mechanism works - I'm
> able to transfer Text via
> drag&drop to text processing applications.
>
> But how to transfer image data? I already tried the ImageTransfer example,
> but the dragged data is
> not accepted by the image processing application. I think I have to create
> the data in a compatible
> format and flag that format accordingly - is that right?
>
> Any hint is greatly appreciated!
> Best regards, Wolfgang
>
Previous Topic:ImageData alpha/transparency
Next Topic:Re: Newbie question
Goto Forum:
  


Current Time: Fri Apr 26 15:11:18 GMT 2024

Powered by FUDForum. Page generated in 0.03485 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top