private void writeObject(ObjectOutputStream out) throws IOException
	{
		System.out.println("starting writing mask...");
		PathIterator it=area.getPathIterator(null);
		double[] coords=new double[6];
		while(!it.isDone())
		{
			int type=it.currentSegment(coords);
			
			out.writeInt(type);
			
			if(type==PathIterator.SEG_MOVETO||type==PathIterator.SEG_LINETO)
			{
				
				out.writeDouble(coords[0]);
				out.writeDouble(coords[1]);
			}
			else if(type==PathIterator.SEG_QUADTO)
			{
				out.writeDouble(coords[0]);
				out.writeDouble(coords[1]);
				out.writeDouble(coords[2]);
				out.writeDouble(coords[3]);
			}
			else if(type==PathIterator.SEG_CUBICTO)
			{
				out.writeDouble(coords[0]);
				out.writeDouble(coords[1]);
				out.writeDouble(coords[2]);
				out.writeDouble(coords[3]);
				out.writeDouble(coords[4]);
				out.writeDouble(coords[5]);
			}
			
			it.next();
		}
		out.writeInt(Integer.MIN_VALUE);
		System.out.println("ending writing mask...");
	}