transparency
Posted: Mon Sep 19, 2011 8:43 pm
Thanks for your quick response to my previous question on shadows.
#1)
I'm playing around with the transparency functions on lines and have found some confusing results.
If I draw a line on a canvas the default line is not solid, fair enough.
if I set the transparency of that line to 50 it vanishes, if I set it to 100, 25 or 1 or 0 it's quite quite visible and very dark, at 25 it's darker than default and at 75 it's faded and lighter than default and 25,100,90 etc
values of default,0,100,95 are all the same which is somewhat faded.
value of 25 = darker then default and 100,95,0,1
value of 50 = invisible.. lines are gone.
value of 75 = lightest of all but still visible..
I assumed this seemingly sort of sinusoidal function was due to the interaction of transparency and the dotted line style.. I assumed that transparency of 50 hiding the dots the dotted line didn't hide so they combined to produce an invisible line.
Then I set the pen style to solid line and it behaves exactly the same...now I'm at a loss.
I may have missed a setting somewhere but this seems a bit odd to me..
** my chart is using a default background , white to light grey vertical gradient from top to bottom
my basic chart setup is this:
$chart1 = new TChart(800,600);
$chart1->getChart()->getHeader()->getFont()->setSize(14);
$chart1->getChart()->getHeader()->setText("SCATTER PLOTTER");
$chart1->getAspect()->setView3D(false);
$chart1->getAxes()->setVisible(true); //false turns off the frame.....
$g=$chart1->getGraphics3D();
$g->getBrush()->setVisible(true); //this turned on the color in the free canvas forms
//drawing the lines
//gcoords is my function and translates my graph coordinates to chart coordinates and accounts for reversed axis and such
//$g->getPen()->setStyle(Dashstyle::$SOLID); these are added after the initial dotted line tests..
//$g->getPen()->setColor(Color::BLACK());
$g->getPen()->setTransparency(50); // 25 is darker than 75, 50 is invisible, default is lighter than 25 and 0,1,95,100 are the same as default...ow!
$g->line(gcordsX(0),gcordsY(50),gcordsX(100),gcordsY(50),Color::BLACK(),1); //horizontal (creates 4 quadrants)
$g->line(gcordsX(50),gcordsY(0),gcordsX(50),gcordsY(100),Color::BLACK(),1); //vertical
#1)
I'm playing around with the transparency functions on lines and have found some confusing results.
If I draw a line on a canvas the default line is not solid, fair enough.
if I set the transparency of that line to 50 it vanishes, if I set it to 100, 25 or 1 or 0 it's quite quite visible and very dark, at 25 it's darker than default and at 75 it's faded and lighter than default and 25,100,90 etc
values of default,0,100,95 are all the same which is somewhat faded.
value of 25 = darker then default and 100,95,0,1
value of 50 = invisible.. lines are gone.
value of 75 = lightest of all but still visible..
I assumed this seemingly sort of sinusoidal function was due to the interaction of transparency and the dotted line style.. I assumed that transparency of 50 hiding the dots the dotted line didn't hide so they combined to produce an invisible line.
Then I set the pen style to solid line and it behaves exactly the same...now I'm at a loss.
I may have missed a setting somewhere but this seems a bit odd to me..
** my chart is using a default background , white to light grey vertical gradient from top to bottom
my basic chart setup is this:
$chart1 = new TChart(800,600);
$chart1->getChart()->getHeader()->getFont()->setSize(14);
$chart1->getChart()->getHeader()->setText("SCATTER PLOTTER");
$chart1->getAspect()->setView3D(false);
$chart1->getAxes()->setVisible(true); //false turns off the frame.....
$g=$chart1->getGraphics3D();
$g->getBrush()->setVisible(true); //this turned on the color in the free canvas forms
//drawing the lines
//gcoords is my function and translates my graph coordinates to chart coordinates and accounts for reversed axis and such
//$g->getPen()->setStyle(Dashstyle::$SOLID); these are added after the initial dotted line tests..
//$g->getPen()->setColor(Color::BLACK());
$g->getPen()->setTransparency(50); // 25 is darker than 75, 50 is invisible, default is lighter than 25 and 0,1,95,100 are the same as default...ow!
$g->line(gcordsX(0),gcordsY(50),gcordsX(100),gcordsY(50),Color::BLACK(),1); //horizontal (creates 4 quadrants)
$g->line(gcordsX(50),gcordsY(0),gcordsX(50),gcordsY(100),Color::BLACK(),1); //vertical