IntelliJ Java IDE
The moose likes Java Micro Edition and the fly likes Can this be done? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Can this be done?" Watch "Can this be done?" New topic
Author

Can this be done?

Greg Kearn
Greenhorn

Joined: Dec 06, 2001
Posts: 20
Open an existing jpg file and make annotation "on top" and save the positions of the annotations so when someone opened the file they would see the notes? For example a small jpg blueprint, someone marked up with notes but not disturb the original. When another user opens the file with notes they appear in the correct positions.
If the above is not possible, would it be possible to edit an existing jpg file and save it?
Thanks for the time,
Greg
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
This isn't really a J2ME specific question is it?
A jpg file is just a compressed file that contains a bunch of pixels with color values. There is no concept of layering.
You can write a java program to display the jpg in one layer, and then create your annotations as graphic objects in a higher-layer;
To save these annotations, you have two choices.
You can merge the output of the jpg and annotations by drawing all of them into the same Graphics, then save the merged image as a single jpg. When you do this, the annotations will be part of the image, and you cannot "remove" them.
Or, you can create your own custom file format that contains the original jpg, and seperate images for the annotations, and data about where they should be displayed in relation to the main jpg. This is a lot more work, but will allow you to show and hide the annotations and not affect the original image.
Good luck!
Rob


Rob
SCJP 1.4
Greg Kearn
Greenhorn

Joined: Dec 06, 2001
Posts: 20
Rob thanks for the overview. Does J2ME have the ability to accomplish this task? Or do you have to get to the PersonalJava edition to complete it?
 
 
subject: Can this be done?
 
Threads others viewed
I need a faster, better way of testing my apps in Eclipse
Files
serilizing BufferedImage
Show 1-10 jpg files in jsp using Struts
Getting correct filename with JFileChooser
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com