ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Best practice for adding an image from TIEBitmap to a TImageList?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Oct 17 2025 : 12:41:07
I am adding the image from a TIEBitmap to a TImageList by keeping transparency:

Is the following processing order correct and optimal for keeping the transparency of the image?

IEBitmap := TIEBitmap.Create;
try
  // 1. Load the image first
  MemStream.Position := 0;
  IEBitmap.IO.LoadFromStream(MemStream);
  
  // 2. Resize (while still at full color depth)
  IEBitmap.Resample(24, 24, rfLanczos3);
  
  // 3. Configure for transparency AFTER loading and resizing
  IEBitmap.VclBitmap.PixelFormat := pf32bit;
  IEBitmap.VclBitmap.AlphaFormat := afDefined;
  
  // 4. Add to ImageList
  ImageIndex := FImageList.Add(IEBitmap.VclBitmap, nil);
finally
  IEBitmap.Free;
end;
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 19 2025 : 17:04:50
Hi Peter

You are better to use:
https://www.imageen.com/help/TIEBitmap.AddToImageList.html

IEBitmap := TIEBitmap.Create;
try
  // 1. Load the image first
  MemStream.Position := 0;
  IEBitmap.IO.LoadFromStream(MemStream);
  
  // 2. Resize (while still at full color depth)
  IEBitmap.Resample(24, 24, rfLanczos3);
  
  // 3. Add to ImageList
  ImageIndex := IEBitmap.AddToImageList( FImageList );
finally
  IEBitmap.Free;
end;


Nigel
Xequte Software
www.imageen.com