Пример #1
0
        /// <summary>
        /// Gets amplitude in the provided point
        /// </summary>
        /// <param name="file">File to get amplitude from</param>
        /// <param name="p">Point to get amplitude at</param>
        /// <returns></returns>
        public virtual bool Analyze(RlViewer.Files.LocatorFile file, System.Drawing.Point location)
        {
            bool hasLocationChanged = false;
            if (_isMouseDown)
            {
                if (location.X >= 0 && location.X < file.Width && location.Y >= 0 && location.Y < file.Height)
                {
                    if (_currentLocation != location)
                    {
                        _currentLocation = location;
                        hasLocationChanged = true;

                        try
                        {
                            Amplitude = file.GetSample(location).ToFileSample(file.Properties.Type, file.Header.BytesPerSample);
                        }
                        catch (Exception)
                        {
                            _isMouseDown = false;
                            throw;
                        }
                    }
                }
            }

            return hasLocationChanged;
        }
Пример #2
0
        public override IEnumerable<PointF> GetValues(RlViewer.Files.LocatorFile file, Point p1)
        {
            var coordPairList = new List<PointF>();

            for (int i = p1.X - SectionLength / 2; i < p1.X + SectionLength / 2; i++)
            {
                if (i < 0 || i >= file.Width || p1.Y < 0 || p1.Y >= file.Height) continue;

                try
                { 
                    coordPairList.Add(new PointF(i, file.GetSample(new Point(i, p1.Y)).ToFileSample(file.Properties.Type, file.Header.BytesPerSample)));
                }
                catch(Exception)
                {
                    throw;
                }
            }

            return coordPairList;
        }
Пример #3
0
 public SelectedPoint(RlViewer.Files.LocatorFile file, Point location)
 {      
     _location = location;
     _value = file.GetSample(location).ToFileSample(file.Properties.Type, file.Header.BytesPerSample);
 }