Bmp分割 类似 16*16 图标的类,以前有个类没留好,现在找不到了,不想自己写浪费时间,哪位有现成的贡献下,谢谢!越精制的类越好!

解决方案 »

  1.   

    用ImageList就可以了,内部就带这个功能了。
      

  2.   

    ImageList.Images.AddStrip(Image):将指定图像的图像条添加到 ImageList。 命名空间:System.Windows.Forms
    程序集:System.Windows.Forms(在 system.windows.forms.dll 中)参数
    value
    一个 Bitmap,它具有要添加的图像。 返回值
    新添加的图像的索引,如果不能添加图像,则为 -1。 备注
    从给定图像的宽度推导出要添加的图像数。
    条是单个图像,它被视为多个并排排列的图像。下面的示例演示如何使用 AddStrip。若要运行此示例,请将下面的代码粘贴到包含一个名为 imageList1 的 ImageList 和一个按钮的 Windows 窗体中,并在处理此按钮的 Click 事件时调用此示例中的 AddStripToCollection 方法。public void AddStripToCollection()
    {
        // Add the image strip.
        Bitmap bitmaps = new Bitmap(typeof(PrintPreviewDialog), "PrintPreviewStrip.bmp");
        imageList1.Images.AddStrip(bitmaps);
        
        // Iterate through the images and display them on the form.
        for (int i = 0; i < imageList1.Images.Count; i++) {
        
            imageList1.Draw(this.CreateGraphics(), new Point(10,10), i);
            Application.DoEvents();
            System.Threading.Thread.Sleep(1000);        
        }
    }