C
Click
Hello,
For my game, I create a JFrame and inside this frame I create a simple class
derived from JComponent. To paint my game, I use the paintcomponent method.
My game lies in a BufferedImage 640x480. At the start of the game, the
component size is 640x480. It works fine.
When I enlarge the window, the component is resized accordingly to the size
of the window, so in my paint method, I use an affinetransformop object to
resize the image when drawing it in the component with drawimage(myImage,
op, 0, 0).
Something very strange happens. Immediately after I resize the window, it
works fine : the image is draw, resized on the entiere surface of the
component.
But after that initial paint, the drawing process is clipped to the original
size of the component, 640x480. In that area, the image is perfectly drawn,
zoomed. But nothing is drawn out of that area.
Is there something I should do to insure that painting is allowed in the
entiere component? Have you heard of this problem before?
Francois
For my game, I create a JFrame and inside this frame I create a simple class
derived from JComponent. To paint my game, I use the paintcomponent method.
My game lies in a BufferedImage 640x480. At the start of the game, the
component size is 640x480. It works fine.
When I enlarge the window, the component is resized accordingly to the size
of the window, so in my paint method, I use an affinetransformop object to
resize the image when drawing it in the component with drawimage(myImage,
op, 0, 0).
Something very strange happens. Immediately after I resize the window, it
works fine : the image is draw, resized on the entiere surface of the
component.
But after that initial paint, the drawing process is clipped to the original
size of the component, 640x480. In that area, the image is perfectly drawn,
zoomed. But nothing is drawn out of that area.
Is there something I should do to insure that painting is allowed in the
entiere component? Have you heard of this problem before?
Francois