//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "ViewForm.h"
#include "extdlgs.hpp"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::OpenBtnClick(TObject *Sender)
{
    TOpenPictureDialog* OpenDialog = new TOpenPictureDialog(NULL);
    OpenDialog->Filter = GraphicFilter(__classid(Graphics::TGraphic));

    if (OpenDialog->Execute())
    {
        Image->Picture->LoadFromFile(OpenDialog->FileName);
        Image->Width  = Image->Picture->Graphic->Width;
        Image->Height = Image->Picture->Graphic->Height;
    
        GraphicClassNameLbl->Caption = Image->Picture->Graphic->ClassName();
    }
    delete OpenDialog;
}
//---------------------------------------------------------------------------
