您的位置:首页 > 编程语言 > C#

C#第二次作业—目标二(顺序图片阅读器)

2015-04-24 12:09 309 查看
using System;  

using System.Collections.Generic;  

using System.ComponentModel;  

using System.Data;  

using System.Drawing;  

using System.IO;  

using System.Linq;  

using System.Text;  

using System.Threading.Tasks;  

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void btnShow_Click(object sender, EventArgs e)

        {

            

          

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            pictureBox1.Image = new Bitmap(pictureName[0]);

        }

        int i;

        string[] pictureName = { @"C:\\Users\\aoc\\Desktop\\1.jpg", @"C:\\Users\\aoc\\Desktop\\2.jpg", @"C:\\Users\\aoc\\Desktop\\3.jpg", @"C:\\Users\\aoc\\Desktop\\4.jpg", @"C:\\Users\\aoc\\Desktop\\5.jpg" };

        private void btnDown_Click(object sender, EventArgs e)

        {

            i++;

            if (i > 4)

            { i = 0; }

            pictureBox1.Image = new Bitmap(pictureName[i]); 

        }

        private void btnUp_Click(object sender, EventArgs e)

        {

            i--;

            if (i < 0)

            {

                i = 4;

            }

            pictureBox1.Image = new Bitmap(pictureName[i]);  

        }

    }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: