title: Scrolling TImage horizontally or vertically
body: <p>I am writing 2-3 Trees application in Lazarus for my school project.</p>
  
  <p>Everything's done, now playing with GUI (I get the same number of points for good GUI as I do for a good etc. Insert function, which is weird but nvm).</p>
  
  <p>When I have like 10+ nodes in the tree, my 300*200 image size just isn't large enough.</p>
  
  <p>I would like to have an TImage component which would be like 300*200 on the TForm, but it would be like 10000 * 10000 really and you could scroll in it.</p>
  
  <p>Is it even possible?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT TO MAKE THE QUESTION CLEARER</strong></p>
  
  <ol>
  <li><p>A 2-3 Tree is a data structure. When drawn on a paper to see how it works, it looks like this <a href="http://www.cosc.canterbury.ac.nz/research/RG/alg/tree23.gif" rel="nofollow">http://www.cosc.canterbury.ac.nz/research/RG/alg/tree23.gif</a></p></li>
  <li><p>As a real noobie in lazarus/delphi (have to do it in lazarus) a use this code to draw it (even if I doubt u need it to answer my question):</p>
  
  <pre><code>procedure TStrom.Paint(Image: TImage);
  </code></pre>
  
  <p>var
    C: TCanvas;</p>
  
  <p>procedure Paint1(V: TNode; Width, X, Y: integer);
    begin</p>
  
  <pre><code>if V.L &lt;&gt; nil then    //left child
  begin
    C.MoveTo(X, Y);
    C.LineTo(X - Width div 3, Y + 50);
    Paint1(V.L, Width div 3, X - Width div 3, Y + 50);
  end;
  
  if V.S &lt;&gt; nil then    //middle child 
  begin
    C.MoveTo(X, Y);
    C.LineTo(X + Width div 3, Y + 50);
    Paint1(V.S, Width div 3, X + Width div 3, Y + 50);
  end;
  
  if V.P &lt;&gt; nil then     //right child
  begin
    C.MoveTo(X, Y);
    C.LineTo(X + Width div 3 + Width div 3, Y + 50);
    Paint1(V.P, Width div 3, X + Width div 3 + Sirka div 3, Y + 50);
  end;
  
  if V.isLeaf then
  begin
    C.Ellipse(X - 15, Y - 15, X + 15, Y + 15);
    C.TextOut(X - 3, Y - 8, IntToStr(V.Info1));
  end
  else
  begin
    C.Rectangle(X - 15, Y - 15, X + 15, Y + 15);
    C.TextOut(X - 7, Y - 8, IntToStr(V.Info1));
    C.Rectangle(X + 15, Y - 15, X + 50, Y + 15);
    if V.Info2 &lt;&gt; 0 then
      C.TextOut(X + 27, Y - 8, IntToStr(V.Info2));
  end;
  </code></pre></li>
  <li><p>The draw function works well, but some (most) of the nodes at the height of 3+ are drawn on other nodes, so it looks bad. The node is sitting on another node and is not 20 pixels next to it.</p></li>
  <li><p>I thought I'd make the image where the tree is painted real big, but it would be in a small "panel". Like this: the TImage would really be 1000*1000, but in the form you could see only a little part of it. In this part there'd be horizontal and vertical scrollbars, so you could scroll through the image and see what's painted in the sections. (Like when you scroll through a web browser to see the bottom of the page :) ) </p></li>
  <li><p>We are not permitted to use any other code, just built in lazarus components. (nor are we permitted to create new components -> have no idea why)</p></li>
  <li><p>While I'm still curious about how this could be done, it's no longer necessary for my application ( installed a second monitor to see if it'd help and it wouldn't, so I guess I'd dig through my paint method a bit :-) )</p></li>
  </ol>