2023年12月2日 星期六

No flashing windows paint double buffering direct2d paint flickering flash double buffer beginupdate lock multilayer. window ui locked beginupdate lockdraw lockwindowupdate

 direct2d paint flickering flash double buffer beginupdate lock multilayer.

window ui locked beginupdate lockdraw lockwindowupdate

beginupdate
https://docwiki.embarcadero.com/CodeExamples/Sydney/en/Code_Examples_Index

https://en.delphipraxis.net/topic/4768-vcl-handling-of-dpi-changes-poor-performance/

WM_SETREDRAW 
TWinControl.LockDrawing TWinControl.UnlockDrawing
TWinControl.IsDrawingLocked TWinControl.RedrawDisabled
https://delphi.cz/post/TWinControlLockDrawing-a-TWinControlUnlockDrawing.aspx

https://docwiki.embarcadero.com/Libraries/Alexandria/en/Vcl.Controls.TWinControl.UnlockDrawing
TWinControl.LockDrawing  TWinControl.UnlockDrawing
https://embarcadero.github.io/DelphiVCL4Python/reference/delphivcl.WinControl.html
Vcl.Controls.TWinControl.UnlockDrawing     LockDrawing
    IsDrawingLocked ReplaceDockedControl
https://docs.devexpress.com/VCL/dxLayoutControl.TdxLayoutControl._members


https://en.delphipraxis.net/topic/3538-per-monitor-dpi-awareness-how-to-prevent-flickering/
https://blogs.embarcadero.com/the-vcl-lockdrawing-method-in-twincontrol/
delphi embarcadero file class bitmap

 https://www.codeproject.com/articles/12870/don-t-flicker-double-buffer




//LockDrawing
begin
  Screen.Cursor:=crHourGlass;
   TWinControl(SomeOne).LockDrawing;
   TWinControl(SomeOne).Items.Clear;
  try
    for I := 1 to ffffffffff do
       TWinControl(SomeOne).Items.Add('Line ' + (I+1).ToString);
  finally
     TWinControl(SomeOne).UnlockDrawing;
  end;
  Screen.Cursor:=crDefault;
end;

//BeginUpdate
begin
  Screen.Cursor:=crHourGlass;
   TWinControl(SomeOne).Items.BeginUpdate;
   TWinControl(SomeOne).Items.Clear;
  try
    for I := 1 to ffffffffff do
       TWinControl(SomeOne).Items.Add('Line ' + (I+2).ToString);
  finally
       TWinControl(SomeOne).Items.EndUpdate;
  end;
  Screen.Cursor:=crDefault;
end;
///LockDrawing
begin
  Screen.Cursor:=crHourGlass;
   TCustomControl(SomeCC).LockDrawing;
  try
    for I := 1 to 10000 do
    begin
       TCustomControl(SomeCC).Color := clBlue;
       TCustomControl(SomeCC).Repaint;
       TCustomControl(SomeCC).Color := clRed;
       TCustomControl(SomeCC).Repaint;
    end;
  finally
     TCustomControl(SomeCC).UnlockDrawing;
  end;
  Screen.Cursor:=crDefault;
end;
 

沒有留言: