|
Re: Problem creating image from a file in a bundle [message #327751 is a reply to message #327745] |
Wed, 30 April 2008 12:11 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Jan,
Have you inspected the URL that comes back? What does it look like?
Does openStream on the URL return a stream without throwing an
exception? The "data" folder is at the root of your plugin? Usually
people use an "icons" folder. You've specified it in your
build.properties so it's included in the final jarred plugin when you
export?
Jan Weidauer wrote:
> Hi there,
>
> in my plugin I try to create an image using a file in a separate
> directory of my plugin. I use the code below to do this. But when doing
> so, the image has a width and height of -1. Does anyone have a hint to
> resolve this problem?
>
> Image img =
> ImageDescriptor.createFromURL(FileLocator.find(Activator.get Default().getBundle(),
> new Path("data/EclipseBannerPic.jpg"),
> null)).createImage(parent.getDisplay());
>
> Thanks in advance
>
> Jan
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04021 seconds