|
Re: Can I put more than one images in a jface table view's cell? [message #456841 is a reply to message #456833] |
Fri, 10 June 2005 16:41 |
Emil Crumhorn Messages: 169 Registered: July 2009 |
Senior Member |
|
|
You can't add more than one image to a table cell, but you can combine
images (remember however, that the image that is first set determines the
size for the rest, so overlaying stuff later which would make an image wider
is not an option. In that case, use transparent image for overlay).
I've attached code to create an OverlayIcon (combined image of other
images). It was posted somewhere a long time ago in this newsgroup, I think.
Basically, you use it by:
ImageDescriptor firstImage = your first image...
ImageDescriptor secondImage = second image...
(and more images if you want)
OverlayIcon oc = new OverlayIcon(firstImage, new ImageDescriptor [] {
secondImage }, new int [] { OverlayIcon.TOP_RIGHT }, new Point(32, 16));
Image putInCell = oc.createImage();
As you can probably tell, that'll combine the first image with the second,
putting the second in the top right, and the image is now 32x16 pixels.
Hope that's what you're after.
Emil
"jason, nie" <nielinjie@sohu.com> wrote in message
news:cc660c21bb592923882cdc5dcd18e623$1@www.eclipse.org...
> Hi all,
> I just want to put a few images into a jface table view's cell, (they are
> all 16*16).
> But ITableLabelProvider only allow one image for a cell, can you help me?
> And also, I tried to create a new image to put in (new image is
> 16*numOfImages*16), this image displayed in the cell, but it is stretched
> to 16*16. Can jface table view display a non-square image?
>
> thanks
>
|
|
|
Powered by
FUDForum. Page generated in 0.03546 seconds