DWGおよびDXFファイルのレンダーモードを指定する
Contents
[
Hide
]DWGおよびDXFファイルのレンダーモードを指定する方法
問題: DWGおよびDXFファイルのレンダーモードを指定する方法。
ヒント: これを行うには、ラスタ化オプションでVisibilityModeパラメーターを変更できます。
注意: AutoCADで表示されたとおりにレンダリングするか、AutoCADで印刷されたとおりにレンダリングするか、スニペットや添付ファイルのAsPrint.pngおよびAsScreen.pngを確認してください。
例:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CadImage cadImage = (CadImage)Image.Load(GetPath("file.dwg")); | |
// AsPrint | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); | |
rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor; | |
rasterizationOptions.PageHeight = 2000; | |
rasterizationOptions.PageWidth = 2000; | |
rasterizationOptions.VisibilityMode = VisibilityMode.AsPrint; | |
string outPath = InputOutputManager.GetFileInOutputFolder(fileName + "_asPrint.pdf"); | |
PdfOptions pdfOptions = new PdfOptions { VectorRasterizationOptions = rasterizationOptions }; | |
cadImage.Save(outPath, pdfOptions); | |
// AsScreen | |
CadRasterizationOptions rasterizationOptions1 = new CadRasterizationOptions(); | |
rasterizationOptions1.DrawType = CadDrawTypeMode.UseObjectColor; | |
rasterizationOptions1.PageHeight = 2000; | |
rasterizationOptions1.PageWidth = 2000; | |
rasterizationOptions1.VisibilityMode = VisibilityMode.AsScreen; | |
PdfOptions pdfOptions1 = new PdfOptions { VectorRasterizationOptions = rasterizationOptions1 }; | |
string outPath1 = InputOutputManager.GetFileInOutputFolder(fileName + "_asScreen.pdf"); | |
cadImage.Save(outPath1, pdfOptions1); |