display images with tableviewer [message #1060077] |
Thu, 23 May 2013 01:09 |
chang jiaqiang Messages: 3 Registered: May 2013 |
Junior Member |
|
|
hi,
I need to display images on each column in the table with tableviewer,so I implements the interface ITableLabelProvider in which there is a method "public Image getColumnImage(Object arg0, int arg1){}" and this method can display images on each column,right? So I code like this
public Image getColumnImage(Object arg0, int arg1)
{
Image image = null;
if(arg1==1){
image = new Image(null,10,20);//width=10
}
if(arg1==2){
image = new Image(null,20,20);//width=20
}
if(arg1==3){
image = new Image(null,30,20);//width=30
}
....
return image;
}
well, the problem is the image on the column 1 is good,but the images on the column 2 and 3 is not good, their size is the same as the column 1 image's size(width=10).
if I initialize the column 1 image with width 20(image = new Image(null,20,20)),all the images on the table is the same width.why? why can't the images have different size? if I wanna display images with different size,how can I do that?
|
|
|
Powered by
FUDForum. Page generated in 0.03364 seconds