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
 How Do I make a Transparent PNG File From a Bitmap

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
john_siggy@yahoo.com Posted - Jul 22 2019 : 11:51:10
Attached you will see an image with two smaller images on top. One of the smaller images (the checkmark) is a transparent CUR file. I am unable to make the other image transparent.

How do I save a bitmap to a transparent PNG or CUR file ???


Regards,

John
3   L A T E S T    R E P L I E S    (Newest First)
john_siggy@yahoo.com Posted - Jul 23 2019 : 10:51:20
Thnks alot Nigel...
xequte Posted - Jul 22 2019 : 21:59:03
Hi John

You can do it as follows:

procedure TForm1.Button2Click(Sender: TObject);
var
  transColor: TRGB;
begin
  ImageEnView1.IO.LoadFromFile('D:\makestrans.bmp');

  // Bottom left pixel represents the transparent color
  transColor := ImageEnView1.IEBitmap.Pixels[0, Height-1];

  ImageEnView1.Proc.SetTransparentColors( transColor, transColor, 0 );

  ImageEnView1.IO.SaveToFile('D:\NowTransparent.png');
end;


Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Jul 22 2019 : 11:53:58
Here is the image: