Problem with setAlpha() method

A free public discussion forum for the JFreeChart class library.

Problem with setAlpha() method

Postby John Lemke » Tue Mar 14, 2006 11:31 pm

I am using intervalMarker and I can't seem to get the color to become more transparent using the setAlpha() method. I've tried various values like 0.1f to 0.9f and it does not change the color at all.

Marker layer1 = new IntervalMarker(a, b);
layer1.setPaint(new Color(255, 0, 0));
layer1.setAlpha(0.1f);

The code above produces a red band that looks just like the band I get when I use setAlpha(0.9f)

What am I doing wrong here.

Thanks
John Lemke
 
Posts: 6
Joined: Fri Mar 10, 2006 12:02 am

Postby John Lemke » Wed Mar 15, 2006 12:00 am

I figured out my problem. I created a color using Color(r,g,b) which is opaque by default. I tried using Color(r,g,b,a) which creates a color with an alpha value ranging from 0 to 255.
John Lemke
 
Posts: 6
Joined: Fri Mar 10, 2006 12:02 am

Postby david.gilbert » Wed Mar 15, 2006 4:07 pm

Hi John,

I filed a bug for that - it seems the alpha setting is ignored in most places:

http://sourceforge.net/tracker/index.ph ... tid=115494
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11337
Joined: Fri Mar 14, 2003 10:29 am

Postby david.gilbert » Wed Oct 25, 2006 11:03 am

This is fixed for the upcoming 1.0.3 release.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11337
Joined: Fri Mar 14, 2003 10:29 am


Return to JFreeChart - General

Who is online

Users browsing this forum: Google [Bot], trequick, Yahoo [Bot] and 16 guests