标签:
上一篇中说到了图片的具体产生以及属性,本篇主要是具体的使用,详情案例见下面的具体视图及代码
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);
}
}
}
}
Image.FrameDimensionsList 属性-----具体使用案例
标签:
原文地址:http://www.cnblogs.com/1175429393wljblog/p/5674961.html