Binary&Color
Binary&Color
Hi,
I have a Scanner that supports Binary & Color. Need to Scan Color & Binary at a Time. That is to create 2 images.
There any way to do this?
Thank you very much
I have a Scanner that supports Binary & Color. Need to Scan Color & Binary at a Time. That is to create 2 images.
There any way to do this?
Thank you very much
Re: Binary&Color
Hi,
Yes you can: just acquire your image in color mode, make a clone of the color image and convert it to bitonal.
Let me know if you need a code sample for this.
With best regards,
Loïc
Yes you can: just acquire your image in color mode, make a clone of the color image and convert it to bitonal.
Let me know if you need a code sample for this.
With best regards,
Loïc
Re: Binary&Color
Thanks Loic, an example would be nice, thank you very much
Re: Binary&Color
Hi Loïc,
Please send me one code example when you have time.
Thanks,
Please send me one code example when you have time.
Thanks,
Re: Binary&Color
Hi,
Sorry for the delay. Here a basic sample to scan all content of a document feeder to color (jpg) and binary (tiff) images:
Let me know if you need more assistance.
Kind regards,
Loïc
Sorry for the delay. Here a basic sample to scan all content of a document feeder to color (jpg) and binary (tiff) images:
Code: Select all
Dim nImageCount As Integer
Dim ImageID As Integer
If oGdPictureImaging.TwainOpenDefaultSource(Me.Handle) Then
nImageCount = 0
oGdPictureImaging.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
oGdPictureImaging.TwainSetAutoScan(True) 'To achieve the maximum scanning rate
oGdPictureImaging.TwainSetResolution(300)
oGdPictureImaging.TwainSetPixelType(TwainPixelType.TWPT_RGB) 'RGB
oGdPictureImaging.TwainSetBitDepth(8) ' 24 bpp 8 bit per pixel
Do
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
nImageCount = nImageCount + 1
Call oGdPictureImaging.SaveAsJPEG(ImageID, My.Application.Info.DirectoryPath & "\image" & Trim(Str(nImageCount)) & ".jpg", 75)
oGdPictureImaging.ConvertTo1Bpp(ImageID)
Call oGdPictureImaging.SaveAsTIFF(ImageID, My.Application.Info.DirectoryPath & "\image" & Trim(Str(nImageCount)) & ".tif", TiffCompression.TiffCompressionCCITT4)
Call oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
Loop While oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
Call oGdPictureImaging.TwainCloseSource()
MsgBox("Done !")
Else
MsgBox("can't open default source, twain state is: " & oGdPictureImaging.TwainGetState.ToString)
End If
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest