Witam, mógłby mi ktoś podpowiedzieć jakim narzędziem się posłużyć, aby zmniejszyć rozmiar utworzonego obrazu w paintComponent(), ponieważ utworzony plik ma rozmiar 400x400, a ja chciałbym aby utworzyło mi bitmape 12x12.
Pseudokody mile widziane.
[code]
public void paintComponent(Graphics g)
{
BufferedImage grid = null;
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
if (grid == null)
{
int w = this.getWidth();
int h = this.getHeight();
grid = (BufferedImage)(this.createImage(w,h));
Graphics2D gc = grid.createGraphics();
//FUNKCJE RYSUJĄCE
g2.drawImage(grid, null, 0, 0);
try
{
BufferedImage bi = grid;
File outputfile = new File("foto.bmp");
ImageIO.write(bi, "bmp", outputfile);
}
catch (Exception e)
{
System.out.println("Blad: "+e);
}
}
[/code]