• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Images on Applet?

 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I was trying to develop an applet on following guidance:-
1. In the aaplet I need to show about 10 images with radio button.
2. there will be a area at the top where when user selects any image it will show there.
3. I further need to have where I've to show about 5 colors (red,green etc). again with radio buttons.
4. On selecting any of these color the color of the selected image should change.
I am not able to do the point 4. can somebosy suggest any input on it to resolve the deadlock?
regards,
arun
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Perhaps I am asking for very basic question but would be highly obliged if someone can spare his/her valuable time and show me a path.
regards,
arun
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by :


On selecting any of these color the color of the selected image should change

?

Do you mean the selected color should be filtered out of the image? Do you mean that the image should have more of the selected color added to it?
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean by it that when a person selects one of any given color the image should become of that color. e.g.
Let us say I have a image of cow with a single color filled into it as red. now if a user selects a green color the cow should become green.
Is it possible?
Hope I am able to clear this.
regards,
Arun
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a simple example of how to swap single colors in images. In my class "face.png" is just an image I drew of a face filled with the color red. In the code it assumes that the image starts out as red... the important part is the replaceColor() method of the inner ColorCanvas class. That grabs the pixels, swaps the colors, and rebuilds the image.

 
reply
    Bookmark Topic Watch Topic
  • New Topic