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); }
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; }
private static extern TwRC DSiinf([In, Out] TwIdentity origin, [In] TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, [In, Out] TwImageInfo imginf);