//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "LoadFromResourceName.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: LoadFromResourceName
// Method: Graphics.TBitmap.LoadFromResourceName
// Method: Graphics.TBitmap.Create

// BeginCode
/*
This example requires a resource file in the sources directory.
*/

#pragma resource "extrares.res"
#include <memory>       //for STL auto_ptr class

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  std::auto_ptr<Graphics::TBitmap> Bitmap1(new Graphics::TBitmap());
  try
  {
	Bitmap1->LoadFromResourceName((int)HInstance, "Live");
    Canvas->Draw(12,12,Bitmap1.get());
  }
  catch (...)
  {
    MessageBeep(0);
  }
}
// EndCode
// EndExample: LoadFromResourceName
//---------------------------------------------------------------------------
