将BlockView的窗体代码改下:)[code]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Imaging;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.GraphicsInterface;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using TlsCad.Image;
[assembly: CommandClass(typeof(TlsCad.frmBlockPreview))]
namespace TlsCad
{
public partial class frmBlockPreview : Form
{
BlockPreviewCollection m_BlockPreviews;
private ImageCreator m_Gif;
private ImageCreator m_Tiff;
public frmBlockPreview()
{
InitializeComponent();
m_BlockPreviews =
new BlockPreviewCollection(
"D:\\TlsCad.dwg",
Autodesk.AutoCAD.GraphicsSystem.RenderMode.GouraudShaded,
VisualStyleType.Gouraud);
m_BlockPreviews.BackColor = Color.White;
List ents = new List();
Line line = new Line(Point3d.Origin, new Point3d(0, 10.5, 0));
line.SetDatabaseDefaults();
ents.Add(line);
Circle cir = new Circle(Point3d.Origin, Vector3d.ZAxis, 14);
cir.SetDatabaseDefaults();
ents.Add(cir);
Line line1 = new Line(new Point3d(11, 0, 0), new Point3d(14, 0, 0));
Line line2 = new Line(new Point3d(13, 0, 0), new Point3d(14, 0, 0));
line1.SetDatabaseDefaults();
line2.SetDatabaseDefaults();
double angle = Math.PI / 30;
for (int i = 0; i