[cairo-commit] cairo-java/test/kapow Kapow.java,1.17,1.18

Jeffrey Morgan commit at pdx.freedesktop.org
Tue Aug 16 17:34:35 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/kapow
In directory gabe:/tmp/cvs-serv19721/test/kapow

Modified Files:
	Kapow.java 
Log Message:
Applied a patch from Owen and updated the examples.

Index: Kapow.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/kapow/Kapow.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Kapow.java	9 May 2005 15:38:23 -0000	1.17
+++ Kapow.java	17 Aug 2005 00:34:31 -0000	1.18
@@ -12,6 +12,8 @@
 import org.freedesktop.cairo.Context;
 import org.freedesktop.cairo.FontSlant;
 import org.freedesktop.cairo.FontWeight;
+import org.freedesktop.cairo.Format;
+import org.freedesktop.cairo.ImageSurface;
 import org.freedesktop.cairo.LinearGradient;
 import org.freedesktop.cairo.Point;
 import org.freedesktop.cairo.RadialGradient;
@@ -37,7 +39,7 @@
 	private int RAND_MAX = Integer.MAX_VALUE;
 
 	public Kapow(String text) throws Exception {
-		Surface surface = new Surface();
+		Surface surface = new ImageSurface(Format.ARGB32, IMAGE_WIDTH, IMAGE_HEIGHT);
 		cr = new Context(surface);
 
 		cr.setLineWidth(2);
@@ -82,7 +84,7 @@
 		cr.setSourceRGB(0, 0, 0);
 		cr.stroke();
 		
-		//surface.write(filename);
+		surface.writeToPNG(filename);
 	}
 	
 	private void makeStarPath() {



More information about the cairo-commit mailing list