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
 ImageResize with transparent background

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
Dscho Posted - Aug 20 2014 : 10:41:45
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




2   L A T E S T    R E P L I E S    (Newest First)
Dscho Posted - Aug 20 2014 : 23:20:16
Thanks for your reply, thats the solution.

Best regards
Dscho
w2m Posted - Aug 20 2014 : 16:27:52
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