/// <summary> /// 加载图像至左侧区域(无底部说明文字) /// </summary> /// <param name="Pic">传入图像</param> private void LoadPicOnLeft(Bitmap Pic) { DrawPic Temp = new DrawPic(); if ((Pic.Width < 200 && Pic.Height < 150) || (Pic.Width < 150 && Pic.Height < 200)) { Temp.pictureBox1.Width = Pic.Width; Temp.pictureBox1.Height = Pic.Height; Temp.Height = Pic.Height + 12; Temp.Width = Pic.Width; } else if (Pic.Height < Pic.Width) { Temp.Width = 200; Temp.Height = 162; Temp.pictureBox1.Width = 200; Temp.pictureBox1.Height = 150; } else { Temp.Width = 150; Temp.Height = 212; Temp.pictureBox1.Width = 150; Temp.pictureBox1.Height = 200; } //显示图像 Temp.pictureBox1.Image = Pic; Temp.pictureBox1.MouseDoubleClick += new MouseEventHandler(SelectPic); //Temp.TxtShow.Text = txt; flowLayoutOnLeft.Controls.Add(Temp); }
/// <summary> /// 加载图像至右侧区域(有底部说明文字) /// </summary> /// <param name="Pic">传入图像</param> /// <param name="txt">说明文字</param> private void LoadPicOnRight(Bitmap Pic,string txt) { DrawPic Temp = new DrawPic(); if ((Pic.Width < 320 && Pic.Height < 240) || (Pic.Width < 240 && Pic.Height < 320)) { Temp.pictureBox1.Width = Pic.Width; Temp.pictureBox1.Height = Pic.Height; Temp.Height = Pic.Height + 12; Temp.Width = Pic.Width; } else if (Pic.Height < Pic.Width) { Temp.Width = 320; Temp.Height = 252; Temp.pictureBox1.Width = 320; Temp.pictureBox1.Height = 240; } else { Temp.Width = 240; Temp.Height = 332; Temp.pictureBox1.Width = 240; Temp.pictureBox1.Height = 320; } //显示图像 Temp.pictureBox1.Image = Pic; //底部文字说明 Temp.TxtShow.Text = txt; flowLayoutOnRight.Controls.Add(Temp); }
/// <summary> /// 加载图像至右侧区域(有底部说明文字) /// </summary> /// <param name="Pic">传入图像</param> /// <param name="txt">说明文字</param> private void LoadPicOnRight(PICLib.ColorImg Pic, string txt) { DrawPic Temp = new DrawPic(); if ((Pic.Width < 320 && Pic.Height < 240) || (Pic.Width < 240 && Pic.Height < 320)) { Temp.pictureBox1.Width = Pic.Width; Temp.pictureBox1.Height = Pic.Height; Temp.Height = Pic.Height + 12; Temp.Width = Pic.Width; } else if (Pic.Height < Pic.Width) { Temp.Width = 320; Temp.Height = 252; Temp.pictureBox1.Width = 320; Temp.pictureBox1.Height = 240; } else { Temp.Width = 240; Temp.Height = 332; Temp.pictureBox1.Width = 240; Temp.pictureBox1.Height = 320; } Bitmap tmp; PICLib.PicBase.ArrayToImg(out tmp, Pic); //显示图像 Temp.pictureBox1.Image = tmp; //底部文字说明 Temp.TxtShow.Text = txt; flowLayoutOnRight.Controls.Add(Temp); }
/// <summary> /// 加载图像至左侧区域(有底部说明文字) /// </summary> /// <param name="Pic">传入图像</param> /// <param name="txt">说明文字</param> private void LoadPicOnLeft(PICLib.GrayImg Pic, string txt) { DrawPic Temp = new DrawPic(); if ((Pic.Width < 200 && Pic.Height < 150) || (Pic.Width < 150 && Pic.Height < 200)) { Temp.pictureBox1.Width = Pic.Width; Temp.pictureBox1.Height = Pic.Height; Temp.Height = Pic.Height + 12; Temp.Width = Pic.Width; } else if (Pic.Height < Pic.Width) { Temp.Width = 200; Temp.Height = 162; Temp.pictureBox1.Width = 200; Temp.pictureBox1.Height = 150; } else { Temp.Width = 150; Temp.Height = 212; Temp.pictureBox1.Width = 150; Temp.pictureBox1.Height = 200; } Bitmap tmp; PICLib.PicBase.ArrayToImg(out tmp, Pic); //显示图像 Temp.pictureBox1.Image = tmp; Temp.pictureBox1.MouseDoubleClick += new MouseEventHandler(SelectPic); //底部文字说明 Temp.TxtShow.Text = txt; flowLayoutOnLeft.Controls.Add(Temp); }