void OnScanWorksImageTransfer(object s, ImageTransferEventArgs arg) { TreeIter iter; progresswork.Text = "Завершаем загрузку..."; MainClass.WaitRedraw(); logger.Debug("ImageTransfer event"); iter = ImageListNewDoc(); Pixbuf image = arg.Image; double ratio = 150f / Math.Max(image.Height, image.Width); Pixbuf thumb = image.ScaleSimple((int)(image.Width * ratio), (int)(image.Height * ratio), InterpType.Bilinear); ImageList.AppendValues(iter, 0, null, null, null, thumb, image, true, "", ""); progresswork.Text = "Ок"; progresswork.Adjustment.Value = progresswork.Adjustment.Upper; MainClass.WaitRedraw(); }
void OnScanerImageTransfer(object sender, ImageTransferEventArgs e) { progressScan.Text = "Завершаем загрузку..."; logger.Debug("ImageTransfer event"); vimageslist1.Images.Add(e.Image); progressScan.Text = "Ок"; progressScan.Adjustment.Value = progressScan.Adjustment.Upper; QSMain.WaitRedraw(); }
private void SetupTwain() { _twain32 = new Twain32 (); _twain32.OpenDSM(); _twain32.AcquireCompleted+=(object sender,EventArgs e) => { TotalImages = _twain32.ImageCount; for(int i = 0; i < _twain32.ImageCount; i++) { Pixbuf CurImg = WinImageToPixbuf(_twain32.GetImage(i)); if(ImageTransfer == null) {// Записываем во внутренний массив Images.Add(CurImg); } else {// Передаем через событие ImageTransferEventArgs arg = new ImageTransferEventArgs(); arg.AllImages = TotalImages; arg.Image = CurImg; ImageTransfer(this, arg); } } Console.WriteLine("DataTransferred"); }; }