aspose file tools*
The moose likes Java in General and the fly likes How to create an Image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to create an Image" Watch "How to create an Image" New topic
Author

How to create an Image

Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Can anybody explain how to create an Image using java.Thanks in advance.


Thanks,
Mathews
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Which do you mean:
  • Draw a picture from lines and shapes onscreen?
  • Paint an existing JPEG/GIF/PNG file onscreen?
  • Create a JPEG/GIF/PNG file?
  • Print a picture?


  • [Jess in Action][AskingGoodQuestions]
    Mathews P Srampikal
    Ranch Hand

    Joined: Nov 26, 2002
    Posts: 211
    Earnest...Thanks for the quick response.....
    I have to read from the .xml file and Create a JPEG/GIF?...
    Thanks in Advance.
    Mathews P Srampikal
    Ranch Hand

    Joined: Nov 26, 2002
    Posts: 211
    Can anybody help it out
    Steve Lovelace
    Ranch Hand

    Joined: Sep 03, 2003
    Posts: 125
    I don't know how you're retrieving the image from XML, but assuming you do that, something like the following works:

    If result == false, there was a problem, which is almost certainly a no-match on the format name. The format names are whatever identifiers match the codecs that happen to be loaded in the jvm. You can get the list by executing ImageIO.getWriterFormatNames() (ImageIO is chock full of useful stuff). The usual list is {"jpg", "jpeg", "png"} in upper and lower case. Note that "gif" is missing. The reason is that in order to legally write gif files you must first sort out royalty issues with Unisys.
    [ September 06, 2003: Message edited by: Steve Lovelace ]

    The Inner that is named is not the true Inner.
    Mathews P Srampikal
    Ranch Hand

    Joined: Nov 26, 2002
    Posts: 211
    Hi,
    I have to read from the .xml file means that Read all the tags in the xml and accordingly create a gif or jpg image dynamically.It has to happen when ever the xml file changes.means when the xml file updated image also should be updated.
    Thanks.
    Steve Lovelace
    Ranch Hand

    Joined: Sep 03, 2003
    Posts: 125
    Still don't have enough info to understand what you're trying to do. What's in those tags? URLs? If you just need to display images from URLs then use MediaTracker or ImageIcon. If you have to watch for changes in a file, look at File and related classes in io package. You might have to start a thread which keeps its eye on file dates.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: How to create an Image
     
    Similar Threads
    How create 'zoom' in JPanel ?
    Create Image object
    creating buttons with graphics
    image map's in java
    re:How to use hyperlink in applet