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 : Friday, August 31, 2012 2:25:10 AM(UTC)

meeron  
meeron

Groups: Registered
Posts: 6


Hello,
I have two images: img1.png and img2.png. Both are 32bit images with transparency.
With method RasterImage.CreateAlphaImage() i'm creating alpha image for both files.
The RasterImage.DataSize of original image should be equal to data size of alpha image multiple by 4.
I have problem with img1.png, because data size values doesn't match.
Is there something wrong with my file or i'm doing someting wrong?

I'm using .NET Leadtools 17.5.
Images int attachment
File Attachment(s):
images.zip (273kb) downloaded 38 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 : Sunday, September 2, 2012 6:25:06 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


The RasterImage.DataSize of original image should NOT always be equal to data size of alpha image multiplied by 4.
The reason is that images in LEADTOOLS are stored in memory so that the BytesPerLine are always a multiple of 4. Since the original image 32-bit, which means 4 bytes per pixel, its data will always be a multiple of 4.
However, the Alpha image might have some padding bytes to make its lines multiple of 4.

This means if the image width is a multiple of 4, like img2.png, your calculation is correct. For other images, the correct formula is:
Alpha bitmap data size = (image width rounded up to nearest multiple of 4) * (image height).

 
#3 Posted : Monday, September 3, 2012 12:22:47 AM(UTC)

meeron  
meeron

Groups: Registered
Posts: 6


Right. Thanks for your answer. That's resolve my problem.
 
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-2024, Yet Another Forum.NET
This page was generated in 0.072 seconds.