Loading BIDIB Image from Memory

Document Imaging SDK,
Image SDK,
TIFF SDK,
Annotation SDK,
Cover Page Generator

Moderator: Technical Support Team

Loading BIDIB Image from Memory

Postby seanm83854 » Mon May 11, 2009 12:43 pm

How can I load a TIFF image to a BIDIB in memory in C#? All of the LoadXXXX methods seem to only accept paths to a file... The reason I ask is because the user is going to scan a document from using TWAIN, then it may need to be maniulated further (resize, crop, etc). The resize and crop methods are in the BIDIB class and the scan acquisition is going to be done in another class. So how do I move the image data from one class to another?
seanm83854
 
Posts: 1
Joined: Mon May 11, 2009 12:37 pm

Re: Loading BIDIB Image from Memory

Postby TechnicalSupportTeam » Wed Jun 17, 2009 8:16 am

If you scan into memory using Black Ice’s BiTwain.ocx control, the BiTwain control returns with a hDib object. You 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();
}
TechnicalSupportTeam
 
Posts: 944
Joined: Sat Mar 20, 2004 11:50 am


Return to Imaging Toolkits



Who is online

Users browsing this forum: No registered users and 1 guest

cron