• Post Reply Bookmark Topic Watch Topic
  • New Topic

What bufferedimage type should I use for transparent png?

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't find documentation anywhere on this. When creating a bufferedimage with a PNG that has transparency, what type should I use? TYPE_INT_ARGB? Something else? How would/should I use a colormodel?
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what color models are, but ARGB seems to deal with transparnet PNG's.
 
Yogesh Dhond
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use
new BufferedImage(WIDTH,HEIGHT,BufferedImage.TYPE_INT_ARGB);

and in particular if you want to use alpha channel(A) for the image
then you have to shift operator to shiftthe bits to get high order 8 bits which stands for the same.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!