Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Posts
    61

    Thumbs down Unanswered: 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 ...

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    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? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •