当前位置: 代码迷 >> 综合 >> C# Interop CorelDRAW
  详细解决方案

C# Interop CorelDRAW

热度:32   发布时间:2024-01-15 21:50:14.0
  1. <span style="white-space:pre">  </span>/// <summary>  
  2.         /// 需要先用C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regtlibv12.exe 注册CorelDRAW Graphics Suite X5\Programs\CorelDraw.tlb  
  3.         /// </summary>  
  4.         private void CorelDrawT()  
  5.         {  
  6.             CorelDRAW.Application cdr = new CorelDRAW.Application();              
  7.             cdr.Visible = false;  
  8.   
  9.               
  10.             CorelDRAW.StructCreateOptionsClass op = new CorelDRAW.StructCreateOptionsClass();  
  11.             op.Name = "bg";  
  12.             op.PageHeight = 300.00;  
  13.             op.PageWidth = 300.00;  
  14.   
  15.             CorelDRAW.Document doc = cdr.CreateDocumentEx(op);  
  16.             CorelDRAW.StructImportOptionsClass bgi = new CorelDRAW.StructImportOptionsClass();          
  17. <p>            doc.ActiveLayer.Import(this.txtImgPath.Text,CorelDRAW.cdrFilter.cdrPNG,bgi);</p><p>            doc.ActiveLayer.Import(@"E:\mp\小分辨率图片\F.png", CorelDRAW.cdrFilter.cdrPNG, bgi);</p>  
  18.              CorelDRAW.Shape sh = doc.ActiveLayer.CreateArtisticTextWide(10, 120, "你好你好你好你好",   
  19.                 CorelDRAW.cdrTextLanguage.cdrChineseSingapore,  
  20.                 CorelDRAW.cdrTextCharSet.cdrCharSetDefault,  
  21.                 "仿宋", 20,  
  22.                 CorelDRAW.cdrTriState.cdrFalse,  
  23.                 CorelDRAW.cdrTriState.cdrTrue,  
  24.                 CorelDRAW.cdrFontLine.cdrNoFontLine,  
  25.                 CorelDRAW.cdrAlignment.cdrNoAlignment);  
  26.   
  27.   
  28.             sh.Outline.Color = new CorelDRAW.ColorClass().  
  29.   
  30.             cdr.ActiveDocument.SaveAs(@"E:\mp\t.cdr"null);  
  31.             cdr.ActiveDocument.Close();              
  32.             cdr.Quit();  
  33.         }  
  相关解决方案