Esempio n. 1
0
        private void Image_Load_Click(object sender, EventArgs e)
        {
            //ImageFromFileToDatabase();

            wgDB.GetAllReferenceImages();

            ImageSelectDialog diag = new ImageSelectDialog();


            for (int i = 0; i < wgDB.m_refImageList.Count(); i++)
            {
                diag.AddImage(wgDB.m_refImageList[i].ImageData, wgDB.m_refImageList[i].Width, wgDB.m_refImageList[i].Height, "test " + i.ToString(), wgDB.m_refImageList[i].ReferenceImageID);
            }

            diag.ShowDialog();

            if (diag.result)
            {
                ReferenceImageContainer refImage;

                bool success = wgDB.GetReferenceImage(diag.databaseID, out refImage);

                if (success)
                {
                    if (m_colorModel.m_maxPixelValue != refImage.MaxPixelValue)
                    {
                        m_colorModel.SetMaxPixelValue(refImage.MaxPixelValue);
                        m_colorModel.BuildColorMap();
                    }

                    SetImage(refImage.ImageData, refImage.Width, refImage.Height);
                }
            }
        }
Esempio n. 2
0
        public void LoadReferenceImage(int refImageID)
        {
            bool success = wgDB.GetReferenceImage(refImageID, out m_refImage);

            if (success)
            {
                if (m_colorModel.m_maxPixelValue != m_refImage.MaxPixelValue)
                {
                    m_colorModel.SetMaxPixelValue(m_refImage.MaxPixelValue);
                    m_colorModel.BuildColorMap();
                }

                SetImage(m_refImage.ImageData, m_refImage.Width, m_refImage.Height);

                m_mask.Mask.ReferenceImageID = m_refImage.ReferenceImageID;
            }
        }