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
 Transparent 32-bit PNG

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
kbriggs Posted - Sep 24 2013 : 19:29:22
I've got an old (version 3.0.5) license of ImageEn. I cannot figure out how to create a 32-bit transparent PNG image. This is my code:

ie := TImageEnView.Create(nil);
ie.EnableAlphaChannel := True;
ie.IO.IEBitmap.Width := 100;
ie.IO.IEBitmap.Height := 100;
ie.LegacyBitmap := False;
ie.IO.IEBitmap.PixelFormat := ie32RGB;
ie.IO.Params.BitsPerSample := 8;
ie.IO.Params.SamplesPerPixel := 4;
ie.IO.SaveToFilePNG('C:\Temp\test.png');
ie.Free;

The result is a 24-bit, 3 SamplesPerPixel image with a white background, not a 32-bit, 4 SamplesPerPixel image as desired. What am I doing wrong here?
2   L A T E S T    R E P L I E S    (Newest First)
kbriggs Posted - Sep 25 2013 : 12:10:30
William,

That worked. Thanks!
w2m Posted - Sep 25 2013 : 08:46:07
I do not think you should set ie.IO.IEBitmap.PixelFormat := ie32RGB.

This is what I do to create a 32-bit transparent bitmap or png:
ImageEnView.IO.Params.BitsPerSample := 8;
ImageEnView.IO.Params.SamplesPerPixel := 4;
iRGB := ImageEnView.IEBitmap.Pixels[0, ImageEnView.IEBitmap.Height - 1];
ImageEnView.Proc.SetTransparentColors(iRGB, iRGB, 0);

Hope this helps.
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html