全部成交,
我需要在MFC2010中将动画gif格式图片解码为一些位图文件。有没有可以解码gif图片的库?我无法使用 GDIPlus,因为该程序必须在 Windows XP 上运行。如果有人为我提供库、Activex、dll 或类似的东西,我将不胜感激。
非常感谢, 谢尔文·扎格姆
最佳答案
使用 ImageMagick 的 C++ API ( Magick++ ) 非常简单:
/* list of Image to store the GIF's frames */
std::vector<Magick::Image> imageList;
/* read all the frames of the animated GIF */
Magick::readImages( &imageList, "animated.gif" );
/* optionnally coalesce the frame sequence depending on the expected result */
Magick::coalesceImages( &imageList, imageList.begin(), imageList.end());
/* store each frame in a separate BMP file */
for(unsigned int i = 0; i < imageList.size(); ++i) {
std::stringstream ss;
ss << "frame" << i << ".bmp";
imageList[i].write(ss.str());
}
关于c++ - 如何在MFC2010中解码动画gif文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16300100/