在SVG中缩放线条
Contents
[
Hide
]导出到SVG时更改线条缩放
您可以控制SVG文件中线条的缩放,Aspose.CAD库提供了所有必要的工具。
使用VectorRasterizationOptions中的LineScale参数来控制线条的缩放
示例代码:
This file contains 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
string fileName = "exampleFile"; | |
string file = string.Format("{0}.plt", fileName); | |
string outFile = string.Format("{0}.svg", fileName); | |
using (FileStream inStream = new FileStream(file, FileMode.Open)) | |
using (Image image = Image.Load(inStream)) | |
using (FileStream stream = new FileStream(outFile, FileMode.Create)) | |
{ | |
ImageOptionsBase options = new SvgOptions(); | |
options.VectorRasterizationOptions = new CadRasterizationOptions | |
{ | |
LineScale = 0.25f | |
}; | |
image.Save(stream, options); | |
} |
使用线性缩放的文件
- 当LineScale参数设置为0.25时的文件。
- 如果您不使用线条缩放的文件。