yfy2003
发表于 2006-7-28 18:03:00
haill2000发表于2006-7-18 15:23:00static/image/common/back.gif曾经用VC写过一个,需要的可以给我发电邮
<BR>传上来大家学习吧!
tcsl9621
发表于 2006-8-6 14:24:00
楼上的说的对,传上来大家学习一下吧。最近有不少人回帖啊。呵……
idoo
发表于 2006-8-9 19:21:00
想问楼主一个问题:使用VB.NET开发CAD会不会有因CAD版本问题而带来的不兼容?比如使用VC++通过ObjectARX开发就会样!VB开发的优点是什么?还有不足呢??我一直再用VBA……
tcsl9621
发表于 2006-8-9 20:01:00
本帖最后由 作者 于 2006-8-24 22:39:51 编辑 <br /><br /> <P>VB最好的就是做界面,兼容性是不太好和VC++一样。你要是VBA好就用VBA好了。用什么工具都是一样的。</P>
Aladingking
发表于 2006-8-16 14:37:00
<P> 改写为C++Builder的编码</P>
<P> </P>
<P>//---------------------------------------------------------------------------</P>
<P>#include <vcl.h><BR>#pragma hdrstop</P>
<P>#include "Unit1.h"<BR>#include <math.h><BR>//---------------------------------------------------------------------------<BR>#pragma package(smart_init)<BR>#pragma resource "*.dfm"<BR>TForm1 *Form1;<BR>//---------------------------------------------------------------------------<BR>__fastcall TForm1::TForm1(TComponent* Owner)<BR> : TForm(Owner)<BR>{<BR>}<BR>//---------------------------------------------------------------------------</P>
<P>void __fastcall TForm1::Button1Click(TObject *Sender)<BR>{<BR> int nHandle;<BR> nHandle = FileOpen("E:\\hnk-s01.dwg",fmOpenRead);<BR> FileSeek(nHandle,13,0);<BR> BITMAPFILEHEADER BmpHeader;<BR> int nPosScen;<BR> FileRead(nHandle,&nPosScen,sizeof(__int32));</P>
<P> unsigned short nTypePreview;<BR> FileSeek(nHandle,nPosScen+30,0);<BR> FileRead(nHandle,&nTypePreview,1);<BR> ShowMessage(nTypePreview);<BR> int nPosBMP;<BR> int nLenBMP;<BR> short nBitCount;<BR> char* pszBuffer;</P>
<P> TMemoryStream* pms = new TMemoryStream();<BR> Graphics::TBitmap *pBitmap = new Graphics::TBitmap();</P>
<P> switch (nTypePreview)<BR> {<BR> case 1:<BR> break;<BR> case 2:<BR> case 3:<BR> FileRead(nHandle, &nPosBMP, sizeof(__int32));<BR> FileRead(nHandle, &nLenBMP, sizeof(__int32));<BR> FileSeek(nHandle, nPosBMP+14, 0);<BR> FileRead(nHandle, &nBitCount,sizeof(__int16));<BR> //ÒÆÖÁËõÂÔͼBMP¿ªÊ¼Î»ÖÃ<BR> pszBuffer = new char;<BR> FileSeek(nHandle, nPosBMP, 0);<BR> ShowMessage(FileRead(nHandle,pszBuffer,nLenBMP));<BR> FileClose(nHandle);<BR> BmpHeader.bfType = 0x4D42;<BR> if ( nBitCount < 9)<BR> BmpHeader.bfSize = 54+4*pow(2,nBitCount)+nLenBMP;<BR> else<BR> BmpHeader.bfSize = 54+nLenBMP;<BR> BmpHeader.bfReserved1 = 0;<BR> BmpHeader.bfReserved2 = 0;<BR> BmpHeader.bfOffBits = 14+0x28+1024;<BR> pms->Write(&BmpHeader.bfType, sizeof(BmpHeader.bfType));<BR> pms->Write(&BmpHeader.bfSize, sizeof(BmpHeader.bfSize));<BR> pms->Write(&BmpHeader.bfReserved1, sizeof(BmpHeader.bfReserved1));<BR> pms->Write(&BmpHeader.bfReserved2, sizeof(BmpHeader.bfReserved2));<BR> pms->Write(&BmpHeader.bfOffBits, sizeof(BmpHeader.bfOffBits));<BR> pms->Write(pszBuffer,nLenBMP);<BR> pms->Seek(0,soFromBeginning );</P>
<P> //pBitmap->LoadFromStream(pms);<BR> //Image1->Picture->Bitmap = pBitmap;</P>
<P> BitBtn1->Glyph->LoadFromStream(pms);<BR> break;<BR> }</P>
<P>}<BR>//---------------------------------------------------------------------------</P>
xutop
发表于 2006-8-19 06:58:00
<P>历害啊,真牛,要是我也这样的水平就好了,太酷了</P>
<P> </P>
8350
发表于 2006-8-23 13:53:00
<P>怎么用哦??</P>
<P>哈哈,我是一个文忙!!</P>
wrflili
发表于 2006-9-6 13:32:00
<TABLE class=tablebody2 style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" width="90%" border=0>
<TBODY>
<TR>
<TD style="FONT-SIZE: 9pt; LINE-HEIGHT: 12pt" width="100%"><IMG alt=发贴心情 src="http://www.mjtd.com/bbs/skins/default/topicface/face1.gif" border=0> <B></B><BR>谢谢推荐!</TD></TR></TBODY></TABLE>
yuehuaqi
发表于 2007-1-2 11:06:00
这个格式应该是windows定义的,只是dwg遵从了windows的规范,所有才可以在浏览器里面预览,说了解autocad的文档格式还是距离甚远的....大家明白?我想这段代码也应该可以读取能够在浏览器里面浏览的其他文档的预览的,原理是一致 的
makegood
发表于 2007-8-27 17:31:00
谢谢楼主·但能不能用C#代码的,或是怎么转换?