-
Graphics or jpeg or bufferedImage to String
hi i wnat to use this code http://www.webdeveloper.com/java/jav...ead_write.html to write on my server...
but the code need a string, i need to write a image file with my applet, come from the Graphics of my JPanel (king a paint program)
i already use this code to make in another program to make a jpeg file (not a applet)
Component comp = dessin;
String name = this.getCodeBase() + "/test.jpeg";// dia.getDirectory()+dia.getFile();
int w = comp.getWidth();
int h = comp.getHeight();
BufferedImage im = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = im.createGraphics();
comp.paint(g2);
g2.dispose();
FileOutputStream out = new FileOutputStream(name);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(im);
out.flush();
out.close();
can we use my bufferedimage to make a string from and past it to the code i want to uise!?
i really need help
thx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks