예제 #1
0
        public ArrayList TransferPictures()
        {
            ArrayList pics = new ArrayList();

            if (srcds.Id == IntPtr.Zero)
            {
                return(pics);
            }

            TwRC           rc;
            IntPtr         hbitmap = IntPtr.Zero;
            TwPendingXfers pxfr    = new TwPendingXfers();

            do
            {
                pxfr.Count = 0;
                hbitmap    = IntPtr.Zero;

                TwImageInfo iinf = new TwImageInfo();
                rc = DSiinf(appid, srcds, TwDG.Image, TwDAT.ImageInfo, TwMSG.Get, iinf);
                if (rc != TwRC.Success)
                {
                    CloseSrc();
                    return(pics);
                }

                rc = DSixfer(appid, srcds, TwDG.Image, TwDAT.ImageNativeXfer, TwMSG.Get, ref hbitmap);
                if (rc != TwRC.XferDone)
                {
                    CloseSrc();
                    return(pics);
                }

                rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers, TwMSG.EndXfer, pxfr);
                if (rc != TwRC.Success)
                {
                    CloseSrc();
                    return(pics);
                }

                pics.Add(hbitmap);
            }while (pxfr.Count != 0);

            rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers, TwMSG.Reset, pxfr);
            return(pics);
        }
예제 #2
0
 internal static extern TwRC DSpxfer([In, Out] TwIdentity origin, [In] TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, [In, Out] TwPendingXfers pxfr);
예제 #3
0
 private TwRC DSpxfer(TwIdentity origin, TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, TwPendingXfers pxfr)
 {
     if (IntPtr.Size == 8)
     {
         return(Twain64.DSpxfer(origin, dest, dg, dat, msg, pxfr));
     }
     else
     {
         return(Twain32.DSpxfer(origin, dest, dg, dat, msg, pxfr));
     }
 }