Changing canvas size

From: OKUMURA, Akira <oxon_at_ceres.phys.s.u-tokyo.ac.jp>
Date: Wed, 1 Apr 2009 22:06:55 +0900


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:07:02 CEST

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