File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes How to send Image over IP Socket? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to send Image over IP Socket?" Watch "How to send Image over IP Socket?" New topic
Author

How to send Image over IP Socket?

Jon Campbell
Greenhorn

Joined: Nov 21, 2006
Posts: 5
I've got an Applet that you can paste an image into on the client browser, and I've got IP Sockets communication with the server working, but how do you send the Image over the Socket stream?

Thanks much,
Jon
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Welcome to JavaRanch.

A java.awt.Image object can't be sent over the wire, so you'll need to send the array of pixels instead, e.g. by serializing it. Getting the pixels would require the use of java.awt.image.PixelGrabber in the applet, and reconstructing the image on the server (if that's necessary) would involve java.awt.image.MemoryImageSource.


Ping & DNS - updated with new look and Ping home screen widget
corey uptain
Greenhorn

Joined: Dec 18, 2006
Posts: 1
but if you can allready copy n paste with applet do you even need java?


<a href="http://www.thebusinesssuccessgroup.com/Government-Funding.html" target="_blank" rel="nofollow">http://www.thebusinesssuccessgroup.com/Government-Funding.html</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to send Image over IP Socket?
 
Similar Threads
returning socket with RMI
Please HELP Socket Amateur!
How to connect YahooMessenger using socket connection?
MultiThreading and sockets
how to get client ip from socket