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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 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
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

1018 Posts

Posted - May 16 2025 :  04:56:30  Show Profile  Reply
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!

xequte

39450 Posts

Posted - May 16 2025 :  16:45:38  Show Profile  Reply
Thanks Peter,

We'll look into that.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

1018 Posts

Posted - May 17 2025 :  03:47:28  Show Profile  Reply
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;
Go to Top of Page

xequte

39450 Posts

Posted - May 17 2025 :  16:06:46  Show Profile  Reply


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

bmesser

United Kingdom
254 Posts

Posted - Jun 04 2026 :  11:05:16  Show Profile  Reply
I second that!

All I want to do is display an image (60x60) on a form that's connected to an TImageList that I can swap which image it displays.

Why no one has thought about this before is surprising.

It sounds simple enough but the only thing that I can come up with is a TMS TAdvGlowButton connected to a TImageList.

By the time you're finished you might as well load the image straight from the file.
Go to Top of Page

xequte

39450 Posts

Posted - Jun 04 2026 :  21:40:20  Show Profile  Reply
That should be possible.

Can you select a sample TImageList with your images in the form, copy it to the clipboard and post or email it to me?


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: