Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I save an Image object to file???

Status
Not open for further replies.

Oxymoron

Technical User
Dec 17, 2000
168
0
0
GB
Hi all,

I have this line of code:

RepaintManager manager = RepaintManager.currentManager(component);
Image myImg= manager.getOffscreenBuffer(component, compWidth, compHeight);

which captures a screen dump (as-it-were) of a swing component.

I want to save this image ideally to a microsoft word template file.
Is there any way of doing this??
If not, how would i go about saving a .jpg, etc

Any and all comments welcome.
Thanks all

Oxy


we are all of us living in the gutter.
But some of us are looking at the stars.
 
Oxymoron,

To save to a word specific format you will need an additional library. There is a library just for this on teh Apache Jakarta site. It is called POI, I believe. You can use this product to same content into word format with the extension "DOT" with is a word document template.

Good luck,
Tadpaul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top