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 : Thursday, March 15, 2007 5:44:21 AM(UTC)

mlukic  
mlukic

Groups: Registered
Posts: 8


Please consider following situation: during our acquisition process we receive pointer (IntPtr) on (raw) image that is 750 x 750 with 16 bits per pixel, grayscale. We need to show it in LeadRasterView control immediately. We tried using

 

Copy bytes to bmpData array (Int16 type)

LTRasterView.Raster.CreateUserBitmap2(750, 750, 16, Nothing, 0)

LTRasterView.Raster.SetBitmapDataPointer2(bmpData, 750 * 750)

 

(also tried with 800x800 – to have 4 bytes per line).

 

This does not work. Sometimes our exception is “Object reference not set to an instance of an object”, sometimes just “?” and sometimes it shows (some) “image” that does not match our bitmap data.

 

Can you give us some ides to solve the problem (maybe using other Lead options)

 

We are using V14.5  (our application is .net)

Thanks in advance

 

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, March 19, 2007 12:45:12 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

If you have a pointer to unmanaged memory that contains the grayscale pixel data, you can use the LTRasterView.Raster.CreateUserBitmap3 function.
It takes the Width and Height in pixels, bits per pixel (16 in your case) and pData as int32 (the value is in the int ptr) and the lDataSize in bytes (w * h * 2 in your case).

Note that the bytes per line value should be an integer multiple of 4.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Monday, March 19, 2007 5:22:30 AM(UTC)

mlukic  
mlukic

Groups: Registered
Posts: 8


Thanks a lot, this works. We didn’t use this function because it is not documented in Help file. Anyway, there is now one thing I’d like to ask you - How to change byte order when displaying this (16b) image?

 
#4 Posted : Monday, March 19, 2007 11:35:10 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

If the raw pixel data is in the Motorola byte order instead of the Intel byte order, you cannot use CreateUserBitmap functions.
There is another way to load such raw data, which is using the raw loading mechanism, and specifying the LOADINFO_MOTOROLAORDER flag.

For details, please refer to the help topic "RawLoad Example for Visual Basic"

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.061 seconds.