How to load a TIFF image to a BIDIB in memory in C#

  Imaging Toolkit

Scan into memory using Black Ice’s BiTwain.ocx control, the BiTwain control returns with a hDib object. One can use this hDib object as an input parameter for methods of BiDib.ocx without any conversion, because hDib is not a class. It is a handle to a device independent bitmap stored in the memory.
For example: If you check the Scanning C# sample you will see the scanned hDib can be displayed with BiDisp.ocx without any conversion.

private void BiTwain_Done(object sender, AxBITWAINLib._DBiTwainEvents_DoneEvent e)
{
if (e.hDibOutput > 0 && CHKVIEWIMAGE.Checked)
{
// Show scanned image
ShowScannedImage(e.hDibOutput);
}
else
{
if (e.hDibOutput > 0)
BiTwain.ReleaseData(e.hDibOutput);
}
}

private void ShowScannedImage(int hDib)
{
FormShowImage dlg = new FormShowImage();

dlg.BiDisp.hDib = hDib;
dlg.Show();
}

Regards,
Technical Support Team