天天看點

winform界面嵌入dwg圖紙_如何在Winform中顯示.dwg(AutoCAD)

winform界面嵌入dwg圖紙_如何在Winform中顯示.dwg(AutoCAD)

I want just display autocad files in winform.How to do this?

解決方案This is not easy. The display would not be too difficult; this would be a pretty usual technique of rendering graphics based on some data model of graphics. If you ever come to this and face any problems, I would be able to help it quickly.

The real problem is parsing DWG files. Basically, you can either use proprietary Autodesk RealDWG products of other companies who tried to reverse engineer the format. I personally used the product of Open Design Alliance (which is written in pure C++ in such a tight style which makes it pretty hard to export methods and P/Invoke them in .NET) and one more which I don''t remember right now, would need to look at my old records. It wasn''t easy. The products were expensive enough, had certain problem with most difficult problems were related to performance. Dealing with Autodesk was accompanied with number of lawsuits. In my opinion, this is extremely bad company which managed to pioneer extremely bad and heavy product years ago and grab key positions on the market. May be I am not right about it… Look at this article: http://en.wikipedia.org/wiki/.dwg[^].

—SA

Autocad provides an option of converting the drawing files to JPG or BMP files.

can we use it here.

Because it is very difficult from C# code to get the drawing from .dwg format and then display on form.

If we could able to convert it to JPEG OR JPG or BMP or any other image supporting format, it is very easy.....

try that.