python读取cad图纸_DWG文件信息的读取

该篇博客介绍了一个在不使用任何插件的情况下,利用C#读取DWG文件的缩略图的方法,适用于没有安装AutoCAD的环境。通过读取DWG文件的特定部分,解析出BMP格式的缩略图,并将其转换为Image对象进行显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在不使用任务插件的情况下读取DWG文件的缩略图,以便在没有安装AutoCAD的计算机上浏览。

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;

namespace 浏览dwg

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

ViewDWG viewDwg = new ViewDWG();

pictureBox1.Image = viewDwg.GetDwgImage("c:\\1.dwg");

}

class ViewDWG

{

struct BITMAPFILEHEADER

{

public short bfType;

public int bfSize;

public short bfReserved1;

public short bfReserved2;

public int bfOffBits;<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值