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/UFormMain.pas

    r31 r33  
    5050    ToolButton2: TToolButton;
    5151    ToolButton3: TToolButton;
     52    ToolButton4: TToolButton;
    5253    procedure FormActivate(Sender: TObject);
    5354    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     
    7071    procedure PaintBox1Resize(Sender: TObject);
    7172    procedure Timer1Timer(Sender: TObject);
     73    procedure ToolButton4Click(Sender: TObject);
    7274  private
     75    EnableDraw: Boolean;
    7376    TempBitmap: TBitmap;
    7477    StartMousePoint: TPoint;
     
    109112end;
    110113
     114procedure TFormMain.ToolButton4Click(Sender: TObject);
     115begin
     116  EnableDraw := True;
     117end;
     118
    111119procedure TFormMain.OpenRecentClick(Sender: TObject);
    112120begin
     
    127135    StatusBar1.Panels[0].Text := '[' + IntToStr(Pos.X) + ', ' + IntToStr(Pos.Y) + '] Zoom:' +
    128136      FloatToStr(Core.Project.View.Zoom);
     137    StatusBar1.Panels[1].Text := 'Src: ' + IntToStr(View.SrcRect.Right - View.SrcRect.Left) + ', ' +
     138      IntToStr(View.SrcRect.Bottom - View.SrcRect.Top);
     139    StatusBar1.Panels[2].Text := 'Dst: ' + IntToStr(View.DestRect.Right - View.DestRect.Left) + ', ' +
     140      IntToStr(View.DestRect.Bottom - View.DestRect.Top);
    129141  end;
    130142end;
     
    144156    TempBitmap.Canvas.FillRect(0, 0, TempBitmap.Width, TempBitmap.Height);
    145157    View.DestRect := Bounds(0, 0, PaintBox1.Width, PaintBox1.Height);
    146     //Bitmap.PaintToCanvas(TempBitmap.Canvas, View.SrcRect);
    147     Bitmap.PaintToBitmap(TempBitmap, View.SrcRect);
     158   // Bitmap.PaintToCanvas(TempBitmap.Canvas, View.SrcRect);
     159   // if EnableDraw then
     160      Bitmap.PaintToBitmap(TempBitmap, View.SrcRect);
    148161    //TempBitmap.EndUpdate(False);
    149162    PaintBox1.Canvas.StretchDraw(View.DestRect, TempBitmap);
Note: See TracChangeset for help on using the changeset viewer.