sp; {
Image gif = Image.FromFile(pPath);
FrameDimension fd = new FrameDimension(gif.FrameDimensionsList[0]);
//获取帧数(gif图片可能包含多帧,其它格式图片一般仅一帧)
int count = gif.GetFrameCount(fd);
//以Jpeg格式保存各帧
for (int i = 0; i < count; i++)
{
gif.SelectActiveFrame(fd, i);
gif.Save(pSavedPath + "\\frame_" + i + ".jpg", ImageFormat.Jpeg);
}
}
/// <summary>
/// 获取图片缩略图
/// </summary>
/// <param name="pPath">图片路径</param>
/// <param name="pSavePath">保存路径</param>
/// <param name="pWidth">缩略图宽度</param>
/// <param name="pHeight">缩略图高度</param>
/// <param name="pFormat">保存格式,通常可以是jpeg</param>
public void GetMiniature(string pPath, string pSavedPath, int pWidth, int pHeight)
{
try
{
Image smallerImg;
Image originalImg = Image.FromFile(pPath);
Image.GetThumbnailImageAbort callback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
smallerImg = originalImg.GetThumbnailImage(pWidth, pHeight, callback, IntPtr.Zero);
  |