Beispiel #1
0
        public RunImager()
        {
            InitializeComponent();

            m_imager = null;

            VM = new VM_RunImager("Ready");

            this.DataContext = VM;

            m_range = new RangeClass();

            wgDB = new WaveguideDB();

            m_histogram = new Histogram();

            bool success = wgDB.GetDefaultColorModel(out m_colorModel, GlobalVars.MaxPixelValue, 1024);

            if (!success)
            {
                // setup default color model
                m_colorModel = new ColorModel("Default");
                m_colorModel.InsertColorStop(0, 0, 0, 0);
                m_colorModel.InsertColorStop(1023, 255, 255, 255);
            }

            // make sure that control points 1 and 2 match up with the thumb controls
            // on the slider
            m_colorModel.m_controlPts[1].m_value      = 0;
            m_colorModel.m_controlPts[1].m_colorIndex = 0;
            m_colorModel.m_controlPts[2].m_value      = GlobalVars.MaxPixelValue;
            m_colorModel.m_controlPts[2].m_colorIndex = 1023;

            m_colorModel.BuildColorGradient();
            m_colorModel.BuildColorMap();


            RangeSlider.DataContext = m_range;
            m_range.RangeMin        = 0;
            m_range.RangeMax        = 100;

            HistogramImage.Source = m_histogram.GetHistogramBitmap();
        }