LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: Restrictions of creation size for a LBitmap
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, July 4, 2006 9:32:37 AM(UTC)
Groups: Registered
Posts: 1
Hi,
I tried to create a LBitmapBase with random size
image and I got the -13 error (Invalid parameter passed). It seems that
using images with a width that are a multiple of 4 works well. So, I
would like to know the real restrictions on size of images that can be
created with the function Create of LBitmapBase without having any
error.
Thank you,
David
#2
Posted
:
Tuesday, July 4, 2006 10:32:36 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
David,
You can have any bitmap width, but if the bytes per row (BytesPerLine) are not a multiple of 4 bytes (32-bit), you must allocate a little more to align. Here's how to calculate the needed bytes per line in C/C++ using integer arithmetic:
int nBytesPerLine = (((nWidth*nbisPerPixel)+31)/32)*4;
where nWidth and nbisPerPixel are both integer values.
The total buffer size will be nBytesPerLine*imageHeight.
The extra bits (from zero to 31 in number) will not be used or displayed.
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: Restrictions of creation size for a LBitmap
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.