Print multiple TPads as .png

Hello everybody,

I am using ROOT under Windows XP and i am trying to print a TPad as a .png file. If I am printing a single TPad everything works fine. If I have several TPads on a large TPad then the printed .png shows only a white page. Printing into a .ps file works. I include a short script below.

Thanks for any suggestions,

Frank

{
double x[]={1,2,3,4,5};

double y1[]={1,30,2,4000,100};
TGraph *gr1 = new TGraph(5,x,y1);


double y2[]={1,1.1,0.9,0.8,0.7};
TGraph *gr2 = new TGraph(5,x,y2);

TCanvas *c2 = new TCanvas("c2","c2",0,0,800,640); 

TPad *bigPad2 = new TPad("bigPad2","This is bigPad2",0.0,0.0,1.0,1.0);
bigPad2->SetFillColor(0);
bigPad2->Draw();
bigPad2->cd();

TPad *pad[2];

pad[0] = new TPad("pad3","This is pad3",0.05,0.52,0.47,0.97);
pad[0]->Draw();
pad[1] = new TPad("pad4","This is pad4",0.05,0.02,0.47,0.47);
pad[1]->Draw();

pad[0]->cd();
gr1->Draw("alp");
pad[1]->cd();
gr2->Draw("alp");	

bigPad2->cd();
bigPad2->Print("test.ps");
bigPad2->Print("test.png");

}

Hi Frank,

Well, I will check tomorrow.
For the time being, you can replace :

by :

It works.

Cheers,
Bertrand.

Hi Bertrand,

I solved the problem for the moment by printing the TPad as .ps and convert it to a .png with ghostscript afterwards. But this requires that ghostscript is installed on the system and I would like to avoid this.

Do you have any idea what’s the problem with printing to .png?

Best regards,

Frank