求解“DWG预览<完结篇> ”作者
原帖在这里:http://bbs.mjtd.com/thread-89016-1-1.html当批量获取缩略图时程序自动终止,请教作者应该如何使用?
代码在这里:
这是主程序文件
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using chmenf087.Att.Components.Shell;
using System.IO;
namespace Test_chmenf087
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
ThumbnailCreater tb = new ThumbnailCreater();
Bitmap[] btms = null;
private void button1_Click(object sender, EventArgs e)
{
FolderBrowserDialog fd = new FolderBrowserDialog();
fd.RootFolder = Environment.SpecialFolder.MyComputer;
if (fd.ShowDialog() == DialogResult.OK)
{
string[] dirs = Directory.GetFiles(fd.SelectedPath, "*.dwg");
tb.DesireSize = new Size(30, 30);
tb.ReversBlackWhite = true;
btms =tb. GetThumbNail(dirs);
pictureBox1.Image = btms;
btms = tb.GetThumbNail(dirs);
pictureBox2.Image = btms;
btms = tb.GetThumbNail(dirs);
pictureBox3.Image = btms;
btms = tb.GetThumbNail(dirs);
pictureBox4.Image = btms;
}
}
}
没人看 顶下!! 没人看 顶下!! 你的bitms动态数组在使用前必须指定长度 VB.net使用redim() C#我不太清楚
本帖最后由 chmenf087 于 2011-12-11 00:39 编辑
另外那个dll是有些缺陷的,你可能会遇到参数无效的错误,因为一直很忙没时间修改它
页:
[1]