title: draw part of bitmap c++ builder
body: <p>It's must not be hard to draw only specified form of bitmap, however I can't understand why that code doesn't work(I saw it in some delphi examples):</p>
  
  <pre><code>Graphics::TBitmap* bmp;
  
  void __fastcall TForm1::FormCreate(TObject* Sender)
  {
      bmp = new Graphics::TBitmap();
      bmp-&gt;Width = 300;
      bmp-&gt;Height = 300;
      bmp-&gt;Canvas-&gt;Ellipse(0, 0, 300, 300);
  }
  
  void __fastcall TForm1::Button1Click(TObject* Sender)
  {
      HRGN rgn = CreateRectRgn(10, 10, 30, 30);
      if(SelectClipRgn(bmp-&gt;Handle, rgn) == ERROR) ShowMessage("Error");
      Canvas-&gt;Draw(0, 0, bmp);
  }
  </code></pre>
  
  <p>So bitmap is drawn in usual way. In MSDN ERROR flag is explained as "previous clipping region is unaffected". Should device be configured first or should previous region be deleted? Is it right way to accomplish this task. I would use SetWindowRgn on TImage containing this bitmap, but TImage is not a window, therefore doesn't have Handle. Please, help me to find out what is wrong.</p>