ImageList存取图像控件常用属性:
ColorDepth 显示图像的颜色数;
ImageSize 每张图像的固定大小;
声明一个图像存图像数据
1、Image image = Image.FromFile(@”单张图像的位置”);
2、Image.image = Directory.GetFiles(@”全部图像的位置”);
存放在图像列表中
1、imagelist.Images.AddRange(Image[] image);
2、imagelist.Images.Add(image1);
3、imagelist.Images.AddSrip(image2);
删除图像列表中的图像
1、imagelist.Images.RemoveAt(image4);
创建句柄
1、Graphics graphics = Griphics.FromHwnd(this.Handle);
Drow三种方法参数
1、imagelist.Drow(graphics,图像显示坐标,索引值);
2、imagelist.Drow(graphics,水平坐标,垂直坐标,图像宽度,图像高度,索引值);
3、imagelist.Drow(graphics,水平坐标,垂直坐标,索引值);
代码展示:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public int jishu;
public int JiShu
{
set {
jishu = value;