How to show a specific frame of a GIF image in C#?

前端 未结 2 1383
清酒与你
清酒与你 2021-01-14 07:57

I want to show a frame of a gif image. I searched and found that the following code should work, but it doesn\'t work. it detects the number of frames correctly but it shows

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 08:08

    Use your own code up until the call of SelectActiveFrame() and after that change to this lines:

    frames[0] = new Bitmap(GG);
    pictureBox1.Image = frame[0];
    

    This should do the trick. Please do not forget do dispose the created Images.

提交回复
热议问题