Re: [ROOT] gif in batch mode - size peoblem

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Fri May 31 2002 - 12:02:12 MEST


 Hi Wojtek,
look at the Carrot source. It provides several methods to create
pictures (gif,jpeg, animated gif) in the batch mode
http://carrot.cern.ch/CarrotExamples/classref/src/TApache.cxx.html#TApache:Put

To calculate "xsize/ysize" I'm using the following code
   // calculate BoundingBox   
   Float_t xsize = 20;
   Float_t ysize = 27;

   gStyle->GetPaperSize(xsize,ysize);
   ysize = xsize*pad->GetWh()/pad->GetWw();

   Int_t iw = (Int_t)(0.5 + 72*(xsize*pad->GetAbsWNDC())/2.54);
   Int_t ih = (Int_t)(0.5 + 72*(ysize*pad->GetAbsHNDC())/2.54);
 
HTH.	Regards.	Valeriy

Wojciech Tadeusz Fedorko wrote:
> 
> Hi,
> I am trying to save a bunch of canvas' as gif's in the batch mode
> There are previous messages which tell how to do that:
> I do:
> TCanvas* c1 = new TCanvas("c1","c1",900,1750);
> // I divide draw etc...
> than I do:
> gStyle->SetPaperSize(20,65);
> c1->Print("c1.eps");
> than:
> gSystem->Exec("pstopnm -ppm -xborder 0 -yborder 0 -portrait -xsize 900
> -ysize 1750 c1.eps");
> gSystem->Exec("ppmtogif c1.eps001.ppm > c1.gif");
> 
> the problem is that the size of the canvas (with or without SetPaperSize
> call) is not reflected in the eps file and so when I do pstopnm -xsize
> 900 -ysize 1750 plots are streched so that the letters axes etc become
> unreadable...
> 
> any idea how to fix that?
> 
> thank you,
> Wojtek



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:54 MET