Esempio n. 1
0
        void GetTargetEvent(TargetImg obj)
        {
            if (obj != null)
            {
                //TODO:

                Image i = Image.FromFile(obj.FilePath);
                PicBox_TargetImg.Image = i;
                PicBox_TargetImg.SizeMode = PictureBoxSizeMode.Zoom;
                lable_TargetName.Text = obj.TargetName;
            }
        }
Esempio n. 2
0
        private static void LoadTargetList()
        {
            //加载靶标
            DirectoryInfo dir = new DirectoryInfo(Global.TargetImagesPath + "Targets\\");
            FileInfo[] files = dir.GetFiles("*.png");
            if (files.Length > 0)
            {
                TargetImgList = new List<TargetImg>();//创建
                foreach (FileInfo file in files)
                {
                    TargetImg targetimg = new TargetImg();
                    targetimg.TargetName = file.Name.Split('.')[0];
                    targetimg.FilePath = file.FullName.ToString();

                    TargetImgList.Add(targetimg);
                }
            }
            else
            {
                throw new Exception("There is no Targets!");
            }
        }