Support Center

ImageMan Twain hDIB problem

Frank Liga Feb 17, 2012 04:16PM EST

I am using Twain ActiveX version 7.

I am trying to use the hDIB that is returned during the scan event, but the hDIB is standard Windows DIB.

The first 40 byts of the standard DIB is the BITMAPINFOHEADER

If I attempt to use the hDIB and use the CopyMemory(RtlMoveMemory) API using the hDIB as the source and a BITMAPINFOHEADER struct as the destination, the BITMAPINFOHEADER should be populated with correct information.

This is not the case. I have tried it in VB6 using CopyMemory, and in .NET using System.Runtime.InteropServies.Marshall.PtrToStructure The results are the same.

What is the format of the data that is the hDIB points to?

1 Data Techniques Response

Up 0 Rated Down
DTI Support  Data Techniques Employee Feb 17, 2012 04:38PM EST


The HDIB is a handle to a globally allocated memory object which contains a 'Packed DIB' which contains a BITMAPINFOHEADER, an array of Pallete Entries (If we have a palette) and then the DIB formatted raster data.

Make sure you are locking the handle using GlobalLock() and using the pointer to get access to the header and DIB data.

DTI Support

This question is closed to new answers.

Contact Us