Exemplo n.º 1
0
 public void DragCallback(DragCallback callback)
 {
     switch (callback.Type) {
     case DragCallbackType.Image:
       UploadImage(callback.Image);
       break;
       }
 }
Exemplo n.º 2
0
        public void DragCallback(DragCallback callback)
        {
            switch (callback.Type) {
                case DragCallbackType.Image:
                    UploadImage(callback.Image);
                    break;

                case DragCallbackType.Animation:
                    MessageBox.Show("Snaggy doesn't support gif animations.");
                    break;
            }
        }
Exemplo n.º 3
0
        public void DragCallback(DragCallback callback)
        {
            switch (callback.Type) {
            case DragCallbackType.Image:
              UploadImage(callback.Image, callback.CustomFilename);
              break;

            case DragCallbackType.Animation:
              UploadAnimation(callback.Animation, callback.CustomFilename);
              break;
              }
        }
Exemplo n.º 4
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            this.timerFrame.Enabled = false;

            this.Hide();
            this.animBox.Hide();

            DragCallback callback = new DragCallback()
            {
                Type = DragCallbackType.Animation, Animation = new MemoryStream()
            };

            AnimatedGifEncoder encoder = new AnimatedGifEncoder();

            encoder.Start(callback.Animation);
            encoder.SetDelay(this.timerFrame.Interval);
            encoder.SetRepeat(0);

            this.addon.ProgressBar.Start("Encoding Gif", this.frames.Count, false);

            for (int i = 0; i < this.frames.Count; i++)
            {
                if (this.addon.ProgressBar.Canceled)
                {
                    this.Close();
                    return;
                }

                encoder.AddFrame(this.frames[i]);
                this.addon.ProgressBar.Set(i);
            }

            encoder.Finish();

            this.addon.ProgressBar.Done();

            this.doneDragging(callback);
            this.Close();
        }
Exemplo n.º 5
0
 public void DragCallbackSecondary(DragCallback callback)
 {
     callback.CustomFilename = true;
       DragCallback(callback);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Function referenced as the callback function for dragging a screesnhot
        /// and animation.
        /// </summary>
        void DragFinished(DragCallback cb)
        {
            if (cb.Type == DragCallbackType.Animation) {
            //TODO: Do something with cb.Animation (System.IO.MemoryStream)

            Uploaded("Image", "http://example.com/image.gif", "Dragged animation");

              } else if (cb.Type == DragCallbackType.Image) {
            //TODO: Do something with cb.Image (System.Drawing.Image)

            Uploaded("Image", "http://example.com/image.png", "Dragged image");

              }
        }
Exemplo n.º 7
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            this.timerFrame.Enabled = false;

            this.Hide();
            this.animBox.Hide();

            DragCallback callback = new DragCallback() { Type = DragCallbackType.Animation, Animation = new MemoryStream() };

            AnimatedGifEncoder encoder = new AnimatedGifEncoder();
            encoder.Start(callback.Animation);
            encoder.SetDelay(this.timerFrame.Interval);
            encoder.SetRepeat(0);

            this.addon.ProgressBar.Start("Encoding Gif", this.frames.Count, false);

            for(int i = 0; i < this.frames.Count; i++) {
                if(this.addon.ProgressBar.Canceled) {
                    this.Close();
                    return;
                }

                encoder.AddFrame(this.frames[i]);
                this.addon.ProgressBar.Set(i);
            }

            encoder.Finish();

            this.addon.ProgressBar.Done();

            this.doneDragging(callback);
            this.Close();
        }