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

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "ImageEnIO"
#pragma link "ImageEnProc"
#pragma link "ImageEnView"
#pragma link "ImageEnIO"
#pragma link "ImageEnProc"
#pragma link "ImageEnView"
#pragma link "IEOpenSaveDlg"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
// Color adjust
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	ImageEnProc1->DoPreviews(ppeColorAdjust);
}
//---------------------------------------------------------------------------
// Effects
void __fastcall TForm1::Button2Click(TObject *Sender)
{
	ImageEnProc1->DoPreviews(ppeEffects);
}
//---------------------------------------------------------------------------
// Zoom
void __fastcall TForm1::TrackBar1Change(TObject *Sender)
{
   ImageEnView1->Zoom=TrackBar1->Position;
   Label1->Caption="Zoom ("+IntToStr(TrackBar1->Position)+"%)";
}
//---------------------------------------------------------------------------
// Mouse Down
void __fastcall TForm1::ImageEnView1MouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
	if(Button==mbRight)
       	ImageEnView1->DeSelect();
}
// Copy selection to clipboard
void __fastcall TForm1::Button3Click(TObject *Sender)
{
	ImageEnProc1->SelCopyToClip();
}
//---------------------------------------------------------------------------
// Cut
void __fastcall TForm1::Button5Click(TObject *Sender)
{
	ImageEnProc1->SelCutToClip();
}
//---------------------------------------------------------------------------
// Paste
void __fastcall TForm1::Button4Click(TObject *Sender)
{
	ImageEnProc1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
// Paste In
void __fastcall TForm1::Button6Click(TObject *Sender)
{
	ImageEnProc1->SelPasteFromClipStretch();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormActivate(TObject *Sender)
{
    DefGIF_LZWDECOMPFUNC=GIFLZWDecompress;
    DefGIF_LZWCOMPFUNC=GIFLZWCompress;
    DefTIFF_LZWDECOMPFUNC=TIFFLZWDecompress;
    DefTIFF_LZWCOMPFUNC=TIFFLZWCompress;
}
//---------------------------------------------------------------------------
// Load
void __fastcall TForm1::Button7Click(TObject *Sender)
{
	if(OpenImageEnDialog1->Execute())
   	ImageEnIO1->LoadFromFile( OpenImageEnDialog1->FileName );
}
//---------------------------------------------------------------------------
// Save
void __fastcall TForm1::Button8Click(TObject *Sender)
{
	if(SaveImageEnDialog1->Execute())
   	ImageEnIO1->SaveToFile( SaveImageEnDialog1->FileName );
}
//---------------------------------------------------------------------------

