コード例 #1
0
ファイル: ImageControl.cs プロジェクト: isliulin/MPR
        internal void InitScrollBarAndLoadImage()
        {
            this.scrollBar.Maximum     = m_UIInterface.GetNumberOfImages((int)this.m_axis);
            this.scrollBar.Minimum     = 0;
            this.scrollBar.SmallChange = 1;
            this.scrollBar.LargeChange = 1;
            ScrollBarCurrentVal        = this.scrollBar.Value = m_UIInterface.GetCurrentImageIndex((int)this.m_axis);

            // Init scroll bar event
            this.scrollBar.ValueChanged += scrollBar_ValueChanged;


            // ORIENTATION MARKERS
            OrientationMarkerLeft   = m_UIInterface.GetOrientationMarkerLeft((int)this.m_axis);
            OrientationMarkerRight  = m_UIInterface.GetOrientationMarkerRight((int)this.m_axis);
            OrientationMarkerTop    = m_UIInterface.GetOrientationMarkerTop((int)this.m_axis);
            OrientationMarkerBottom = m_UIInterface.GetOrientationMarkerBottom((int)this.m_axis);
            LoadImage();

            // PIXEL SPACING
            double[] _pixelSpacing = { 0, 0, 0 };
            unsafe
            {
                fixed(double *resPtr = _pixelSpacing)
                {
                    m_UIInterface.GetPixelSpacing((int)this.m_axis, resPtr);
                }
            }
            this.m_imagePanel.XPixelSpacing = _pixelSpacing[0];
            this.m_imagePanel.YPixelSpacing = _pixelSpacing[1];
            // UpdateCursorPosition();
        }
コード例 #2
0
        internal void InitScrollBar()
        {
            if (!m_scrollbarInit)
            {
                MPR_UI_Interface.WriteLog("Initializing scroll bar");
                this.scrollBar.Maximum     = m_UIInterface.GetNumberOfImages((int)this.m_axis);
                this.scrollBar.Minimum     = 0;
                this.scrollBar.SmallChange = 1;
                this.scrollBar.LargeChange = 1;
                ScrollBarCurrentVal        = this.scrollBar.Value = m_UIInterface.GetCurrentImageIndex((int)this.m_axis);

                // Init scroll bar event
                this.scrollBar.ValueChanged += scrollBar_ValueChanged;


                // ORIENTATION MARKERS
                OrientationMarkerLeft   = m_UIInterface.GetOrientationMarkerLeft((int)this.m_axis);
                OrientationMarkerRight  = m_UIInterface.GetOrientationMarkerRight((int)this.m_axis);
                OrientationMarkerTop    = m_UIInterface.GetOrientationMarkerTop((int)this.m_axis);
                OrientationMarkerBottom = m_UIInterface.GetOrientationMarkerBottom((int)this.m_axis);

                this.m_UIInterface.RaiseSlicerPositionUpdate((int)this.m_axis);
                m_scrollbarInit = true;
            }
        }