Permalink
Browse files

make test application run everywhere

  • Loading branch information...
1 parent 7d44117 commit 5c628cdb174909e7d45a4614a2f12da7d870563f @TheHippo committed Apr 5, 2010
Showing with 7 additions and 34 deletions.
  1. +3 −0 .gitignore
  2. +4 −34 Test1.hx
View
3 .gitignore
@@ -1,2 +1,5 @@
*.o
*.ndll
+*.n
+test.jpg
+
View
38 Test1.hx
@@ -1,39 +1,9 @@
-package;
-
import hxGD.Image;
-import hxGD.Loader;
-import hxGD.Color;
-import hxGD.Polygon;
-import hxGD.Graphics;
-import hxGD.Animation;
-
class Test1 {
-
- public function new(i:Int) {
-
- var anim:Animation = new Animation("out"+i+".gif",100,true,true,true);
-
- for (i in 0...20) {
- //var img:Image = Loader.createFromPng("test.png");
- var img:Image = new Image(100,100);
- img.graphics.color = Color.ofRGB(0xFF0000);
- img.string("/home/hippo/imagetest/google/svn/trunk/fonts/Agency.ttf",42.0,Math.round(img.width/2),Math.round(img.height/2),"i"+i,StringAlign.CenterMiddle);
- // img.saveImage("image"+i+".gif",FileType.Gif);
- //neko.vm.Gc.run(true);
- anim.addImage(img);
-
- }
- anim.render();
-
- //img.saveImage("test2.png",FileType.Png);
- }
-
public static function main() {
- for (i in 0...100) {
- new Test1(i);
- if (i % 10 == 0)
- neko.vm.Gc.run(true);
- }
+ hxGD.Image.defaultBackgroundColor = new hxGD.Color(255,255,255);
+ var i = new hxGD.Image(100, 100, new hxGD.Color(0,0,0), true);
+ i.graphics.line(0,0,100,100);
+ i.saveImage("test.jpg",FileType.Jpeg(90));
}
-
}

0 comments on commit 5c628cd

Please sign in to comment.