Ignore:
Timestamp:
Jan 5, 2017, 11:48:36 PM (8 years ago)
Author:
chronos
Message:
  • Added: Remember last used image size and color format.
  • Added: Automatically create blank image.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.pas

    r30 r33  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin,
    9   StdCtrls, ActnList, UFGraphics, URegistry;
     9  StdCtrls, ActnList, Menus, UFGraphics, URegistry;
    1010
    1111type
     
    2727    SpinEditHeight: TSpinEdit;
    2828    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     29    procedure FormCreate(Sender: TObject);
    2930    procedure FormShow(Sender: TObject);
    3031    procedure SpinEditWidthChange(Sender: TObject);
     
    3233    { private declarations }
    3334  public
     35    DefaultSize: TPoint;
    3436  end;
    3537
     
    5052  ColorFormat: TColorFormat;
    5153begin
    52   ColorFormat := ColorFormatManager.Formats[ComboBoxColorFormat.ItemIndex];
     54  ColorFormat := TColorFormat(ColorFormatManager.Formats.Items[ComboBoxColorFormat.ItemIndex]);
    5355  LabelMemRequire.Caption := IntToStr(SpinEditWidth.Value * SpinEditHeight.Value *
    5456    ColorFormat.BitDepth div 8) + ' bytes';
     
    7880    SpinEditHeight.Value := Core.Project.Bitmap.Size.Y;
    7981  end else begin
    80     SpinEditWidth.Value := 200;
    81     SpinEditHeight.Value := 100;
     82    SpinEditWidth.Value := DefaultSize.X;
     83    SpinEditHeight.Value := DefaultSize.X;
    8284  end;
    8385  SpinEditDPI.Value := 72;
     
    9092end;
    9193
     94procedure TFormNew.FormCreate(Sender: TObject);
     95begin
     96  DefaultSize := Point(600, 200);
     97end;
     98
    9299end.
    93100
Note: See TracChangeset for help on using the changeset viewer.