(copy to list)<br><br>Yes the STDIN/STDOUT is pretty kludgy way of
interfacing to SANE, but it was quick and dirty. Now that I have the
core objects written like I want them, I can now go back and figure out
how to glue it up using a direct binding.<br>
<br>Actually I think what most Mono programmers do is write a C binding
system object lib that uses simple data types and then write a .NET
object which uses [DllImport] P/Invoke directive on the methods to
redirect the calls on the object to the library.<br>
<br><br>What I need to do now is read the scanimage source code and
understand how it works so I can understand the headers and write the
.NET proxy class and the lib glue code (no small task!) :-)<br><br><div class="gmail_quote">On Sun, Apr 4, 2010 at 9:16 PM, Alejandro Imass <span dir="ltr"><<a href="mailto:ait@p2ee.org">ait@p2ee.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Sun, Apr 4, 2010 at 12:55 PM, Christopher Sawyer<br>
<<a href="mailto:christoofar@gmail.com">christoofar@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> I had been looking for a long time for a Mono binding for SANE but most of<br>
> my efforts have been fruitless (probably because none exist! :-) so I<br>
> started writing my own.<br>
><br>
> If anybody wants to help me, I put the source here:<br>
> <a href="http://code.google.com/p/mono-sane/" target="_blank">http://code.google.com/p/mono-sane/</a><br>
><br>
> The code is capable of reading the scanner list from scanimage, interpreting<br>
> the configuration options, performing a one-pass scan with or without<br>
> scanimage options.<br>
><br>
> It shells out to scanimage and collects its output from there. I'm<br>
> expanding it as I go along since I'm using it to experiment with forms<br>
> recognition. I'm working on ADF, thread-safety, delegate callbacks for<br>
> asynchronous scanning right now and hope to finish it soon.<br>
><br>
<br>
</div></div>Dunno much about Mono but you should be using the SANE API directly.<br>
It has of course native binding to C, but surely there must be a way<br>
of loading shared objects and static C libraries from Mono/C#. For<br>
example in Perl it's called XS, a language/API that helps glue C code<br>
to Perl, there surely must be something for C#., I think you should be<br>
looking into that, rather than a STDIN/STDOUT interface with<br>
scanimage. Just did a quick google search came up with this:<br>
<br>
<a href="http://www.mono-project.com/Interop_with_Native_Libraries" target="_blank">http://www.mono-project.com/Interop_with_Native_Libraries</a><br>
<br>
Cheers,<br>
Alejandro Imass<br>
<br>
> --<br>
> sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
> <a href="http://lists.alioth.debian.org/mailman/listinfo/sane-devel" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/sane-devel</a><br>
> Unsubscribe: Send mail with subject "unsubscribe your_password"<br>
> to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
><br>
</blockquote></div><br>