صادر کردن هر لایه در فایل PNG جداگانه
Contents
[
Hide
]چگونه هر لایه را در فایل PNG جداگانه صادر کنیم
مسئله: چگونه هر لایه را در فایل PNG جداگانه صادر کنیم.
نکات: برای انجام این کار، فقط کافی است از طریق تمام لایهها عبور کنید و متد ذخیرهسازی را بر روی هر کدام انجام دهید.
مثال:
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
using CadImage cadImage = (CadImage)Image.Load(fileName); | |
var rasterizationOptions = new CadRasterizationOptions(); | |
rasterizationOptions.PageSize = new SizeF(cadImage.Width, cadImage.Height); | |
CadLayoutDictionary layouts = cadImage.Layouts; | |
foreach (CadLayout layout in layouts.Values) | |
{ | |
rasterizationOptions.Layouts = new string[] { layout.LayoutName }; | |
ImageOptionsBase option = new PngOptions(); | |
option.VectorRasterizationOptions = rasterizationOptions; | |
cadImage.Save(layout.LayoutName + ".png", option); | |
} |