Пример #1
0
        private void Img_MouseMove(object sender, MouseEventArgs e)
        {
            Image img = sender as Image;

            if (img != null)
            {
                m_statusBarItems.ImageWidth  = L3.Cargo.Common.Resources.Width_Colon + " " + img.Source.Width.ToString();
                m_statusBarItems.ImageHeight = L3.Cargo.Common.Resources.Height_Colon + " " + img.Source.Height.ToString();
                m_statusBarItems.ZoomFactor  = L3.Cargo.Common.Resources.Zoom_Colon + " " + MainXRayView.PanAndZoomViewer.CurrentZoom.ToString("F");

                Size imgSize    = new Size((double)img.ActualWidth, (double)img.ActualHeight);
                Size sourceSize = new Size(img.Source.Width, img.Source.Height);

                Point pt = GetCursorPosition(imgSize, sourceSize, e.GetPosition(img));

                m_statusBarItems.ImageCursorCoordX = "Z val(mm) = " + Math.Round(pt.X * Conversion.SamplingSpace, 0).ToString();
                m_statusBarItems.ImageCursorCoordY = " Θ" + "1 (deg) = " + Math.Round(Conversion.ConvertY2Theta(pt.Y, img.ActualHeight), 0).ToString();

                InvalidateVisual();
            }
        }