/*
ScanLine, Height example
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Graphics::TBitmap *pBitmap = new Graphics::TBitmap!AL(`tbitmap_object',1,`TopicNotFound',`main')();
// This example shows drawing directly to the Bitmap
// On Windows replace MyBitmap.png with a full pathname such as
    // C:\Program Files\Common Files\Borland Shared\Images\Splash\256color\factory.bmp

  Byte *ptr;
  try
  {
    pBitmap->LoadFromFile("MyBitmap.png");
    for (int y = 0; y < pBitmap->Height; y++)
    {
      ptr = (Byte *)pBitmap->ScanLine[y];
      for (int x = 0; x < pBitmap->Width; x++)
        ptr[x] = (Byte)y;
    }
    Canvas->Draw(0,0,pBitmap);
  }
  catch (...)
  {
    ShowMessage("Could not load or alter bitmap");
  }
  delete pBitmap;
} 
