It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming Java Forum

how do i make semi-transparent colors?

how do i make semi-transparent colors?

Postby fipi on Thu May 03, 2007 7:57 pm

Hello everyone, I need help with drawing semi-transparent colors. I'm trying to fill a JPanel with a semi-transparent Color. I'm using double buffering, so i draw a semitransparent filled rectangle in a render() method to a buffer Image, which is then drawn in paintComponent(). To get the transparency, i use a Color created with a constructor that has a transparency argument as well as RGB:

Code: Select all
new Color(200,200,200, 128)


The buffer Image is from Component's createImage(int width, int height) method.
I don't know what I'm doing wrong (more like i don't know what i'm doing at all :P) ... so i would be really grateful for some help...
(\__/)
(='.'=)
(")_(")
This is bunny. Help bunny gain world domination by copying him into your signature.

"Efficiency is intelligent laziness." ~David Dunham
fipi
 
Posts: 3
Joined: Thu May 03, 2007 7:07 pm
Location: TX, USA

Return to Java Forum

Who is online

Users browsing this forum: No registered users and 0 guests