Skip to content

Commit fe6f2ae

Browse files
committed
Use GetTutorialDir in img2pad.C macro
It is more reliable way as using $ROOTSYS shell variable
1 parent 06e4054 commit fe6f2ae

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tutorials/visualisation/image/img2pad.C

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010

1111
void img2pad()
1212
{
13-
TImage *img = TImage::Open("$ROOTSYS/tutorials/visualisation/image/rose512.jpg");
13+
TString fname = gROOT->GetTutorialDir();
14+
fname.Append("/visualisation/image/rose512.jpg");
15+
TImage *img = TImage::Open(fname);
16+
1417
if (!img) {
1518
printf("Could not create an image... exit\n");
1619
return;
1720
}
21+
1822
img->SetConstRatio(kFALSE);
1923
img->Draw("N");
2024

@@ -26,16 +30,16 @@ void img2pad()
2630
/*img->Draw("T100,100,#556655");*/
2731
/*img->Draw("T100,100");*/
2832

29-
TImage *i1 = TImage::Open("$ROOTSYS/tutorials/visualisation/image/rose512.jpg");
33+
TImage *i1 = TImage::Open(fname);
3034
i1->SetConstRatio(kFALSE);
3135
i1->Flip(90);
32-
TImage *i2 = TImage::Open("$ROOTSYS/tutorials/visualisation/image/rose512.jpg");
36+
TImage *i2 = TImage::Open(fname);
3337
i2->SetConstRatio(kFALSE);
3438
i2->Flip(180);
35-
TImage *i3 = TImage::Open("$ROOTSYS/tutorials/visualisation/image/rose512.jpg");
39+
TImage *i3 = TImage::Open(fname);
3640
i3->SetConstRatio(kFALSE);
3741
i3->Flip(270);
38-
TImage *i4 = TImage::Open("$ROOTSYS/tutorials/visualisation/image/rose512.jpg");
42+
TImage *i4 = TImage::Open(fname);
3943
i4->SetConstRatio(kFALSE);
4044
i4->Mirror(kTRUE);
4145

0 commit comments

Comments
 (0)