SourceForge.net Logo Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact

View a Program

To run this program in JUDO, select the Program Code with your mouse, click the Edit menu of your browser and Copy. Then click in the code area of JUDO, click the Edit menu of JUDO and then Paste. Then Run the program.

Author Name:Edac Leinad
Program Name:drawImage() (simple)
Program Description:Hello Everyone,

I used Java API's to put together this one. This one may require a little more knowledge, and it is not recommended for use by the beginning user of JUDO.

With that said and done, this function calls jud0_graphics.drawImage().

variables:
url: the Uniform Resource Locator of your picture
img: the image at the URL url
x: the x coordinate for the image to be drawn at
y: the y coordinate for the image to be drawn at

Call:
the only thing unexplained about the call is the mysterious 'this' variable. It passes JUDO's window context (I think) to the drawImage.
This is an alternative to creating an ImageObserver, an implementation
I will add later.

Note 1:
you will notice that the actual call to drawImage() is in a while() loop. This is necessary because JUDO loads the image in realtime, and the continuous loop allows for redrawing when JUDO has more of the images data. I plan on submitting a second version of this, with an ImageObserver class. That class allows you to get loading info,
width, height, and other goodies of the image as it is loading.
But thats another program.

Note 2:
I have only tested this very briefly on GIF pictures :D

Note 3:
Here are some websites that have helped me get this API
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter06/images.html
http://download.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html#drawImage
(credit: tdunn)

Note 4:
Can't get it running? Need help? Contact me at nospam.flyndgs@gmail.com (remove 'nospam.')

Note 5:
Credit would be nice, but you don't really have to because I didn't invent this, just found it again.

Note 6:
There is no note 6.

Note 7:
If you use this in your program, give
me a shout out at the address mentioned
above (note 4, I believe). I want to hear
about the cool things you do with images!

Thanks,

Edac
 
Program Type:Graphics
Program Code:

Last Modified Sun Dec 22 07:25:00 UTC 2013
Thomas Dunn

Home | Download | Submit | Screenshots | FAQ | SF Project Page | JUDO Help | Contact