ROOT
6.08/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
2
3
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
2
3
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
v
x
+
Enumerations
a
d
e
f
g
h
m
p
t
v
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
u
v
w
+
All Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
v
w
x
y
z
+
Macros
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tutorials
image
img2pad.C File Reference
Tutorials
»
Image tutorials
Detailed Description
Display image in canvas and pad.
void
img2pad()
{
TImage
*img =
TImage::Open
(
"$ROOTSYS/tutorials/image/rose512.jpg"
);
if
(!img) {
printf(
"Could not create an image... exit\n"
);
return
;
}
img->
SetConstRatio
(
kFALSE
);
img->
Draw
(
"N"
);
TCanvas
*c = (
TCanvas
*)
gROOT
->GetListOfCanvases()->FindObject(
"rose512jpg"
);
c->
SetFixedAspectRatio
();
TCanvas
*c1 =
new
TCanvas
(
"roses"
,
"roses"
, 800, 800);
img->
Draw
(
"T100,100,#ffff00"
);
/*img->Draw("T100,100,#556655");*/
/*img->Draw("T100,100");*/
TImage
*i1 =
TImage::Open
(
"$ROOTSYS/tutorials/image/rose512.jpg"
);
i1->
SetConstRatio
(
kFALSE
);
i1->
Flip
(90);
TImage
*i2 =
TImage::Open
(
"$ROOTSYS/tutorials/image/rose512.jpg"
);
i2->
SetConstRatio
(
kFALSE
);
i2->
Flip
(180);
TImage
*i3 =
TImage::Open
(
"$ROOTSYS/tutorials/image/rose512.jpg"
);
i3->
SetConstRatio
(
kFALSE
);
i3->
Flip
(270);
TImage
*i4 =
TImage::Open
(
"$ROOTSYS/tutorials/image/rose512.jpg"
);
i4->
SetConstRatio
(
kFALSE
);
i4->
Mirror
(
kTRUE
);
float
d = 0.40;
TPad
*p1 =
new
TPad
(
"i1"
,
"i1"
, 0.05, 0.55, 0.05+d*i1->
GetWidth
()/i1->
GetHeight
(), 0.95);
TPad
*p2 =
new
TPad
(
"i2"
,
"i2"
, 0.55, 0.55, 0.95, 0.55+d*i2->
GetHeight
()/i2->
GetWidth
());
TPad
*p3 =
new
TPad
(
"i3"
,
"i3"
, 0.55, 0.05, 0.55+d*i3->
GetWidth
()/i3->
GetHeight
(), 0.45);
TPad
*p4 =
new
TPad
(
"i4"
,
"i4"
, 0.05, 0.05, 0.45, 0.05+d*i4->
GetHeight
()/i4->
GetWidth
());
p1->
Draw
();
p1->
cd
();
i1->
Draw
();
c1->
cd
();
p2->
Draw
();
p2->
cd
();
i2->
Draw
();
c1->
cd
();
p3->
Draw
();
p3->cd();
i3->
Draw
();
c1->
cd
();
p4->
Draw
();
p4->
cd
();
i4->
Draw
();
c1->
cd
();
}
Author
Valeriy Onuchin
Definition in file
img2pad.C
.