This could mean all sorts of things. One possible scenario: you're writing a
Java program, and at some point you have a file of HTML, and you need to make a sort of "screen shot" of that HTML page and store it in a database.
I would load the HTML into a JEditorPane, then use a third-party class to turn the image in the JEditorPane into a PNG file (there's one in particular out there I'm thinking of called "PNGEncoder",) then store the PNG file in the database.
Is this the scenario you're talking about? If so, which part of this do you want help with?