Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, August 5, 2012 11:53:41 PM(UTC)

meeron  
meeron

Groups: Registered
Views messages in topic : 6


Hello,
I'm using evaluation copy of LEADTOOLS v17.5.4.0.
With FeatherAlphaBlendCommand i comine two png images. I'm creating 3rd transparent image for background. After combine i save the result image as png file with 32bit of colors depth to preserve transparency. Unfortunetly when i open this image there's nothing there. I figure out that those two images are drawn on background which is transparent and that why there are not visible. Any ideas how with FeatherAlphaBlendCommand (or by some other command) save those images properly?
I've attached VS2010 C# project with hole operation.
File Attachment(s):
CombineImages.zip (493kb) downloaded 26 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 6, 2012 3:47:57 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Meeron,
I want to investigate this issue further. Please send a new email to support@leadtools.com and include with your email the following:
1) Your serial number (do NOT post here).
2) The file version of leadtools.dll that you have.
3) A link to this forum post.

 
#3 Posted : Monday, August 6, 2012 4:46:26 AM(UTC)

meeron  
meeron

Groups: Registered
Views messages in topic : 6


I have evaluation copy. I can't find any serial number. I didn't recived any when i was downloading evaluation package.
 
#4 Posted : Tuesday, August 7, 2012 2:49:43 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

The evaluation version does not have a serial number, so you only need to mention Evaluation when you open the email ticket.
Our email support is free for both evaluation users and product owners.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Thursday, August 9, 2012 4:21:33 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


I have modified your project as follows:
1. The part that combines the 2 images with a white background is correct, so I did not change it.
2. The result image needs a suitable alpha bitmap. So I added the following code to combine the 2 alpha channels from the source bitmaps into one alpha channel. This new alpha channel gets added to the target image before saving it:
//Before the loop:
RasterImage alphaCombineImage = RasterImage.Create(1024, 1024, 24, 1024 * 1024, RasterColor.Black);
Leadtools.ImageProcessing.GrayscaleCommand gs = new Leadtools.ImageProcessing.GrayscaleCommand(8);
gs.Run(alphaCombineImage);
RasterImage rasterImgAlpha = null;

//Inside the loop:
rasterImgAlpha = rasterImg.CreateAlphaImage();
command.MaskImage = rasterImgAlpha;
Leadtools.ImageProcessing.CombineFastCommand combFast = new Leadtools.ImageProcessing.CombineFastCommand(
   alphaCombineImage, new LeadRect(0, 0, alphaCombineImage.Width, alphaCombineImage.Height), LeadPoint.Empty,
   Leadtools.ImageProcessing.CombineFastCommandFlags.OperationMaximum);
combFast.Run(rasterImgAlpha);

//After the loop, before saving:
combineImage.SetAlphaImage(alphaCombineImage);

I'm attaching the modified project

File Attachment(s):
SaveAlpha.zip (482kb) downloaded 31 time(s).
 
#6 Posted : Thursday, August 9, 2012 4:47:20 AM(UTC)

meeron  
meeron

Groups: Registered
Views messages in topic : 6


Thanks, works perfectly!
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.288 seconds.