• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

image transperancy

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to draw an image on a panel, and it's circular, so i want the white area around the image (the circle) to be transparent.. how can i do that?
 
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
You need to provide more information about what you are doing and exactly what you are trying to accomplish... Are you using AWT or Swing? Are you trying to make the image background transparent in relation to other components inside your application, or are you trying to make the entire application transparent all the way to the desktop?
 
Sammer Meer
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using swing (JFrame) and im drawing some images on a JPanel, and i want their white background to be transperent so i can make some intersections between them in a way they don't cover of eah other..
 
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
If you're drawing on the JPanel by overriding it's paintComponent() method, this shouldn't be an issue... you can set whether or not components paint their backgrounds by calling setOpaque( false ) on their reference, however, JPanels do not paint their background by default, so there's something else going on here... did you override paint() instead? What about your image? What format is it? Anything special about it?
 
Police line, do not cross. Well, this tiny ad can go through:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic