How to Export Images from an Image List in VS2005?

后端 未结 2 908
花落未央
花落未央 2021-02-13 12:47

Using Visual Studio 2005, is there a way to export the images in an Image List to individual files on my PC? Using the IDE, I select the Image List and view its properties. In

2条回答
  •  逝去的感伤
    2021-02-13 13:11

    You can write some simple code to export the images. You don't mention which language you are using, so here is the solution in both C# and VB.

    C#

    for (int x = 0; x < imageList1.Images.Count; ++x)
    {
        Image temp = imageList1.Images[x];
        temp.Save("image" + x + ".bmp");
    }
    

    VB

    For x As Integer = 0 To imageList1.Images.Count - 1
        Dim temp As Image = imageList1.Images(x)
        temp.Save("image" & x & ".bmp")
    Next
    

提交回复
热议问题