List Info

Thread: C-Sharp (C#) Group: Receiving TWAIN images




C-Sharp (C#) Group: Receiving TWAIN images
user name
2006-10-17 15:09:35
Yo; I'm working on a custom automated TWAIN scanning
solution, and am
trying to use the simple API found here:
ht
tp://www.codeproject.com/dotnet/twaindotnet.asp.

Behold my code:

case TwainCommand.TransferReady:
                    {
                        ArrayList pics =
incoming.TransferPictures();
                        EndingScan();
                        incoming.CloseSrc();
                        picnumber++;
                        for (int i = 0; i < pics.Count;
i++)
                        {
                            IntPtr img = (IntPtr)pics[i];
                            //Dunno what to do here

                        }
                        break;
                    }

(There's more context, based around the structure in the
sample app at
the above link)

>From what I gather, the scanned page should be available
in img.  But
how would I get that out of the IntPtr and into something
more useful
like a picture box (And presumably into a file later on
using MODI).

I have no clue what I'm doing (Though I do have some
elemntary C#
experience) -- but once I'm past this I should be able to
figure out
the rest from Google (Like how to use MODI for starters). 
Any help
would be greatly appreciated.

SigmaX


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups-beta.google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

C-Sharp (C#) Group: Re: Receiving TWAIN images
user name
2006-10-17 15:24:06
I've used this lib, should have come with some GDI+ code and
maybe some code
for converting from a dib to an image stream, if not let me
know and I'll
send it.

Example:

IntPtr bmpptr = Gdip.GlobalLock(dibReturnedFromScan);
Bitmap b = DibToImage.WithStream(bmpptr);
Gdip.GlobalFree(bmpptr);


From there you can use the Bitmap object however you need,
with an image
control or whatever supports ImageStream based objects.

HTH,
J.P.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups-beta.google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )