[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: making images
From: |
Albert van der Heide |
Subject: |
Re: making images |
Date: |
Fri, 31 Jan 2003 16:25:07 +0100 (CET) |
> You did not say you were using java before.
Yes, I realised I was incomplete in my question.
> Here's a java working example using swarm-pre2.2, I think. Not 2.1.1.
>
> http://lark.cc.ku.edu/~pauljohn/SwarmFaq/WorkingExampleCode/java/TestPixmap.java
I still cannot get this to work. I get the idea that this code is used to
dump a png file ON a raster, and not the other way around.
There is a function " pixmap.save(filename); ", but I have not been able
to translate my colormodel and Zoomraster into the pixmap.
Maybe the intention of this code was to load the actual created-by-swarm-
during-simulation png file into a pixmap, and display it again. If this is
so, could you than explain to me where these temporarily created images
are stored?
Here folows a litte piece of the code in the given sample which I thought
most relevant.
Help would be very welkome (, since I'm getting quite frustrated).
And thanx for the help aready given, ofcourse.
Albert.
Colormap colormap = new ColormapImpl (getZone ());
Raster r = new RasterImpl (getZone ());
r.setWindowTitle ("My raster");
r.setWidth$Height (200, 200);
r.erase ();
r.setColormap (colormap);
r.pack ();
PixmapC pixmapC = new PixmapCImpl (new PixmapImpl ());
pixmapC.createBegin (getZone ());
String appDir = Globals.env.arguments.getAppDataPath ();
pixmapC.setDirectory (appDir);
pixmapC.setFile ("ant.png");
Pixmap pixmap = (Pixmap) pixmapC.createEnd ();
pixmap.setRaster (r);
pixmap.drawX$Y (50, 50);
---------------------------------
student : A.J v.d Heide
doing : Artificial Intelligence
e-mail : address@hidden
---------------------------------
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.