Dear Developers,
I Have found Code to scan
Code:
Dim _filename As String = "Image"
Dim JpgFilename As String = path1.Text & _filename & Format(Now, "ddmmyyyyhhmmss") & ".jpg"
Dim BmpFilename As String = path1.Text & _filename & Format(Now, "ddmmyyyyhhmmss")
Try
Dim ask = MsgBox("Your File Will be Saved at " & path1.Text, MsgBoxStyle.OkCancel, "Save File")
If ask = MsgBoxResult.Cancel Then Exit Sub
Dim Dialog As New Wia.CommonDialog
Dim _ImageFile As New ImageFile
Dim _FileExtension As String = "."
Dim itmX As Integer = 1
For ItemX = 1 To 1
_ImageFile = Dialog.ShowAcquireImage(WiaDeviceType.ScannerDeviceType, WiaImageIntent.ColorIntent, WiaImageBias.MaximizeQuality, , False, True, True)
_FileExtension = _ImageFile.FileExtension
BmpFilename &= "." & _FileExtension
_ImageFile.SaveFile(BmpFilename)
Dim ScannedImage As Image = Image.FromFile(BmpFilename)
ScannedImage.Save(JpgFilename, System.Drawing.Imaging.ImageFormat.Jpeg)
ScannedImage.Dispose()
ScannedImage = Nothing
Application.DoEvents()
Dialog = Nothing
_ImageFile = Nothing
With PictureBox1
.BackgroundImage = Image.FromFile(JpgFilename)
.Tag = JpgFilename
End With
path2.Text = JpgFilename
My.Computer.FileSystem.DeleteFile(BmpFilename)
Next
Catch ex As Exception
'MsgBox(ex.ToString)
End Try
I need To Do loop coz i have document Feeder so users can scan More Than One documents
Can any One Help