This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 15, 2007 5:44:21 AM(UTC)
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
#2
Posted
:
Monday, March 19, 2007 12:45:12 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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)
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)
Groups: Registered, Tech Support
Posts: 1,326
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.