public boolean doSave(boolean saveAs)
		{
		File f = file;
		if (saveAs || file == null)
			{
			f = getFile(true);
			if (f == null) return false;
			// just use PNG..
			String name = f.getName().toLowerCase();
			if (!name.endsWith(".png"))
				{
				if (name.contains(".")) name = name.substring(0,name.lastIndexOf('.'));
				f = new File(f.getParentFile(),name + ".png");
				}
			}
		try
			{
			ImageIO.write(canvas.getRenderImage(),"PNG",f);
			file = f;
			return true;
			}
		catch (IOException e)
			{
			e.printStackTrace();
			}

		return false;
		}