This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to reduce size of ImageIcon object

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m transporting desktop snapshot image via serializing ImageIcon object over the network using http, this method is quite fast in localhost environment but when i need to transport it over the network i get a delay of 3 sec..i.e if i open notepad.exe at server then client receives that image after 3 sec...
so my main problem here is ..how can i reduce the size of imageicon object ..currently its near to 4MB
I have tried using gzipinputstream & equivalent outputstream but gzipinputstream blocks my thread ...i was chainning like this
do any one knows any API which will allow me to compress my ImageIcon object
 
Winston Gutkowski
Bartender
Pie
Posts: 10105
56
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
naved momin wrote:do any one knows any API which will allow me to compress my ImageIcon object

Simple answer: no.

However, I'm pretty certain that desktop images are saved as bitmaps, so what might work is to convert them to a lo-res JPEG first and then create your ImageIcon from that. If ImageIcon keeps a copy of the original image, that might significantly reduce its footprint.

Beyond that, I have no expertise in this area.

Winston

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic