Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to prevent stretching of images in swt table
How to prevent stretching of images in swt table [message #459246] Thu, 04 August 2005 11:49 Go to next message
nielinjie is currently offline nielinjieFriend
Messages: 13
Registered: July 2009
Junior Member
Hi all
I have some images with different sizes, which i want to display in a
swt table. But I find all images are stretched to the size of the first
image. Can i prevent this stretching?
Thank you very much
Jason
Re: How to prevent stretching of images in swt table [message #459395 is a reply to message #459246] Mon, 08 August 2005 18:06 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Jason,

This is the intended behaviour. The easiest thing for you to do here is
ensure that all of your images have the same size (ie.- add filler
rows/columns to your smaller images as needed to reach some standard size
like 16x16).

Grant

"Jason, Nie" <nielinjie@sohu.com> wrote in message
news:79bd37403f2d8dbd52840a9941fd69d5$1@www.eclipse.org...
> Hi all
> I have some images with different sizes, which i want to display in a
> swt table. But I find all images are stretched to the size of the first
> image. Can i prevent this stretching?
> Thank you very much
> Jason
>
Re: How to prevent stretching of images in swt table [message #459410 is a reply to message #459395] Tue, 09 August 2005 06:47 Go to previous messageGo to next message
nielinjie is currently offline nielinjieFriend
Messages: 13
Registered: July 2009
Junior Member
Actually, I have a table column to display flag(s) for each item. Each
flag image is 16*16. But some items have more than one flag on it. So
sometimes, I need to display a (n*16)*16 image in this column.
If there is no way to prevent stretching, can I display more than one
images in a cell?
Re: How to prevent stretching of images in swt table [message #459461 is a reply to message #459410] Tue, 09 August 2005 13:54 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
A column can only show one image, so the possibilities that this leaves are:

1. Have multiple columns for displaying the different flags (one flag type
in each). This may be fine if it's common to show the flag icons in your
context, but if this is not the case then this may be more of a space
waster.
2. Overlay the multiple flag images into one image. An example of this is
in the Package Explorer view, where error/warning images are shown on top of
resource icons.

Grant

"Jason, Nie" <nielinjie@sohu.com> wrote in message
news:a6e2cfcfc81fccc11a7a7aaa065538fb$1@www.eclipse.org...
> Actually, I have a table column to display flag(s) for each item. Each
> flag image is 16*16. But some items have more than one flag on it. So
> sometimes, I need to display a (n*16)*16 image in this column.
> If there is no way to prevent stretching, can I display more than one
> images in a cell?
>
Previous Topic:org.eclipse.swt.SWTException: Invalid thread access
Next Topic:Table - Drag and Drop
Goto Forum:
  


Current Time: Fri Apr 26 00:08:12 GMT 2024

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

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

Back to the top