Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [Image] How to get the path of an Image ?
[Image] How to get the path of an Image ? [message #448390] Fri, 07 January 2005 12:13 Go to next message
Eclipse UserFriend
Hi !

I know how to navigate the disk to choose the image to put on a button,
but I don't know how to programmatically return the path of the file an
image was loaded from.

Say I have an org.eclipse.swt.graphics.Image obtained from
Button.getImage(). This image comes from somewhere on the disk and I
would like to allow the user to choose another one from a FileDialog
witch opens in the directory of the current image.

TIA

--
Arnaud
Re: [Image] How to get the path of an Image ? [message #448394 is a reply to message #448390] Fri, 07 January 2005 13:30 Go to previous messageGo to next message
Eclipse UserFriend
The piece of code that sets the image on the button can possibly can call
button.setData(String key, Object data) and pass the name of the directory.
Then your piece of code can use the button.getData(String key) to get the
location of the directory.

Avneesh
"Arnaud" <no@mail.please> wrote in message
news:crmfvl$k9u$1@www.eclipse.org...
> Hi !
>
> I know how to navigate the disk to choose the image to put on a button,
> but I don't know how to programmatically return the path of the file an
> image was loaded from.
>
> Say I have an org.eclipse.swt.graphics.Image obtained from
> Button.getImage(). This image comes from somewhere on the disk and I
> would like to allow the user to choose another one from a FileDialog
> witch opens in the directory of the current image.
>
> TIA
>
> --
> Arnaud
Re: [Image] How to get the path of an Image ? [message #448398 is a reply to message #448394] Fri, 07 January 2005 15:26 Go to previous message
Eclipse UserFriend
Right, I use this feature everyday, but I thought there was something
already coded for that.

Thanks

--
Arnaud
Previous Topic:Is there any way to listen to Windows Application key?
Next Topic:DropTarget cleanup (COM-level) does not seem to be complete (org.eclipse.swt.SWTError: Cannot initia
Goto Forum:
  


Current Time: Sun Jul 13 16:07:36 EDT 2025

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

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

Back to the top