IconFontsImageList icon indicating copy to clipboard operation
IconFontsImageList copied to clipboard

[performance tip, not an issue] use `StopDrawing' and `BeginUpdate/EndUpdate` to greatly improve the performance

Open edwinyzh opened this issue 2 years ago • 0 comments

So IconFontsImageList is such a great great library. Thanks!

Here is a tip (not a bug report nor question) for newcomers who create icons at runtime - Use StopDrawing(True)/StopDrawing(False) and BeginUpdate/EndUpdate (especially the former), the icon creation speed will be improved dramatically.

Your code would look like:

  aImgList.StopDrawing(True);
  aImgList.BeginUpdate;
  try
    for i := 0 to 999 do
      aImgList.AddIcon(...);
  finally
    aImgList.EndUpdate;
    aImgList.StopDrawing(False);
    aImgList.RedrawImages;
  end;

edwinyzh avatar Mar 31 '22 12:03 edwinyzh