Hi,
use the article :
.NET TWAIN image scanner[
^]
and in the file GdiPlusLib.cs you can add the following method:
public static bool SaveDIB(IntPtr bminfo, IntPtr pixdat )
{
string FileName = "C:\\Test.bmp";
Guid clsid;
if (!GetCodecClsid(FileName, out clsid))
{
MessageBox.Show("Unknown picture format for extension " + Path.GetExtension(FileName), "Image Codec", MessageBoxButtons.OK, MessageBoxIcon.Information );
return false;
}
IntPtr img = IntPtr.Zero;
int st = GdipCreateBitmapFromGdiDib( bminfo, pixdat, ref img );
if( (st != 0) || (img == IntPtr.Zero) )
return false;
st = GdipSaveImageToFile(img, FileName, ref clsid, IntPtr.Zero);
GdipDisposeImage( img );
return st == 0;
}
Calling this method will save the image to the hardcoded file C:\Test.bmp. You can modify this code to fit your needs.