RE: Changing canvas size

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Wed, 1 Apr 2009 15:24:09 +0200


I agree, that is weird. I get also two different sizes:

$ ls -l *.png

-rwxr-xr-x 1 Olivier None 2261 Apr 1 15:22 c1.png -rwxr-xr-x 1 Olivier None 2382 Apr 1 15:22 c2.png

They should be the same.....

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of OKUMURA, Akira Sent: Wednesday, April 01, 2009 3:07 PM
To: roottalk (Mailing list discussing all aspects of the ROOT system.) Subject: [ROOT] Changing canvas size

Hello ROOTers,

How can I change the size of a canvas before printing it? The sizes of c1.png and c2.png are different in the following example.

$ cat can.C

{

   Double_t w = 600;
   Double_t h = 600;
   TCanvas * c1 = new TCanvas("c", "c", w, h);

   c->SetWindowSize(w + (w - c->GetWw()), h + (h - c->GetWh()));
   c->SaveAs("c1.png");
   c->SaveAs("c2.png");

}

$ root

root [0] .x c.C
Info in <TCanvas::Print>: file c1.png has been created Info in <TCanvas::Print>: file c2.png has been created root [1] .q
$ file c1.png c2.png

c1.png: PNG image data, 596 x 572, 8-bit/color RGB, non-interlaced c2.png: PNG image data, 600 x 600, 8-bit/color RGB, non-interlaced

Regards,

OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira Received on Wed Apr 01 2009 - 15:24:35 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 02 2009 - 17:50:02 CEST