Changeset 28 for trunk/ScreenTools.pas


Ignore:
Timestamp:
Jan 8, 2017, 7:14:56 PM (7 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ScreenTools.pas

    r21 r28  
    439439  if (Options and gfNoGamma = 0) and (Gamma <> 100) then
    440440  begin
     441    bmp.BeginUpdate;
    441442    FirstLine := bmp.ScanLine[0];
    442443    LastLine := bmp.ScanLine[bmp.Height - 1];
     
    444445      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    445446    else
    446       ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width])
     447      ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]);
     448    bmp.EndUpdate;
    447449  end
    448450end;
     
    497499  if (Options and gfNoGamma = 0) and (Gamma <> 100) then
    498500  begin
     501    bmp.BeginUpdate;
    499502    FirstLine := bmp.ScanLine[0];
    500503    LastLine := bmp.ScanLine[bmp.Height - 1];
     
    502505      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    503506    else
    504       ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width])
     507      ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]);
     508    bmp.EndUpdate;
    505509  end
    506510end;
     
    546550    GrExt[nGrExt].Mask.Height := Source.Height;
    547551
     552    GrExt[nGrExt].Data.BeginUpdate;
     553    GrExt[nGrExt].Mask.BeginUpdate;
    548554    for y := 0 to Source.Height - 1 do
    549555    begin
     
    570576      end
    571577    end;
     578    GrExt[nGrExt].Data.EndUpdate;
     579    GrExt[nGrExt].Mask.EndUpdate;
    572580
    573581    FillChar(GrExt[nGrExt].pixUsed, GrExt[nGrExt].Data.Height div 49 * 10, 0);
    574     inc(nGrExt)
     582    inc(nGrExt);
    575583  end
    576584end;
     
    602610  i: integer;
    603611begin
     612  dst.BeginUpdate;
    604613  for i := 0 to h - 1 do
    605     BlueLine(@(PLine(dst.ScanLine[y + i])[x]), w)
     614    BlueLine(@(PLine(dst.ScanLine[y + i])[x]), w);
     615  dst.EndUpdate;
    606616end;
    607617
     
    638648    exit;
    639649
     650  dst.BeginUpdate;
    640651  h := yDst + h;
    641652  while yDst < h do
     
    666677    inc(yDst);
    667678    inc(ySrc);
    668   end
     679  end;
     680  dst.EndUpdate;
    669681end;
    670682
     
    681693  SrcLine, DstLine: ^TLine;
    682694begin
    683   if xDst < 0 then
    684   begin
     695  if xDst < 0 then begin
    685696    w := w + xDst;
    686697    xSrc := xSrc - xDst;
    687698    xDst := 0;
    688699  end;
    689   if yDst < 0 then
    690   begin
     700  if yDst < 0 then begin
    691701    h := h + yDst;
    692702    ySrc := ySrc - yDst;
     
    700710    exit;
    701711
     712  dst.BeginUpdate;
    702713  for iy := 0 to h - 1 do
    703714  begin
     
    732743    end
    733744  end;
     745  dst.EndUpdate;
    734746end;
    735747
     
    746758  Pixel: ^TPixel;
    747759begin
     760  bmp.BeginUpdate;
    748761  assert(bmp.PixelFormat = pf24bit);
    749762  h := y + h;
     
    766779    end;
    767780    inc(y);
    768   end
     781  end;
     782  bmp.EndUpdate;
    769783end;
    770784
     
    884898  DstLine: ^TLine;
    885899begin
     900  dst.BeginUpdate;
    886901  for y := -GlowRange + 1 to Height - 1 + GlowRange - 1 do
    887902  begin
     
    917932            (GlowRange - r)) div (GlowRange - 1);
    918933    end;
    919   end
     934  end;
     935  dst.EndUpdate;
    920936end;
    921937
Note: See TracChangeset for help on using the changeset viewer.