Beispiel #1
0
        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            FxImage fx_img;
            String  pic_name;

            int fx_index = e.ProgressPercentage;

            fx_img   = m_img_list.GetFxImage(fx_index + 1);
            pic_name = fx_img.IMAGE_NAME;
            m_fs_pic_list[fx_index].Load(pic_name);

            m_fs_label_param_list[fx_index].Text = String.Format("x: {0}, y: {1}", fx_img.FX_X, fx_img.FX_Y);

            if (fx_img.FIRST_FLAG || fx_img.LAST_FLAG || fx_img.STUDY_FLAG)
            {
                m_fs_label_param_list[fx_index].ForeColor = Color.Red;
                m_fs_label_param_list[fx_index].BringToFront();
                m_fs_label_param_list[fx_index].Visible = true;
            }
            else
            {
                m_fs_label_param_list[fx_index].Visible = false;
            }


            /*
             * int row = e.ProgressPercentage;
             * int fx_index = 0;
             * for (int i = 0; i < m_fs_pic_col; i++)
             * {
             *  fx_index = i  + (row - 1) * m_fs_pic_col;
             *  fx_img = m_img_list.GetFxImage(fx_index + 1);
             *  pic_name = fx_img.IMAGE_NAME;
             *  m_fs_pic_list[fx_index].Load(pic_name);
             *
             *  m_fs_label_param_list[fx_index].Text = String.Format("x: {0}, y: {1}", fx_img.FX_X, fx_img.FX_Y);
             *
             *  if (fx_img.FIRST_FLAG || fx_img.LAST_FLAG || fx_img.STUDY_FLAG)
             *  {
             *      m_fs_label_param_list[fx_index].ForeColor = Color.Red;
             *      m_fs_label_param_list[fx_index].BringToFront();
             *      m_fs_label_param_list[fx_index].Visible = true;
             *  }
             *  else
             *  {
             *      m_fs_label_param_list[fx_index].Visible = false;
             *  }
             * }
             */
        }
Beispiel #2
0
        /**
         * 载入图片,根据页面调整图片,每页20张图片,起始页图片编号001-020,第二页 021-040,依次类推
         * 每页图片编号开始001+ (page_num-1)*20,结尾020 + (page_num-1) * 20
         * */
        public void LoadFxPicture(int page_num)
        {
            int pic_box_num = m_pic_col * m_pic_row;//PictureBox控件数量

            //初始化所有图片框背景色
            for (int i = 1; i <= pic_box_num; i++)
            {
                m_pic_list[i - 1].BackColor = Color.Transparent;
            }

            InitPictureBox();

            //
            for (int i = 1; i <= pic_box_num; i++)
            {
                FxImage fx_img = m_img_list.GetFxImage(i + (page_num - 1) * pic_box_num);

                String pic_name = fx_img.IMAGE_NAME;
                m_pic_list[i - 1].Load(pic_name);
                m_pic_list[i - 1].Show();

                //选手学过的图片高亮显示
                if (fx_img.STUDY_FLAG == true)
                {
                    m_pic_list[i - 1].BackColor       = Color.Green;
                    m_label_fx_param_list[i - 1].Text = String.Format("x: {0}, y: {1}", fx_img.FX_X, fx_img.FX_Y);
                }
                else
                {
                    m_pic_list[i - 1].BackColor       = Color.Transparent;
                    m_label_fx_param_list[i - 1].Text = "";
                }

                m_label_fx_seq_list[i - 1].Text = fx_img.SEQ_NUM.ToString();
            }

            /*
             * String pic1_name = String.Format("{0}{1}{2}", m_pic_dir, page_num.ToString("D3"), ".jpg");
             *
             * pictureBox1.Load(m_pic_dir + "001.jpg");
             * pictureBox1.Show();
             *
             */
        }