Dear All,
I use following code to scan Visiting Cards, ID Cards, ATM Card etc.
VB6 Code Code:
Dim WiaCD As New wia.CommonDialog Set WiaDev = WiaCD.ShowSelectDevice(ScannerDeviceType, False, False) Dim itm As wia.item Dim ItmProp As wia.Property varDPI = 200 ' DPI varFac = 25.4 / varDPI ' Pixelfactor varArea = Array(0, 0, 3.38, 2.13) ' Scan area (mm) varMode = 4 ' 1=color 2=gray 4=b/w varBri = -10 ' Brightness varContr = 0 ' Contrast ' loop through each item/property and set parameters For Each itm In WiaDev.Items For Each ItmProp In itm.Properties Select Case ItmProp.PropertyID Case 4112 ' Pixel per Line (must be equal to 6151 ?) 'n = Int(varArea(2) / varFac + 0.5) 'ItmProp.Value = n Case 6147 ' Horizontal Resolution ItmProp.Value = varDPI Case 6148 ' Vertical Resolution ItmProp.Value = varDPI Case 6149 ' Horizontal Starting Position (in pixel?) ItmProp.Value = 0 Case 6150 ' Vertical Starting Position (in pixel?) ItmProp.Value = 0 Case 6151 ' Horizontal Extent (Scanning Area in pixel) n = CInt(varArea(2) * varDPI) ItmProp.Value = n Case 6152 ' Vertical Extent (Scanning Area in pixel) n = CInt(varArea(3) * varDPI) ItmProp.Value = n Case 6154 ' Brightness ItmProp.Value = varBri Case 6155 ' Contrast ItmProp.Value = varContr Case 6146 ' Current Intent ItmProp.Value = varMode Case 3096 ' ItmProp.Value = 0 End Select Next Next ' scanning Dim item As wia.item Set item = WiaDev.Items(1) 'the needed ITEM object = 1st scanner Dim img As wia.ImageFile Set img = item.Transfer 'transfers the image '... img.SaveFile (filename)
But I get images in black and white only. How can I get it in color.
Pls help me
Regards,
Nasreen




Reply With Quote