Forums Register Login

using graphics in servlets

+Pie Number of slices to send: Send
hi i am ceating a web application that must open a picture and then draw on it. i have done it in desktop applications, but now want to use in a servlet. can i use the graphics2d library from within a servlet and how would u translate the following code,


try
{
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(img, 0);
tracker.waitForID(0);
}


the img is a fle read from the hadrd drive. and the this referebce is the reference for a jframe class. how can i use the above code in a servlet. thanks.
+Pie Number of slices to send: Send
i think i did not make my self clear in the above post. i want toread a image file, into a buffered image. how could i do that.
+Pie Number of slices to send: Send
I just went through exactly this problem - my previous graphics work was in Applets and used MediaTracker but it turns out the situation has greatly improved since then. Now I am using the ImageIO class - which does not start a separate Thread.

where theImage is a BufferedImage reference.

And to draw on that image, you do a typical


To cope with various image formats, the JAI package found here seems to be where the future support is.
Bill
+Pie Number of slices to send: Send
Depending on the OS you're using, you may need to run your app server with the "headless" JVM option.
Evildoers! Eat my justice! And this tiny ad's justice too!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 897 times.
Similar Threads
linux server load an image from file
Images
gif images
image scaling error
Invisible Colours
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:32:50.