• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Repaint transparent BufferedImage

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my applet I make use of different bufferedimages and use them as a screen part. Each screenpart will only be repainted when the content needs to change. This is the abstract class of a 'screenpart'



But the buffer doesn't work because the buffer is also transparent. It will work when I change the bufferedimage type of the buffer from ARGB to RGB but this displays also a black background. So my question is: how can I correctly repaint this bufferedimage with a buffer?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jochem Gruter wrote:Each screenpart will only be repainted when the content needs to change.


I don't see any code that attempts to change the image in any way. I also don't see the point of painting a new BufferedImage (buffer) of the same size to the BufferedImage that this class represents at the time of construction.

Perhaps a typical implementation of the abstract paint(...) method, along with a sample of how the method is called, and where the passed-in parameter is obtained, would help clarify the question. In other words, an SSCCE <- link
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic