Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Including Images in SWT Application


Images are in the org.eclipse.swt.graphics package, not the widgets package. The class(es) you are looking for are Image, and maybe ImageData, and maybe ImageLoader.

Most widgets can display images; typically you set an image into a control or item using setImage and passing in an Image that you have either read from a file, or created and drawn on.

I am not sure just how your application will be using images, but here's an SWT snippet that shows one use: reading an image from a file and then drawing it on a Canvas, and scrolling it smoothly.
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/snippits/snippet48.html

There are a bunch of other image-related snippets on the SWT developer's page that use images somehow, for example, displaying an animated GIF, or creating a Label widget and setting an image into it using setImage. Here is the main link for all of the SWT snippeets. Do a text search for 'image' and you will see the image examples.
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets

Have fun!
Carolyn



Cijo Jacob <cijomannaraprayil@xxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

08/12/2004 12:13 AM

Please respond to
platform-swt-dev

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Including Images in SWT Application





Hi
 
I just need to include an image in my SWT application screens. I tried
using org.eclipse.swt.widgets.ImageList. But its saying this imported type
is not visible. What can be the issue here?

 
Thanks and Regards
Cijo


Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!


Back to the top