public TwCapability(TwCap cap, short sval) { Cap = (short)cap; ConType = (short)TwOn.One; Handle = Twain.GlobalAlloc(0x42, 6); IntPtr pv = Twain.GlobalLock(Handle); Marshal.WriteInt16(pv, 0, (short)TwType.Int16); Marshal.WriteInt32(pv, 2, (int)sval); Twain.GlobalUnlock(Handle); }
public DriverPicCapture() { InitializeComponent(); this.InitOnConstruct(); DriverPicCaptureConfig config = StaticCacheManager.GetConfig<DriverPicCaptureConfig>(); set = StaticCacheManager.GetConfig<CapturePhotoSet>(); if(set.BgRgbEnable) { transColor = Color.FromArgb(set.BgRgbR, set.BgRgbG, set.BgRgbB); } this.picPic.Size = new Size(set.CapWidth + 2, set.CapHeight + 2); this.Height = this.picPic.Location.Y + set.CapHeight + 40; this.txtPicPath.Text = config.PicPath; this.txtExportPath.Text = config.PicExpPath; tw = new Twain(); tw.Init(this.Handle); }