Re: Images, colour palettes, and ROOT versions

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Wed, 17 Aug 2005 12:25:27 +0200 (MEST)


In Version 4 the palette was always enabled. In ROOT version 5, TASImage has an extended interface   (see http://root.cern.ch/root/htmldoc//TASImage.html)

You can enable/disable the palette via
  void SetPaletteEnabled(Bool_t on = kTRUE)

Example:

void galaxy_image()
{

    TCanvas *canv = new TCanvas("image", "n4254", 40, 40, 812, 700);

    canv->ToggleEventStatus();
    canv->SetRightMargin(0.2);
    canv->SetLeftMargin(0.01);
    canv->SetTopMargin(0.01);
    canv->SetBottomMargin(0.01);

    // read the pixel data from file "galaxy.root"     // the size of the image is 401 X 401 pixels     TFile *gal = new TFile("galaxy.root", "READ");     TImage *img = (TImage*)gal->Get("n4254");     img->SetPaletteEnabled(kFALSE);
    img->Draw();

    // open the color editor
    //img->StartPaletteEditor();

    // zoom the image
    img->Zoom(80, 80, 250, 250);
}

Rene brun

On Wed,
17 Aug 2005,
Giorgio
De Nunzio wrote:

> Hi all!
> I have a question about images, colour palettes, and ROOT versions...
> Executing the tutorial code galaxy_image.C (or otherwise opening a canvas
> and displaying
> an image) gives quite different results in v 3.10/02 and in v 4.02/00: in
> the former
> only the image is shown, while the latter case also shows a nice colour
> palette
> on the right side of the canvas.
> I do not want that palette to appear: how can I reproduce, in the more
> recent
> version, the result obtained in the older one?
> There seem to be also some less important differences, but perhaps they will
> disappear once this major issue fixed.
> Searching in the history files gave me no results, but perhaps it is written
> there and I did not see it just because of my ROOT inexperience. In this
> case please will you excuse me.
>
> Thank you very much!
> Giorgio
>
> ---------------------------------
> Dr. Giorgio De Nunzio
> Material Science Dept.
> University of Lecce
> Lecce
> Italy
> giorgio.denunzio_at_unile.it
> tel +39 0832 297545
> fax +39 0832 297549
>
>
>
Received on Wed Aug 17 2005 - 12:25:31 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:11 MET