{
   This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
}
unit Ufrmnewimage;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons, Spin, UnViewColorBox;

type
  Tfrmnewimage = class(TForm)
    Label1: TLabel;
    SpinEdit1: TSpinEdit;
    Label2: TLabel;
    SpinEdit2: TSpinEdit;
    BitBtn2: TBitBtn;
    BitBtn1: TBitBtn;
    ColorBox1: TnViewColorBox;
    bsSkinStdLabel2: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmnewimage: Tfrmnewimage;

implementation
uses Uconfig;

{$R *.dfm}

procedure Tfrmnewimage.FormCreate(Sender: TObject);
begin
  config.getvaluebyinteger('newimage_width',500);
  self.SpinEdit1.Value:=config.lastvalue_integer;
  config.getvaluebyinteger('newimage_height',400);
  self.SpinEdit2.Value:=config.lastvalue_integer;
  config.getvaluebyinteger('newimage_color',clwhite);
  self.ColorBox1.Selected:=config.lastvalue_integer;
end;

procedure Tfrmnewimage.BitBtn2Click(Sender: TObject);
begin
  if (SpinEdit1.Value*SpinEdit2.Value)>(6000*6000) then begin
    MessageDlg('이미지 사이즈가 너무 큽니다. 넓이 또는 높이를 줄여주세요.',mterror, [mbOk], 0);
    exit;
  end;
  config.setvaluebyinteger('newimage_width',self.SpinEdit1.Value);
  config.setvaluebyinteger('newimage_height',self.SpinEdit2.Value);
  config.setvaluebyinteger('newimage_color',self.ColorBox1.Selected);
  self.ModalResult:=mrok;
end;

end.
