如何制作picturebox.image =数组中的一张图片?

时间:2016-04-26 14:41:38

标签: c# visual-studio-2012

我想我需要将字符串s和位图bmp存储在一个数组中然后我想我必须在bmp数组中选择一个图像以显示在图片框中但我不确定如何。

  public partial class capstoneProjectForm : Form
{
    string imageName;
    //string[] a;
    Bitmap[] bit;
    string[] folder;
    int numOfPics;
    int num = 0;
    public capstoneProjectForm()
    {

        InitializeComponent();
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;


      //  a = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
        string resFolder = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "Resources");


        foreach (string s in Directory.EnumerateFiles(resFolder, "*.jpg"))
        {

           using (Bitmap bmp = new Bitmap(s))
            {


            }
           if (s.Equals(imageName))
                {
                    pictureBox.Image = ;
                }



        }

0 个答案:

没有答案