RE: Changing canvas size

From: Fine, Valeri <fine_at_bnl.gov>
Date: Wed, 1 Apr 2009 09:53:24 -0400


To show where the problem comes from I've run Akira's example with Qt-plugin on and got both images 600 x 600. ( I tested this on windows. I'll check on Linux later)  

 Hope this helps, Valeri


From: owner-roottalk_at_root.cern.ch on behalf of Fine, Valeri Sent: Wed 4/1/2009 9:41 AM
To: Olivier Couet; OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.) Subject: RE: [ROOT] Changing canvas size

Hello Olivier,

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

One size is the size of the widget including the frame decoration, another is the size of the TPad image.

Thank you, Valeri


From: owner-roottalk_at_root.cern.ch on behalf of Olivier Couet Sent: Wed 4/1/2009 9:24 AM
To: OKUMURA, Akira; roottalk (Mailing list discussing all aspects of the ROOT system.) Subject: RE: [ROOT] Changing canvas size

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:54:13 CEST

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