I have a TableItem and i wish to add an image in it. I use this code :
Image image = new Image(Display.getCurrent(), 400, height);
image.setBackground(COLOR_RED);
item.setImage(5, image);
The problem is the background color is never setting in th开发者_运维问答e image. My goal is to get a transparent image background.
How can I do that?
Please read the JavaDoc of Image.setBackground. That method does not fill your image with red color.
Also, by setting an image to a TableItem you cannot draw anything, like text, transparently below that image. If you want to do something like that, you'll need "owner draw", see here for a tutorial on that.
精彩评论