Re: [ROOT] 2.25.03: setting TPad transparency and fill color simultaneously

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Dec 05 2000 - 11:54:33 MET


Hi Matt,

   the current implementation of transparency does not support mixing of
other colors, like you try to do. Also it works only with TPad's and not with
TBox or anything else. What you want should not be too difficult to
implement tough.

Cheers, Fons.


On Mon, Dec 04, 2000 at 10:03:43PM -0800, Matthew D. Langston wrote:
> Hi all,
> 
> I think I am trying to go about setting the transparency and fill color of a
> TPad in the wrong way.
> 
> The problem I am trying to solve is to highlight a small section of a
> scatterplot.  The area of the scatterplot I want to highlight represents a
> cut.  My first attempt to do this was to put a TPad on top of the
> scatterplot and set the TPad's transparency to 4050 (i.e. semi-transparent)
> and its fill color to 2 (i.e. red).
> 
> I did this as follows:
> 
> myPad->SetFillStyle( 4050 );
> myPad->SetFillColor( 2 );
> myPad->Modified();
> myPad->Update();
> 
> The last two commands (i.e. the calls to Modified and Update) don't do
> anything from the command line.  I have to use the SetFillAttributes context
> menu of myPad to set the fill color to red by clicking the Apply button.  Is
> this right?  Isn't there a way to do this from the command line?
> 
> It appears that only one of these settings (i.e. transparency and fill
> color) can take affect at the same time, i.e. I can either have a
> semi-transparent TPad that has no color (so that I can see the scatterplot
> points below it), a solid red TPad (that hides the scatterplot points
> beneath it), but not both.
> 
> So, is it possible to set the transparency and the fill color of a TPad
> simultaneously?  If so, is there a way to do it from the command line?
> 
> Also, is this the right way to highlight a section of a scatterplot?  Would
> it be better to use something like a TBox or a TWbox instead?
> 
> Thank you for any help.
> 
> Regards, Matt
> 
> --
> Matthew D. Langston
> SLD, Stanford Linear Accelerator Center
> langston@SLAC.Stanford.EDU

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET