(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">&lt;<a href="mailto:ait@p2ee.org">ait@p2ee.org</a>&gt;</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>
&lt;<a href="mailto:christoofar@gmail.com">christoofar@gmail.com</a>&gt; wrote:<br>
&gt; Hello<br>
&gt;<br>
&gt; I had been looking for a long time for a Mono binding for SANE but most of<br>
&gt; my efforts have been fruitless (probably because none exist! :-)  so I<br>
&gt; started writing my own.<br>
&gt;<br>
&gt; If anybody wants to help me, I put the source here:<br>
&gt; <a href="http://code.google.com/p/mono-sane/" target="_blank">http://code.google.com/p/mono-sane/</a><br>
&gt;<br>
&gt; The code is capable of reading the scanner list from scanimage, interpreting<br>
&gt; the configuration options, performing a one-pass scan with or without<br>
&gt; scanimage options.<br>
&gt;<br>
&gt; It shells out to scanimage and collects its output from there.  I&#39;m<br>
&gt; expanding it as I go along since I&#39;m using it to experiment with forms<br>
&gt; recognition.  I&#39;m working on ADF, thread-safety, delegate callbacks for<br>
&gt; asynchronous scanning right now and hope to finish it soon.<br>
&gt;<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&#39;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>
&gt; --<br>
&gt; sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
&gt; <a href="http://lists.alioth.debian.org/mailman/listinfo/sane-devel" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/sane-devel</a><br>
&gt; Unsubscribe: Send mail with subject &quot;unsubscribe your_password&quot;<br>
&gt;             to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
&gt;<br>
</blockquote></div><br>