private void pictureBox1_Click(object sender, EventArgs e)
        {
            FormSelectCompareParam f   = new FormSelectCompareParam();
            SelectedPictureParam   pic = pictureBox1.Tag as SelectedPictureParam;

            if (pic != null)
            {
                f.InitPicture(pic.BasePicture, pic);
            }
            if (f.ShowDialog() == DialogResult.OK)
            {
                if (f.SelectedPicture != null)
                {
                    var param = f.PictureParam;
                    pictureBox1.Image = param.DemoPicture;
                    pictureBox1.Tag   = param;
                    if (param.IsBreakRegion || param.IsPassLine)
                    {
                        m_viewModel.FeatureType |= E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_PASSLINE;
                    }
                    else
                    {
                        m_viewModel.FeatureType &= ~E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_PASSLINE;
                    }

                    if (param.IsGlobalRegion)
                    {
                        m_viewModel.FeatureType |= E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_GLOBAL;
                    }
                    else
                    {
                        m_viewModel.FeatureType &= ~E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_GLOBAL;
                    }

                    if (param.IsParticalRegion)
                    {
                        m_viewModel.FeatureType |= E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_PARTICAL;
                    }
                    else
                    {
                        m_viewModel.FeatureType &= ~E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_PARTICAL;
                    }
                }
                else
                {
                    pictureBox1.Tag         = null;
                    pictureBox1.Image       = Properties.Resources.bkpng;
                    m_viewModel.FeatureType = E_SEARCH_FEATURE_TYPE.E_SEARCH_FEATURE_TYPE_STRUCTURED;
                }
            }
        }
Ejemplo n.º 2
0
        private void buttonGotoCompare_Click(object sender, EventArgs e)
        {
            Image img = ucSinglePlayWnd1.GrabPictureData(false);

            if (img != null)
            {
                FormSelectCompareParam f = new FormSelectCompareParam(true);

                f.InitPicture(img, new SelectedPictureParam());

                if (f.ShowDialog() == DialogResult.OK)
                {
                    BeginSearchInfo info = new BeginSearchInfo()
                    {
                        Image          = f.PictureParam.DemoPicture,
                        PictureParam   = f.PictureParam,
                        SearchItem     = Task.ToSearchItem(),
                        IsRealtimeTask = false,
                    };
                    if (!f.PictureParam.IsVehicle)
                    {
                        WinFormAppUtil.AppContainer.Instance.EvtAggregator.GetEvent <NavigateEvent>().Publish(
                            new Tuple <SystemMenu, object>(new SystemMenu {
                            URL = "FormPeopleSearch", Title = "行人检索", Discription = "行人检索"
                        }, info));
                    }
                    else
                    {
                        WinFormAppUtil.AppContainer.Instance.EvtAggregator.GetEvent <NavigateEvent>().Publish(
                            new Tuple <SystemMenu, object>(new SystemMenu {
                            URL = "FormVehicleSearch", Title = "车辆检索", Discription = "车辆检索"
                        }, info));
                    }
                    if (CloseThis != null)
                    {
                        CloseThis(sender, e);
                    }
                }
            }
        }