I have drawn one rectangle by using RectangleFigure in draw2d. And I am able to color the rectangle figure by calling rectangleFigure.setBackgroundColor. Now the same way I want to color the Image also. For that I used ImageFigure in draw2d and I gave the background color by calling ImageFigure.setBackgroundColor(). But it does not give any color for me. So How can I give the background color to the image figure in draw2d?

有帮助吗?

解决方案

RectangleFigure extends Shape which draws it's own background by default. ImageFigure directly extends Figure which will only draw the background if you set it as Opaque:

imageFigure.setOpaque(true);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top