I can write the image but its default resolution is 600x450. I want to specify my own resolution.
public void save(String path, String name) throws IOException
{
int x ;
int y;
x=scaled.getHeight();
y=scaled.getWidth();
System.out.println(x);
System.out.println(y);
if (scaled != null)
{
name += scaled.getWidth() + "x" + scaled.getHeight();
ImageIO.write(scaled, "png", new File(path + File.separator + name + ".png"));
}
else
{
throw new NullPointerException("Scaled instance is null");
}
}
Any suggestions?