Ejemplo n.º 1
0
 /// <summary>
 /// This method fires when the x and y value has changed.
 /// </summary>
 /// <param name="e"> The point events. </param>
 protected virtual void FireXYValueChanged(PointEventArgs e)
 {
     if (this.OnXYChanged != null)
     {
         this.OnXYChanged(this, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// This method zooms into the canvas.
        /// </summary>
        /// <param name="sender"> The object sender. </param>
        /// <param name="e"> The start and end points. </param>
        public void Zoom(object sender, PointEventArgs e)
        {
            double smallX = this.smallestXValue;
            double widthY = 500D / ((double)this.BigestYValue - (double)this.SmallestYValue);
            double widthX = 600D / ((double)this.BigestXValue - (double)this.SmallestXValue);

            try
            {
                this.SmallestYValue = this.bigestYValue - (e.EndPoint.Y / widthY);
                this.SmallestXValue = this.SmallestXValue + (e.StartPoint.X / widthX);
                this.BigestYValue   = this.BigestYValue - (e.StartPoint.Y / widthY);
                this.BigestXValue   = smallX + (e.EndPoint.X / widthX);
            }
            catch (Exception)
            {
            }
        }