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 : Tuesday, July 4, 2006 9:32:37 AM(UTC)

dbyrns  
dbyrns

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
 

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 : Tuesday, July 4, 2006 10:32:36 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 356


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.
LEAD Logo
 
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-2020, Yet Another Forum.NET
This page was generated in 0.047 seconds.