Ejemplo n.º 1
0
        /// <summary>
        /// Convert a waveform quantity to a pixel distance.
        /// </summary>
        /// <param name="unit">The waveform quantity.</param>
        /// <returns>The pixel distance.</returns>
        public float UnitToPixel(double unit)
        {
            double pixel = ((unit - SeriesDim.GetUnitStart())
                            / SeriesDim.GetUnitRange() - ViewStartFactor) / ZoomFactor;

            if (DisplayInversion)
            {
                pixel = 1 - pixel;
            }
            return((float)(pixel * PanelPixels.X));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Convert a pixel distance to a waveform quantity.
        /// </summary>
        /// <param name="pixel">The pixel distance.</param>
        /// <returns>The waveform quantity.</returns>
        public double PixelToUnit(float pixel)
        {
            pixel /= PanelPixels.X;
            if (DisplayInversion)
            {
                pixel = 1 - pixel;
            }
            double unit = SeriesDim.GetUnitStart() + SeriesDim.GetUnitRange() *
                          (ViewStartFactor + pixel * ZoomFactor);

            return(unit);
        }