public static void AddBmpInAvi(Image bmp) { using (Bitmap b = ScreenModel.GetPicThumbnail(bmp, 100).ToBitmap()) { writer.WriteVideoFrame(b); } }
public static void AddBmpInAvi(Image bmp) { using (Bitmap b = ScreenModel.GetPicThumbnail(bmp, 80).ToBitmap()) { b.SetPixel(0, 0, Color.Red); avi.AddFrame(b); } }
private void Form1_Load(object sender, EventArgs e) { List <KeyValuePair <object, Screen> > kvalue = new List <KeyValuePair <object, Screen> >(); foreach (var i in ScreenModel.GetAllScreen()) { kvalue.Add(new KeyValuePair <object, Screen>(i.DeviceName, i)); } comboBox1.DataSource = kvalue; comboBox1.DisplayMember = "Key"; comboBox1.ValueMember = "Value"; this.timer = new Timer(); this.timer.Interval = 1000; this.timer.Tick += Timer_Tick; }
private void Time_Tick(object sender, EventArgs e) { Graphics gs = this.CreateGraphics(); this.OnPaint(new PaintEventArgs(gs, new Rectangle())); Image result = ScreenModel.GetScreenBitmap((Screen)comboBox1.SelectedValue); if (isRecord) { if (AccordRecord) { AccordModel.AddBmpInAvi((Image)result.Clone()); } if (AForgeRecord) { AForgeModel.AddBmpInAvi((Image)result.Clone()); } } Image img = ScreenModel.GetPicThumbnail(result, 50, this.panel1.Height, this.panel1.Width); gs.DrawImage(img, panel1.Location); }