コード例 #1
0
ファイル: InfoShow.cs プロジェクト: Xujiayang12/peis
        private void InfoShow_Load(object sender, EventArgs e)
        {
            this.Text = p.b_name;
            label1.Text = p.getbasic();
            var pic = p.b_image;
            if (!string.IsNullOrEmpty(pic))
            {
                //直接返Base64码转成数组
                byte[] imageBytes = Convert.FromBase64String(pic);
                //读入MemoryStream对象
                MemoryStream memoryStream = new MemoryStream(imageBytes, 0, imageBytes.Length);
                memoryStream.Write(imageBytes, 0, imageBytes.Length);
                //转成图片
                Image image = Image.FromStream(memoryStream);
                //memoryStream.Close();//不要加上这一句否则就不对了
                // 将图片放置在 PictureBox 中
                this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
                this.pictureBox1.Image = image;
            }

            if (mode == 2)
            {
                propertyGrid1.Visible = false;
            }
            else if (mode == 3)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Five, Person>(p);
            }
            else if (mode == 4)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Wai, Person>(p);
            }
            else if (mode == 5)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Nei, Person>(p);
            }
            else if (mode == 6)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<Other, Person>(p);
            }
            else if (mode == 7)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<SummaryView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "填写总结";
            }else if (mode==8)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<ReCheckView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "填写审查";
            }else if (mode == 1)
            {
                propertyGrid1.SelectedObject = AllValue.Mapping<SuperView, Person>(p);
                propertyGrid1.Enabled = true;
                button1.Text = "修改";
            }
        }
コード例 #2
0
        private void InfoShow_Load(object sender, EventArgs e)
        {
            this.Text   = p.b_name;
            label1.Text = p.getbasic();
            var pic = p.b_image;

            if (!string.IsNullOrEmpty(pic))
            {
                //直接返Base64码转成数组
                byte[] imageBytes = Convert.FromBase64String(pic);
                //读入MemoryStream对象
                MemoryStream memoryStream = new MemoryStream(imageBytes, 0, imageBytes.Length);
                memoryStream.Write(imageBytes, 0, imageBytes.Length);
                //转成图片
                Image image = Image.FromStream(memoryStream);
                //memoryStream.Close();//不要加上这一句否则就不对了
                // 将图片放置在 PictureBox 中
                this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
                this.pictureBox1.Image    = image;
            }
        }