ปรับขนาดเส้นใน 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.
- ไฟล์ถ้าคุณไม่ใช้การปรับขนาดเส้น.