Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8000729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:53:38+00:00 2026-06-04T15:53:38+00:00

Overview I am populating a TListView with the ViewStyle set to vsIcon. The Listview

  • 0

Overview

I am populating a TListView with the ViewStyle set to vsIcon. The Listview is connected to a TImageList where for each item added to the Listview, has its own image as specified by the corresponding index.

The idea is to be able to automate the process of manipulating a series of bitmaps all at once. Each Bitmap is different, although always the same in size.

Due to the nature of how this works there is never a fixed size or limit as to how many Bitmaps are been added to the ImageList, the only restriction is the available System memory.

Problem

The issue I have is related to the performance of the manipulation on these Bitmaps. By manipulation I mean performing different Image processing techniques on the Bitmaps such as Greyscale, Swapping colors, Adjusting Brightness etc.

Now suppose it takes 3 seconds to Adjust the Brightness of a Bitmap that is 1Mb in size. If the ImageList has a total of 10 Bitmaps then this process now takes approx 30 seconds.

(Note: I have not tested the speed with GetTickCount or anything, these are just examples).

Consider the fact though that as I said earlier this ImageList could be anything in size, potentially the processing time could go on for what may seem like an eternity.

When I perform any manipulation on these Bitmaps I use GetBitmap inside a loop to send each Bitmap to an off screen buffer Bitmap to perform the manipulation on, like this:

var
  Bmp: TBitmap;
  i: Integer;
begin
  Bmp := TBitmap.Create;
  try
    ImageList1.BeginUpdate;
    try
      for i := 0 to ImageList1.Count - 1 do
      begin
        ImageList1.GetBitmap(i, Bmp);
        Bmp.PixelFormat := pf24Bit;
        // perform manipulation to Bmp here
        ImageList1.Replace(i, Bmp, nil);
      end;
    finally
      ImageList1.EndUpdate;
    end;
  finally
    Bmp.Free;
  end;
end;

Run that over a ImageList that could contain any size or amount of Images and you can maybe understand how this could be slow.

I am looking for ways to optimize and improve the way of doing this as right now it is no where near acceptable performance wise. BeginUpdate and EndUpdate does not offer a worthwhile solution here. I am not looking for any miracles as I understand that most computations require lengthy processing time, I just need to reduce this time as best as possible with any help and advice you may have to offer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:53:40+00:00Added an answer on June 4, 2026 at 3:53 pm

    Personally, I’d do a few things:

    0) Don’t do anything until you’ve profiled your code to make sure this is in fact where the slowdown is happening.

    1) Rather than using a TImageList, I’d use a TList descendent to store the images. I’m not sure if this would have a direct impact on performance, but IIRC, TImageList relies a lot on the built-in Windows image handling, which might be slower.

    2) Update the images on-demand rather than all together, if this is possible.

    3) Thread the conversion process rather than run it in the main thread. This is pretty simple if you’re also using a TList, as you can just pass the list item to the thread (or thread queue). This has the added benefit of using multiple processors if they’re available.

    Threading has the most potential to improve perceived performance of your app, even if it might not actually take less time. Combine that with as-required conversion and you should see a giant improvement.

    ETA: A thread pool, as mentioned by Jerry in the comment, is a good idea. There are some examples of this on the Embarcadero site, if you search their blogs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Overview: I have set up a server and a client, where both attempt discovery
Overview (Sorry its vague - I think if I went into more detail it
Situation Overview I'm using Ext.NET GridPanel to display a list of projects which has
First a short overview of my code, i hope its understandable: I have a
OverView I'm having problem with Ajax Tab Container ,I have added three tabs in
Overview I have a iOS project in which the view controller implementation which has
Question Overview: I want to be able to edit an item (a restaurant in
Is there an exact overview what has changed in the SP1 for .NET 3.5?
Overview: I am writting an application to dynamically load .dlls and call their methods.
Overview I'm trying to build a graphic in my game by combining a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.