https://github.com/root-project/root
Raw File
Tip revision: a48bb7fe1e147de1fad7e8775a664518df516f81 authored by Unknown Author on 29 May 2006, 10:03:03 UTC
This commit was manufactured by cvs2svn to create tag 'v5-10-00e'.
Tip revision: a48bb7f
psview.C
// An example how to display PS, EPS, PDF files in canvas
//Author: Valeriy Onoutchin
   
#include "TROOT.h"
#include "TCanvas.h"
#include "TImage.h"

void psview()
{
   // set to batch  mode -> do not display graphics
   gROOT->SetBatch(1);

   // create PostScript file psexam.ps
   gROOT->Macro("psexam.C");

   // back to graphics mode
   gROOT->SetBatch(0);

   // create an image from PS file
   TImage *ps = TImage::Open("psexam.ps");

   if (!ps) {
      printf("GhostScript (gs) program must be installed\n");
      return;
   }

   new TCanvas("psexam", "Example how to display PS file in canvas", 500, 650);
   ps->Draw("xxx"); 
}
back to top