Jump to content
kapas

TCustomImageList.InsertImage и ImageList_Copy

Recommended Posts

Good afternoon!

Has anyone encountered a similar problem?

I make a duplication of the picture in TListImag:

   
         

         ABitmap: = TBitmap.Create ();
         try
             ACurrImageIndex: = GetImageIndex ();
             Images.GetBitmap (ACurrImageIndex, ABitmap);
             Images.Insert (ACurrImageIndex, ABitmap, nil);
// ....
         finally
           System.SysUtils.FreeAndNil (ABitmap);
         end;

At the first call, the picture is inserted at the end of the image collection. On subsequent calls, everything is done correctly.

It seems that something strange happens during the first call to ImageList_Copy (Handle, I, Handle, I + 1, ILCF_SWAP)

What could be the reason and how can it be solved?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×