运行时改变picbox的图片

  public static  string programPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
       
        private void button1_Click(object sender, EventArgs e)
        {
            string filename = programPath + @"\未命名.jpg";
          
            Bitmap bmp = new Bitmap(filename);

 

            this.pictureBox1.Image = System.Drawing.Image.FromHbitmap(bmp.GetHbitmap());
        }

你可能感兴趣的:(CBO)