今天在一个图片网站上,上传Illustrator图片时,突然想到一个问题:已有一幅Illustrator做好的2009年的年历,想使用C#程序生成缩略图。怎么做呢?本文解决这个问题。
Illustrator原图在这里找到后下载(http://download.youkuaiyun.com/johnsuna)。
注意:需要添加对Illustrator动态链接库的引用。(在COM选项卡下的Adobe Illustrator XX.X Type Library)
C# 代码:
private void btnGetAIThumb_Click(object sender, EventArgs e)
{
Illustrator.Application app = new Illustrator.Application();
Illustrator.Document doc = app.Open(@"F:/AI_Prog/2009Calendar.ai", Illustrator.AiDocumentColorSpace.aiDocumentRGBColor, null);
doc.Export(@"F:/AI_Prog/2009Calendar.png", Illustra