Logo ROOT  
Reference Guide
pad2png.C File Reference

Detailed Description

View in nbviewer Open in SWAN Create a canvas and save as png.

void pad2png()
{
TCanvas *c = new TCanvas;
TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
h->FillRandom("gaus", 10000);
h->Draw();
img->FromPad(c);
img->WriteImage("canvas.png");
}
Author
Valeriy Onuchin

Definition in file pad2png.C.

c
#define c(i)
Definition: RSha256.hxx:119
TImage::Create
static TImage * Create()
Create an image.
Definition: TImage.cxx:35
TImage::FromPad
virtual void FromPad(TVirtualPad *, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:122
TImage
Definition: TImage.h:29
h
#define h(i)
Definition: RSha256.hxx:124
TImage::WriteImage
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
Definition: TImage.h:115
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TCanvas
Definition: TCanvas.h:23
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:572
TSystem::ProcessEvents
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:417