RE: [ROOT] PNG output?

From: Valeri Fine (fine@bnl.gov)
Date: Fri Apr 09 2004 - 21:07:18 MEST


Hello dear Valeriy Onuchin,
I slightly updated the ROOT macro in question to make sure everything
fine.

(see: http://root.bnl.gov/images/TImageSaveTest/pad2pgn.html )

I added a few lines:

   TCanvas *c = new TCanvas;
   TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
   h->FillRandom("gaus", 10000);
   h->Draw();

   c->Update();
//   gSystem->ProcessEvents();

   TImage *img = TImage::Create();

   img->FromPad(c);

   img->WriteImage("canvas.png");
   img->WriteImage("canvas.pbm");
   img->WriteImage("canvas.xpm");
   img->WriteImage("canvas.pgm");
   img->WriteImage("canvas.ppm");
   img->WriteImage("canvas.xbm");
   img->WriteImage("canvas.jpeg");
   img->WriteImage("canvas.bmp");


and got 8 different files.  ("gif" is EXCLUDED from the official 
distribution due license constrains)
(see: http://root.bnl.gov/images/TImageSaveTest/pad2pgn.html )

I'd like to remind the list of the available formats is defined by the
local Qt installation rather by QtRoot alone. This means the number of
the image formats available for you may be different.

I did check TCanvas->"Save As" dialog does produce all formats available
via ROOT (line ROOT macro, ps, eps, etc ) as well as via Qt.
On case of the troubles I would advice to apply the "first ROOT thing
first", namely update your local version.

Thank you,

----
Best regards
                   Valeri


> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch] On
> Behalf Of Valeri Fine
> Sent: Friday, April 09, 2004 11:20 AM
> To: 'Valeriy Onuchin'; 'Andy Buckley'; roottalk@cern.ch
> Subject: RE: [ROOT] PNG output?
> 
> > He VAlii,
> > do you really tried ever) "what you promoted"
> > or you  just repeat(beleave to) an advertisment (sorry,
missspelling)
> >
> 
>   One needs about 5 min (depends of your WAN bandwidth) to see it
> him/herself
>     1. Install QtRoot
> http://root.bnl.gov/QtRoot/downloads/root.3.10.02.exe
>        from http://root.bnl.gov (It is one click internet
installation)
>     2. Click ROOT icon on your desktop. It takes about 0.3 sec
>     3. Type ROOT command                it takes about 5 sec
>         root [0] .x pad2png.C           It takes about 0.75 sec on
850Mg
> Pentium
>     4. Check whether canvas.png file is in place.  It takes about 5
sec.
>         You can do this from the ROOT session with the command
>         root [1] .!dir canvas.png
> 
> 
> So total to make sure it works properly on needs 5 min to download and
> 6-7 sec to test.
> 
> Hope this answers your question.
>                My best regards,
>                                            Valeri Fine
> 
> > Regards. Valeriy
> >
> > ----- Original Message -----
> > From: "Valeri Fine" <fine@bnl.gov>
> > To: "'Valeriy Onuchin'" <Valeri.Onoutchine@cern.ch>; "'Andy
Buckley'"
> > <buckley@hep.phy.cam.ac.uk>; <roottalk@cern.ch>
> > Sent: Friday, April 09, 2004 12:54 AM
> > Subject: RE: [ROOT] PNG output?
> >
> >
> > > He VAliey
> > >
> > >
> > >   Can you make a tine correction for
> > >   $ROOTSYS/tutotrials/pad2png.C
> > >
> > >  Please add an operator
> > >     c->Update()
> > >  just before
> > >      gSystem->ProcessEvents();
> > >
> > > So entire macro to be as follows:
> > >
> > > (hires07) [151] more  pad2png.C
> > > void pad2png()
> > > {
> > >    // Create a canvas and save as png.
> > >
> > >    TCanvas *c = new TCanvas;
> > >    TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
> > >    h->FillRandom("gaus", 10000);
> > >    h->Draw();
> > >
> > >    c->Update();
> > >    gSystem->ProcessEvents();
> > >
> > >    TImage *img = TImage::Create();
> > >
> > >    //img->FromPad(c, 10, 10, 300, 200);
> > >    img->FromPad(c);
> > >
> > >    img->WriteImage("canvas.png");
> > >
> > >    delete h;
> > >    delete c;
> > >    delete img;
> > > }
> > >
> > > To help the multithreaded version of ROOT with Qt layer under
> Windows.
> > > It causes no harm.
> > > Thank you in advance,
> > >
> > > ----
> > > Best regards
> > >                    Valeri
> > >
> > >
> > > > -----Original Message-----
> > > > From: owner-roottalk@pcroot.cern.ch
> > > [mailto:owner-roottalk@pcroot.cern.ch] On
> > > > Behalf Of Valeriy Onuchin
> > > > Sent: Thursday, April 08, 2004 3:58 PM
> > > > To: Andy Buckley; roottalk@cern.ch
> > > > Subject: Re: [ROOT] PNG output?
> > > >
> > > >  Hi Andy,
> > > > ROOT supports "PNG bitmap".
> > > > Please, check $ROOTSYS/tutotrials/pad2png.C
> > > >
> > > > Regards. Valeriy
> > > >
> > > > win32gdk PNG is "almost ready" :-)
> > > >
> > > > >
> > > > > Hi again,
> > > > >
> > > > > Is there any possibility that PNG bitmap output can be
supplied
> in
> > > ROOT
> > > > > in addition to GIF format? This would be very nice, since GIF
> has a
> > > > > certain stigma due to the LZW compression patent (even thought
I
> > > believe
> > > > > it's now expired) and since PNG is simply a nicer, more modern
> > > format.
> > > > > Apologies if it's already supported --- I couldn't find any
> mention
> > > of
> > > > > it in the 4.00/03 release notes.
> > > > >
> > > > > Also, is there a way (e.g. a .rootrc directive) to specify the
> > > preferred
> > > > > output format from the canvas menu rather than have to drag
the
> > > > > drop-down list to the right position each time? This would
also
> be
> > > nice,
> > > > > but is rather less important!
> > > > >
> > > > > Andy
> > > > >
> > > > > --
> > > > > Andy Buckley, HEP Group, Cavendish Lab, Cambridge
> > > > > http://www.insectnation.org
> > > > >
> > > > >
> > >
> > >





This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET