• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Reading pixels from image

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, simple question.

I have a bmp image, which i'd like to load and then read the color values for each pixel and write it to an array.

does anybody know whether this is feasible?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Clemens who wrote:



Please check your private messages for an important administrative matter.
 
Rancher
Posts: 3288
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use ImageIO to read the image into a BufferedImage. You can then use the getRGB(...) method of buffered image.
 
Clemens Brunnow
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh i forgot to mention that this should happen clientwise.
ImageIO is not supported by GWT.

Any idea how I could realise it clientwise? Or do I have to do it by sending a request to the server?
 
Clemens Brunnow
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh i didnt realise that this has been moved.
This was actually a GWT question =)
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you did not mention it was GWT related, I moved it.

Like you rightly mentioned, GWT does not lend support to such operations.
You are left with essentially two options
1) Send the image to be processed onto the server
2) Use something like an applet embedded inside your GWT page. Of course you would need to sign the applet and the user still would need to give the applet permission to read from the disk.

I personally would go with #1
 
Clemens Brunnow
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay thank you for the reply

next time i will express myself more clearly
reply
    Bookmark Topic Watch Topic
  • New Topic