Unfortunately there is no built in support for drawing images in JUDO. I agree this would be something nice to add in a future version.
There is an object available in your JUDO programs called "jud0_graphics" - note that is a zero in jud0. This is the object that is used for most of the graphics functions in JUDO. In theory you should be able to use the Graphics.drawImage() method to do what you are asking about. Doing this is someone leaving the world of JUDO and getting more into straight Java code. I tried it briefly and didn't get it to work, but maybe you or someone else can figure it out.
Thank you for your help Tom.
I'm making a point of learning Java, and Judo is for my quick programs.
Judo doesn't make intense math easy to code though…
But that's another post :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2011-02-08
void main() {
Imageimg=Toolkit.getDefaultToolkit().getImage("C:\\Documents and Settings\\User\\Desktop\\a.gif");intx=0;inty=0;while(true){jud0_graphics.drawImage(img,x,y,this);}}
its cool that JUDO can do this!
notes{
I have only tested it on a GIF picture;
you do not need a while (true) {}, however you will need to declare an ImageObserver for it and use that… more trouble;
this does not have any error handling
}
Anyways. I only tested this once, I am a bit busy. I will submit a sample program on judo.sourceforge.net soon.
Thanks,
Edac
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The name says it all, how do I make JUDO display an image file?
Code spinets would be nice…
Any ideas?
Its been bugging me for the last week…
Hello Voyager29,
Unfortunately there is no built in support for drawing images in JUDO. I agree this would be something nice to add in a future version.
There is an object available in your JUDO programs called "jud0_graphics" - note that is a zero in jud0. This is the object that is used for most of the graphics functions in JUDO. In theory you should be able to use the Graphics.drawImage() method to do what you are asking about. Doing this is someone leaving the world of JUDO and getting more into straight Java code. I tried it briefly and didn't get it to work, but maybe you or someone else can figure it out.
Here are a couple pointers.
http://download.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html#drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter06/images.html
Have fun,
Tom
Thank you for your help Tom.
I'm making a point of learning Java, and Judo is for my quick programs.
Judo doesn't make intense math easy to code though…
But that's another post :)
void main() {
its cool that JUDO can do this!
notes{
I have only tested it on a GIF picture;
you do not need a while (true) {}, however you will need to declare an ImageObserver for it and use that… more trouble;
this does not have any error handling
}
Anyways. I only tested this once, I am a bit busy. I will submit a sample program on judo.sourceforge.net soon.
Thanks,
Edac