posted 17 years ago
Hello,
i have to create a BufferedImage - Object.
i must create different Objects like graphic objects,
but although Objects like Buttons Comoboboxes and so on...
in the code paintComponent exist
...bi = (BufferedImage) createImage(3060, 6188);
The Image could have the size 3060 and 6188.
--> if the size is 3060, 6188 i get an OutOfMemoryError.
I don't want maximize the heap size with -Xmx200m
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
Dimension dim = getSize();
int w = dim.width, h = dim.height;
// UPDATE SO: !! update code - bi=BufferedImage
if (bi == null) {
bi = (BufferedImage) createImage(w, h);
big = bi.createGraphics();
area = new Rectangle(dim);
end if;
...
}
any idea?
Hope somebody could help me
Thank you!