Logo ROOT  
Reference Guide
imgconv.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_image
3/// \notebook -nodraw
4/// Open rose512.jpg and save it in the following formats:
5/// .png, .gif, .xpm and tiff.
6///
7/// \macro_code
8///
9/// \author Valeriy Onuchin
10
11void imgconv()
12{
13 TImage *img = TImage::Open("$ROOTSYS/tutorials/image/rose512.jpg");
14 if (!img) {
15 printf("Could not create an image... exit\n");
16 return;
17 }
18
19 img->WriteImage("rose512.png");
20 img->WriteImage("rose512.gif");
21 img->WriteImage("rose512.xpm");
22 img->WriteImage("rose512.tiff");
23}
An abstract interface to image processing library.
Definition: TImage.h:29
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:119
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
Definition: TImage.h:115
void imgconv(TCanvas *c, const TString &fname)
Definition: tmvaglob.cxx:212