Domanda

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?

È stato utile?

Soluzione

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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top