Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Can I implement a transparent eraser in Java GUI?

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everybody.

I'm working on a graphic editor prototype which requires the implementation of a background eraser.
I built a layered structure with a layeredPane. the first layer contains a background image which remains untouched, the second layer is transparent and is used for the user defined graphics. So, I'd like to make users able to erode color on the second layer with an eraser tool.
I can't just implement the eraser with a stroke in background color, as this would just cover the background image.
And neither setting the background color as transparent would be useful, as it just is paint over.
I'm trying to find if there are some modes which allow me to substitute colour instead of simply painting it over the old color value, but up now I didn't find anything. Can you suggest me some settings for the graphic object so I can achieve that effect?

Many thanks in advance!
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic