The problem is at below line
g.drawImage(image, 0, 0, getWidth(), getHeight(), null);
Second on what object are you calling getWidth()
and getHeight()
methods?
I think you want to get the width and height of Canvas
.
To solve this issue remove
static
fromrender()
method.