Changeset 35 for trunk/Forms


Ignore:
Timestamp:
May 4, 2018, 12:56:52 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Do not allocate big temp image for drawing on screen of zoomed out image.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r33 r35  
    11object FormMain: TFormMain
    2   Left = 664
     2  Left = 648
    33  Height = 640
    4   Top = 382
     4  Top = 323
    55  Width = 920
    66  Caption = 'LibrePaint'
    7   ClientHeight = 608
     7  ClientHeight = 615
    88  ClientWidth = 920
     9  DesignTimePPI = 120
    910  Menu = MainMenu1
    1011  OnActivate = FormActivate
     
    1314  OnDestroy = FormDestroy
    1415  OnShow = FormShow
    15   LCLVersion = '1.6.0.4'
     16  LCLVersion = '1.8.2.0'
    1617  object PaintBox1: TPaintBox
    1718    Left = 0
    18     Height = 554
     19    Height = 561
    1920    Top = 26
    2021    Width = 920
     
    3233    Left = 0
    3334    Height = 28
    34     Top = 580
     35    Top = 587
    3536    Width = 920
    3637    Panels = <   
    3738      item
    38         Width = 200
     39        Width = 300
    3940      end   
    4041      item
  • trunk/Forms/UFormMain.pas

    r33 r35  
    135135    StatusBar1.Panels[0].Text := '[' + IntToStr(Pos.X) + ', ' + IntToStr(Pos.Y) + '] Zoom:' +
    136136      FloatToStr(Core.Project.View.Zoom);
    137     StatusBar1.Panels[1].Text := 'Src: ' + IntToStr(View.SrcRect.Right - View.SrcRect.Left) + ', ' +
     137    StatusBar1.Panels[1].Text := 'Src: ' + IntToStr(View.SrcRect.Left) + ', ' +
     138      IntToStr(View.SrcRect.Top) + ', ' +
     139      IntToStr(View.SrcRect.Right - View.SrcRect.Left) + ', ' +
    138140      IntToStr(View.SrcRect.Bottom - View.SrcRect.Top);
    139     StatusBar1.Panels[2].Text := 'Dst: ' + IntToStr(View.DestRect.Right - View.DestRect.Left) + ', ' +
     141    StatusBar1.Panels[2].Text := 'Dst: ' + IntToStr(View.DestRect.Left) + ', ' +
     142      IntToStr(View.DestRect.Top) + ', ' +
     143      IntToStr(View.DestRect.Right - View.DestRect.Left) + ', ' +
    140144      IntToStr(View.DestRect.Bottom - View.DestRect.Top);
    141145  end;
     
    150154begin
    151155  with Core.Project do begin
    152     TempBitmap.SetSize(View.SrcRect.Right - View.SrcRect.Left,
    153       View.SrcRect.Bottom - View.SrcRect.Top);
     156    //TempBitmap.SetSize(View.SrcRect.Right - View.SrcRect.Left,
     157    //  View.SrcRect.Bottom - View.SrcRect.Top);
     158    TempBitmap.SetSize(PaintBox1.Width, PaintBox1.Height);
    154159    //TempBitmap.BeginUpdate(True);
    155160    TempBitmap.Canvas.Brush.Color := clBlack;
     
    158163   // Bitmap.PaintToCanvas(TempBitmap.Canvas, View.SrcRect);
    159164   // if EnableDraw then
    160       Bitmap.PaintToBitmap(TempBitmap, View.SrcRect);
     165    Bitmap.PaintToBitmap(TempBitmap, View.SrcRect);
     166      //StatusBar1.Panels[0].Text := IntToStr(TempBitmap.Width) + ', ' + IntToStr(TempBitmap.Height);
    161167    //TempBitmap.EndUpdate(False);
    162     PaintBox1.Canvas.StretchDraw(View.DestRect, TempBitmap);
     168    PaintBox1.Canvas.Draw(0, 0, TempBitmap);
    163169    //PaintBox1.Canvas.Draw(0, 0, TempBitmap);
    164170  end;
Note: See TracChangeset for help on using the changeset viewer.