Question

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?

Était-ce utile?

La solution

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);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top