AnimatGuiCtrls.Controls.TimeRuler.PixelToScaleValue C# (CSharp) 메소드

PixelToScaleValue() 공개 메소드

public PixelToScaleValue ( int iOffset ) : double
iOffset int
리턴 double
		public double PixelToScaleValue(int iOffset)
		{
			return this.CalculateMillisecondValue(iOffset);
		}

Usage Example

        public override void EndMove(System.Windows.Forms.MouseEventArgs e, TimeRuler ruler)
        {
            int iMousePosition = ((ruler.Orientation == enumOrientation.orHorizontal) ? e.X : e.Y);
            long lNewMillisecond = (long) ruler.PixelToScaleValue(iMousePosition);

            KeyFrame keyClosest = ruler.KeyFrames.FindClosest(KeyFrame.enumKeyFrameType.Snapshot, lNewMillisecond, true);

            //If we can not find a single frame close to the current end position that is within the current time zone then move
            //it back to the currenttime. Otherwise move it to the closest key frame.
            if(keyClosest != null)
            {
                SetTimes(keyClosest.StartMillisecond);
                ruler.CurrentMillisecond = keyClosest.StartMillisecond;
                ruler.OnCurrentFrameMoved(keyClosest);
            }
            else
            {
                SetTimes(ruler.ActualMillisecond);
                ruler.CurrentMillisecond = ruler.ActualMillisecond;
                ruler.OnCurrentFrameMoved(null);
            }

            ruler.RedrawBitmap();
        }
All Usage Examples Of AnimatGuiCtrls.Controls.TimeRuler::PixelToScaleValue