Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / August 2004

Tip: Looking for answers? Try searching our database.

How to save a picture drawn in applet as a "BMP" file

Thread view: 
uv - 29 Jul 2004 08:41 GMT
If I have written a progarm in java(using awt components) which can
draw a picture, how to write code for saving that picture to a file?
Oliver Klein - 29 Jul 2004 08:52 GMT
> If I have written a progarm in java(using awt components) which can
> draw a picture, how to write code for saving that picture to a file?

Try something like:
    OutputStream out = new FileOutputStream("ImageName.bmp");
    ImageIO.write( image, "bmp", out );
I think u need > 1.4 for that, just have a look at the API.
Roedy Green - 29 Jul 2004 11:20 GMT
>If I have written a progarm in java(using awt components) which can
>draw a picture, how to write code for saving that picture to a file?
see http://mindprod.com/jgloss/jpegencoder.html
http://mindprod.com/jgloss/imageio.html

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Andrew Thompson - 03 Aug 2004 05:09 GMT
> If I have written a progarm

application or applet?

>..in java(using awt components)

why AWT?

>..which can
> draw a picture, how to write code for saving that picture to a file?

If it is 1.1 for an Applet for the MSVM, that
applet will need to be jarred and signed, but
I am not sure if the MSVM is compatible with
Sun style code signing.

If it is not 1.1 compatible for the MSVM,
use the 1.4 classes Oliver pointed out, and
consider using Swing for the UI.

Oh, and "BMP"?!?  Any of the available formats
in the standard package (JPEG, PNG & GIF) are
superior to .BMP format, which is not net
friendly, and most specific to Windows.

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.