Hello,
Why does this code draw a black rectangle ?
@Override
public void paint(GraphicsContext g) {
super.paint(g);
int w = g.getClipWidth() / 2;
int h = g.getClipHeight() / 2;
Image i = Image.createImage(w, h);
i.getGraphicsContext().setColor(Colors.BLUE);
i.getGraphicsContext().fillRect(0, 0, w, h);
g.drawImage(i, w, h, GraphicsContext.HCENTER_VCENTER);
}
Thank you.