code_junkie

Using C#/WIA version 2.0 on Vista to Scan

Nov 10th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const string wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}";
  2. CommonDialogClass wiaDiag = new CommonDialogClass();
  3. WIA.ImageFile wiaImage = null;
  4.  
  5. wiaImage = wiaDiag.ShowAcquireImage(
  6. WiaDeviceType.UnspecifiedDeviceType,
  7. WiaImageIntent.GrayscaleIntent,
  8. WiaImageBias.MaximizeQuality,
  9. wiaFormatJPEG, true, true, false);
  10.  
  11. WIA.Vector vector = wiaImage.FileData;
  12.  
  13. Image i = Image.FromStream(new MemoryStream((byte[])vector.get_BinaryData()));
  14. i.Save(filename)
Add Comment
Please, Sign In to add comment