If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Argent Help in wia2 i need loop

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-11, 08:21
Sam76 Sam76 is offline
Registered User
 
Join Date: Jun 2005
Posts: 61
Thumbs down Argent Help in wia2 i need loop

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
__________________
Sami Al Damiri ...
Reply With Quote
  #2 (permalink)  
Old 07-21-11, 11:21
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Now would be a good time to find a rudimentary tutorial on basic VB control structures.


It's a common topic, here's a million or so places to look:

visual basic looping - Google Search
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On