Wia mbs

I’m having trouble using MBS’s WIA scanner
having a duplex scanner I can’t get it to work and I don’t understand where I’m wrong … help would be appreciated

Does our example project compile?
Does it show the scanner?

si funziona tutto solo che non va il fronte retro , questo il vero problema

Does it show the scanner in the example project?

wiadevices

Ma si certo ma il mio problema è come catturare il foglio avanti e dietro

e mi piacerebbe avere una risposta corretta di come poter fare

sheet forward/backward?

To enable feeder, you need to set “Device Handling Document” property to 5, which is 1 for feeder + 4 for duplex.

this is example setting format property with WIAPropertyStorageMBS class:

dim p as WIAPropertyStorageMBS = it.PropertyStorage
p.Write(p.kItemPropertyFormat, p.kImageFormatBMP)

so you may need to adapt that for kScannerDevicePropertyDocumentHandlingSelect.

can have a little example complete for tio set all ??

In tranfer ho fatto cosi

dim v as Variant = List.RowTag(List.ListIndex)
if v isa WIAItemMBS then
dim it as WIAItemMBS = v

dim p as WIAPropertyStorageMBS = it.PropertyStorage
p.Write(p.kScannerDevicePropertyDocumentHandlingSelect,4)
'p.Write(p.kScannerDevicePropertyDocumentHandlingSelect,16)
p.Write(p.kItemPropertyFormat, p.kImageFormatJPEG)
p.Write(p.kItemPropertyTymed, p.kTymedFile)

dim t as WIADataTransferMBS = it.DataTransfer
if t<>Nil then

dim c as new MyWIADataCallbackMBS

dim f as FolderItem = T.GetDataFile(c)

if f=nil then
  MsgBox "Failed to get a path."
else
  'MsgBox "File saved to: "+f.AbsolutePath
  
  dim pic as Picture = Picture.Open(f)
  
  if pic=nil then
    MsgBox "Failed to load picture."
  else
    dim w as new PicWindow
    'msgbox "1"
    'Pict1.Append Pic     // in ModScan Modulo
    w.Backdrop = pic
    w.Title = f.name
    w.show
  end if
  ''label6.text = Str(PP1.Ubound)4
  
  
  
  'dim G as FolderItem = T.GetDataFile(c)
  dim pic1 as Picture = Picture.Open(f)
  
  if pic1=nil then
    MsgBox "Failed to load picture."
  else
    dim w as new PicWindow
    'msgbox "1"
    'Pict1.Append Pic1     // in ModScan Modulo
    w.Backdrop = pic1
    w.Title = f.name
    w.show
  end if
  
  
  
end if

else
MsgBox “DataTransfer object not available.”
end if
end if

ma non funziona

dove ho sbagliato ??

Have you tried the scan example?
Does our example scan at all?

What if you add the option there?

I sent you as I did, but I only read the front of the page and not the back …
. I don’t know what else to do

I may have pointed to wrong example.
Please try “List items WIA 2”. This uses WIATransferCallbackMBS and has a GetNextStream event, where you can choose name for second file path.

don’t forget to add

p.Write(p.kScannerDevicePropertyDocumentHandlingSelect, 5)

to set the item to do feeder + duplex.

Please give me example when i must put GetNextStream
how i must write it

thank tou

e.g.

EventHandler Function GetNextStream(ItemName as string, FullItemName as string) As WIAStreamMBS
	dim f as FolderItem = SpecialFolder.Desktop.Child(ItemName)
	dim s as new WIAStreamMBS(WIAStreamMBS.kModeWrite + WIAStreamMBS.kModeCreate, f)
	Return s
End EventHandler

In questo metodo cosa devo mettere per S ??

cosa è S nel metodo , una stringa o altro ??

Non Riesco mandami un esempio affinghe io possa andare avanti