Hi Steve,

Thanks a lot for the response!

At first my colors were fully opaque. And for some reason it just don't work..

I actually ended up doing something similar to what you describe. I first fill the component with a solid, opaque color (the background), then I do a fade from the opaque bright color to the same bright, but transparent color.

It's probably slower than the all opaque version, but at least I get the effect I want. :-)


Best regards,

--
Harald K


On 17. sep.. 2008, at 16.42, [EMAIL PROTECTED] wrote:

Do you use only fully opaque painting when drawing in your ComponentUIs ? As I'm not fully aware with performance in terms of opacity, I can't say it will always be a better idea to go for opacity tricks. However, here is my thought about a way to do such an effect (linear aqua gloss) :

Just create a gradient, going for the brightest color you want to see on your..glare to the same color, but with transparent opacity :
From RGB(255,255,255,255) to RGB(255,255,255,0) for example.

The coordinates of this gradient are (if vertical) :
(0,0) to (0, component height)

Then fill a gradient rectangle using these coordinates (still an example) :
(0,0) to (0, component height / 2 )

It usually works quite well on simple glass effects.
You could also fill any other shape, for example something a bit rounded to add shape to your pane or button.


Whether you want to do aqua painting or linear gradient painting, some parts or others of this technique should work better for you.

Let me know about it,
Cheers,
Steve
[Message sent by forum member 'artscoop' (artscoop)]

http://forums.java.net/jive/thread.jspa?messageID=299842

= = = = = ====================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to