From $ROOTSYS/tutorials/image/img2pad.C

void img2pad()
{
   // Display image in canvas and pad.
   //Author: valeriy Onuchin

   TImage *img = TImage::Open("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,yellow");
   //img->Draw("T100,100,#556655");
   //img->Draw("T100,100");

   TImage *i1 = TImage::Open("rose512.jpg");
   i1->SetConstRatio(kFALSE);
   i1->Flip(90);
   TImage *i2 = TImage::Open("rose512.jpg");
   i2->SetConstRatio(kFALSE);
   i2->Flip(180);
   TImage *i3 = TImage::Open("rose512.jpg");
   i3->SetConstRatio(kFALSE);
   i3->Flip(270);
   TImage *i4 = TImage::Open("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();
}
 img2pad.C:1
 img2pad.C:2
 img2pad.C:3
 img2pad.C:4
 img2pad.C:5
 img2pad.C:6
 img2pad.C:7
 img2pad.C:8
 img2pad.C:9
 img2pad.C:10
 img2pad.C:11
 img2pad.C:12
 img2pad.C:13
 img2pad.C:14
 img2pad.C:15
 img2pad.C:16
 img2pad.C:17
 img2pad.C:18
 img2pad.C:19
 img2pad.C:20
 img2pad.C:21
 img2pad.C:22
 img2pad.C:23
 img2pad.C:24
 img2pad.C:25
 img2pad.C:26
 img2pad.C:27
 img2pad.C:28
 img2pad.C:29
 img2pad.C:30
 img2pad.C:31
 img2pad.C:32
 img2pad.C:33
 img2pad.C:34
 img2pad.C:35
 img2pad.C:36
 img2pad.C:37
 img2pad.C:38
 img2pad.C:39
 img2pad.C:40
 img2pad.C:41
 img2pad.C:42
 img2pad.C:43
 img2pad.C:44
 img2pad.C:45
 img2pad.C:46
 img2pad.C:47
 img2pad.C:48
 img2pad.C:49
 img2pad.C:50
 img2pad.C:51
 img2pad.C:52
 img2pad.C:53
 img2pad.C:54
 img2pad.C:55
 img2pad.C:56
 img2pad.C:57
 img2pad.C:58
 img2pad.C:59
 img2pad.C:60
 img2pad.C:61