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

shackers

United Kingdom
28 Posts

Posted - Feb 13 2020 :  09:30:26  Show Profile  Reply
I'm trying to add a bitmap object to an imageEnView with transparency.

This is what I have so far:

bmp.PixelFormat:=pf24bit;
bmp.assign(bmpIconNote);
bmp.TransparentMode:=tmAuto;
bmp.saveToFile(filename);
ImageEnV.setObjBitmapFromFile(hObj, fileName);
ImageEnV.ObjWidth[hOBJ]:=48;
ImageEnV.ObjHeight[hOBJ]:=48;
I
However, the image is not transparent. What do I need to do?

xequte

38182 Posts

Posted - Feb 13 2020 :  14:21:55  Show Profile  Reply
Hi

For a TBitmap to be transparent it must be 32bit. Even then I don't know that assigning an icon to it will copy the alpha information. You are probably better to work with TIEBitmap to generate a transparent image.

What is your source? If it is an icon file, you can just TIEBitmap.Read to load it with transparency.

Also, if you are starting on a new project, you should use TIELayers, not TImageEnVect objects, e.g.

ImageEnView1.LayersAdd( 'C:\myicon.ico' );

See:

https://www.imageen.com/help/TImageEnVect%20vs%20TIELayers.html

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

shackers

United Kingdom
28 Posts

Posted - Feb 13 2020 :  14:43:58  Show Profile  Reply
Thanks Nigel.

I'll move to layers and it's easy enough for me to change the bitmap to an icon.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: