Example #1
0
 private void btnSendImage_Click(object sender, EventArgs e)
 {
     if (this.dlgOpenImage.ShowDialog() == DialogResult.OK)
     {
         var fi = new FileInfo(this.dlgOpenImage.FileName);
         if (fi.Length <= this._max_image_size)
         {
             var data = File.ReadAllBytes(this.dlgOpenImage.FileName);
             var ib   = new ImagesBatch(this._mc, data, this._image_part_size, Path.GetFileName(fi.FullName));
             ib.Interval   = 100;
             ib.OnDone    += new BatchSenderDone(ib_OnDone);
             ib.OnProcess += new BatchSenderProcess(ib_OnProcess);
             this.ShowImageProgressBar(true);
             this.Log.PostHead("Emulator", "Start sending image");
             ib.Start();
         }
         else
         {
             MessageBox.Show("Image is too large!");
         }
     }
 }
Example #2
0
 private void btnSendImage_Click(object sender, EventArgs e)
 {
     if (this.dlgOpenImage.ShowDialog() == DialogResult.OK)
     {
         var fi = new FileInfo(this.dlgOpenImage.FileName);
         if (fi.Length <= this._max_image_size)
         {
             var data = File.ReadAllBytes(this.dlgOpenImage.FileName);
             var ib = new ImagesBatch(this._mc, data, this._image_part_size, Path.GetFileName(fi.FullName));
             ib.Interval = 100;
             ib.OnDone += new BatchSenderDone(ib_OnDone);
             ib.OnProcess += new BatchSenderProcess(ib_OnProcess);
             this.ShowImageProgressBar(true);
             this.Log.PostHead("Emulator", "Start sending image");
             ib.Start();
         } else
             MessageBox.Show("Image is too large!");
     }
 }