editting picture(jpg,bmp) in applet
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Tuesday, December 25, 2001 11:15 PM

Hi, I intend to create an applet that displays an original picture from the server's file system, the user can do some basic drawing on the picture such as a box, a text, and then save it back to the server's file system.

I do have java programming experience, but initially I don't know how to get start. If somebody out there have such experience, please show me the direction. thanks in advance

Re: editting picture(jpg,bmp) in applet

Posted By:   Christopher_Schultz  
Posted On:   Wednesday, December 26, 2001 06:20 AM

You'll want to start by learning how to do the following things:

  1. Load an image (i suggest JPEG... BMP is more complicated in Java). Start by looking in the Java API at the Toolkit class in the java.awt package.

  2. Display an image. Depending on your requirements, you may want to choose "Swing", Java's new widget API, or the 'old skool' AWT. AWT have the advantage of being a bit faster and available on more platforms (like Netscape and IE installations without using a Java plug-in). Swing has the advantage of being much more pleasing to the eye, having more widgets, and the API is actually much smarter and easier to understand/work with.

  3. Write an image back the server. Since you are using an applet, you'll probably want to use an HTTP POST to upload a file to the server. This will require you to learn how to construct a "multipart/form-data" POST request, and put the image data into it. You'll also want to send some kind of authorization code, so that not just anybody can upload files and clobber the ones on the server.

  4. Write image editing code. You can probably get away with just pixel editing to start. Look at the MouseListener interface in the java.awt.event package for starters. The java.awt.image package will contain classes that will help you actually edit the image. I'd suggest looking at BufferedImage especially.

Good luck,

About | Sitemap | Contact