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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.