SVG에서 선 크기 조절
Contents
[
Hide
]SVG로 내보낼 때 선 크기 변경
SVG 파일에서 선의 크기를 제어할 수 있으며, Aspose.CAD 라이브러리는 이를 위한 모든 필요한 도구를 제공합니다.
LineScale 매개변수를 VectorRasterizationOptions에 사용하여 선의 크기를 제어하기
예제 코드:
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로 설정된 파일입니다.
- 선 크기 조정을 사용하지 않은 파일입니다.