Thay đổi tỷ lệ đường thẳng trong SVG
Contents
[
Hide
]Thay đổi tỷ lệ đường thẳng khi xuất sang SVG
Bạn có thể kiểm soát tỷ lệ của các đường thẳng trong tệp SVG, thư viện Aspose.CAD cung cấp tất cả các công cụ cần thiết cho việc này.
Sử dụng tham số LineScale trong VectorRasterizationOptions để kiểm soát tỷ lệ của các đường thẳng
Mã ví dụ:
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); | |
} |
Tệp sử dụng tỷ lệ tuyến tính
- Tệp nếu tham số LineScale được thiết lập là 0.25.
- Tệp nếu bạn không sử dụng tỷ lệ đường thẳng.