上一篇中说到了图片的具体产生以及属性,本篇主要是具体的使用,详情案例见下面的具体视图及代码

Image.FrameDimensionsList 属性-----具体使用案例

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

namespace PictureSplit
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}

private void btnStart_Click(object sender, EventArgs e)
{
//图片构成有两种形式 1、多页(.gif)和2、多分辨率
string pathString = Path.Combine(Application.StartupPath, "20160715.gif");
Image image = Image.FromFile(pathString);
FrameDimension frameDim = new FrameDimension(image.FrameDimensionsList[0]);
int count = image.GetFrameCount(frameDim);
for (int xt = 0; xt < count; xt++) {
image.SelectActiveFrame(frameDim, xt);
image.Save(string.Format(@"E:\WLJTool\WLJTLongtengGenesAndSupreme\PictureSplit\Frame{0}.jpg", xt), ImageFormat.Jpeg);
}
}
}
}

相关文章:

  • 2021-05-25
  • 2021-06-07
  • 2022-12-23
  • 2021-04-29
  • 2021-06-11
  • 1970-01-01
  • 2021-09-24
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2021-10-24
  • 2021-10-30
  • 2021-10-15
  • 2022-12-23
相关资源
相似解决方案