public GifImage(KpImageViewer KpViewer, Image img) { this.KpViewer = KpViewer; this.gif = img; this.dimension = new FrameDimension(gif.FrameDimensionsList[0]); this.frameCount = gif.GetFrameCount(dimension); this.gif.SelectActiveFrame(dimension, 0); this.currentFrameBmp = (Bitmap)gif.Clone(); UpdateAnimator(); }
public KP_DrawObject(KpImageViewer KpViewer) { try { this.KpViewer = KpViewer; // Initial dragging to false and No image. dragging = false; this.bmp = null; } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("ImageViewer error: " + ex.ToString()); } }
public KP_DrawObject(KpImageViewer KpViewer, Bitmap bmp) { try { this.KpViewer = KpViewer; // Initial dragging to false and an Image. dragging = false; this.Image = bmp; this.Image.RotateFlip(RotateFlipType.RotateNoneFlipNone); boundingRect = new Rectangle(0, 0, (int)(this.ImageWidth * zoom), (int)(this.ImageHeight * zoom)); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("ImageViewer error: " + ex.ToString()); } }
public GifImage(KpImageViewer KpViewer, Image img, bool animation, double fps) { this.updating = true; this.KpViewer = KpViewer; this.gif = img; this.dimension = new FrameDimension(gif.FrameDimensionsList[0]); this.frameCount = gif.GetFrameCount(dimension); this.gif.SelectActiveFrame(dimension, 0); this.currentFrame = 0; this.animationEnabled = animation; this.timer = new Timer(); this.updating = false; framesPerSecond = 1000.0 / fps; // 15 FPS this.timer.Enabled = this.animationEnabled; this.timer.Interval = framesPerSecond; this.timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); this.currentFrameBmp = (Bitmap)gif; this.currentFrameSize = new Size(currentFrameBmp.Size.Width, currentFrameBmp.Size.Height); }
public void SetParent(KpImageViewer viewer) { imgViewer = viewer; }