L
Lion_sj
Unregistered / Unconfirmed
GUEST, unregistred user!
显示图形的代码如下:(摘自Delphibbs)
imgFileNameTemp := 'c:/gc_gctz.dwg';
l_FileStream := TFileStream.Create('c:/gc_gctz.dwg', fmOpenWrite or fmCreate);
TBlobField(qry_gctz.Fields.Fields[6]).SaveToStream(l_FileStream);
l_FileStream.Free;
cad:=CreateoleObject('AutoCAD.Application');
//cad.visible:=true;
caddoc:=cad.ActiveDocument;
//改变当前背景颜色为白色
cad.Preferences.Display.GraphicsWinModelBackgrndColor:= clblack;
//改变当前命令行为1行
cad.Preferences.Display.DockedVisibleLines:= 1;
//设置模式为单文档
caddoc.SetVariable('SDI',1);
//调入新文件
caddoc.Application.Documents.Open('c:/gc_gctz.dwg', False);
t_SelectionSet:=caddoc.SelectionSets.Add('NewSelSet');
t_SelectionSet.Select(5);
caddoc.Export( 'c:/' + 'gc_gctz', 'WMF', t_SelectionSet);
Picture.LoadFromFile('c:/gc_gctz.WMF');
cad.quit;
imgFileNameTemp := 'c:/gc_gctz.dwg';
l_FileStream := TFileStream.Create('c:/gc_gctz.dwg', fmOpenWrite or fmCreate);
TBlobField(qry_gctz.Fields.Fields[6]).SaveToStream(l_FileStream);
l_FileStream.Free;
cad:=CreateoleObject('AutoCAD.Application');
//cad.visible:=true;
caddoc:=cad.ActiveDocument;
//改变当前背景颜色为白色
cad.Preferences.Display.GraphicsWinModelBackgrndColor:= clblack;
//改变当前命令行为1行
cad.Preferences.Display.DockedVisibleLines:= 1;
//设置模式为单文档
caddoc.SetVariable('SDI',1);
//调入新文件
caddoc.Application.Documents.Open('c:/gc_gctz.dwg', False);
t_SelectionSet:=caddoc.SelectionSets.Add('NewSelSet');
t_SelectionSet.Select(5);
caddoc.Export( 'c:/' + 'gc_gctz', 'WMF', t_SelectionSet);
Picture.LoadFromFile('c:/gc_gctz.WMF');
cad.quit;