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
 Import a TRANSPARENT image from a TImageList and keep the transparency

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 - May 16 2025 : 04:56:30
In ImageEnView, I use this method to import a TRANSPARENT image from a TImageList and keep the transparency:

procedure TForm1.ButtonGetImageFromImageListClick(Sender: TObject);
var
  Icon: TIcon;
begin
  Icon := TIcon.Create;
  try
    Icon.Transparent := True;
    ImageList1.GetIcon(0, Icon);
    ImageEnView1.Assign(Icon);
    ImageEnView1.Update;
  finally
    Icon.Free;
  end;
end;




attach/PeterPanino/20255161395_ImageEnViewGetTransparentImageFromImageList_V2.zip
18.05 KB

Is there a better built-in method in ImageEn to do this (like in TImageEnMView)?

Such a method could have an optional Transparency parameter to configure the Alpha channel, for example:

ImageEnView1.ImportImage(ImageList1, Index, Alpha);

This would be very helpful!
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 17 2025 : 16:06:46


Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - May 17 2025 : 03:47:28
Unfortunately, the VCL TImageList provides only an outdated technology with static pixel images (bmp, ico, png), whereas the DevExpress TcxImageList can also store SVG images.

The only free alternative is SVGIconImageList (Open Source from Ethea).

On the other hand, TIEBitmap has only an AddToImageList method, but not an explicit GetFromImageList method!

After getting artefacts with the TIcon method in a specific corner case, I now use a TBitmap with AlphaFormat:

bmp := TBitmap.Create;
try
  bmp.Width := W;
  bmp.Height := H;
  bmp.PixelFormat := Vcl.Graphics.pf32bit;
  bmp.AlphaFormat := Vcl.Graphics.afDefined;
  ImageList1.GetBitmap(0, bmp);
  ImageEnView1.Assign(bmp);
  ImageEnView1.Update;
finally
  bmp.Free;
end;
xequte Posted - May 16 2025 : 16:45:38
Thanks Peter,

We'll look into that.


Nigel
Xequte Software
www.imageen.com