Exemplo n.º 1
0
 public static void AddBmpInAvi(Image bmp)
 {
     using (Bitmap b = ScreenModel.GetPicThumbnail(bmp, 100).ToBitmap())
     {
         writer.WriteVideoFrame(b);
     }
 }
Exemplo n.º 2
0
 public static void AddBmpInAvi(Image bmp)
 {
     using (Bitmap b = ScreenModel.GetPicThumbnail(bmp, 80).ToBitmap())
     {
         b.SetPixel(0, 0, Color.Red);
         avi.AddFrame(b);
     }
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
        }