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
 ImageResize with transparent background
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Dscho

9 Posts

Posted - Aug 20 2014 :  10:41:45  Show Profile  Reply
Hi,

i want to use ImageResizre with tramsparent background, but i always get a white background.
After Imageresize i want to copy a gradient image as backgound into a layer.

I use the following code - without result:


EnView.EnableAlphaChannel := True;
EnView.Proc.ImageResize(new_width, new_Height, hAlign, vAlign,0);
EnView.Proc.SetTransparentColors(CreateRGB(255,255,255),CreateRGB(255,255,255),0);


Best Regards
Dscho




w2m

USA
1990 Posts

Posted - Aug 20 2014 :  16:27:52  Show Profile  Reply
Are you positive that the bitmap has white pixels, or are most of the "white pixels" near white?

One way to insure setting the transparent color correctly is to get the color of the bitmap's lower-left pixel and use that for the transparent color:
var
  iRGB: TRGB;
iRGB := ImageEnView1.IEBitmap.Pixels[0, ImageEnView1.IEBitmap.Height - 1];
ImageEnView1.Proc.SetTransparentColors(iRGB, iRGB, 0);


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

Dscho

9 Posts

Posted - Aug 20 2014 :  23:20:16  Show Profile  Reply
Thanks for your reply, thats the solution.

Best regards
Dscho
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: