ConvertMetafilesToPng

LoadOptions.ConvertMetafilesToPng property

Meta dosyasının dönüştürülüp dönüştürülmeyeceğini alır veya ayarlarWmf veyaEmf ) görüntüleriPnggörüntü biçimi.

public bool ConvertMetafilesToPng { get; set; }

Notlar

Meta dosyaları (Wmf veyaEmf ) sıkıştırılmamış bir görüntü biçimidir ve bazen belgeyi tutmak ve işlemek için çok fazla RAM gerektirir. Bu seçenek tüm meta dosyası görüntülerini dönüştürmeye olanak tanırPng Belge yüklenirken. Lütfen dikkat - vektörel grafikleri raster’a dönüştürmek görüntülerin kalitesini düşürür.

Örnekler

Belge yüklenirken WMF/EMF’nin PNG’ye nasıl dönüştürüleceğini gösterir.

Document doc = new Document();

Shape shape = new Shape(doc, ShapeType.Image);
shape.ImageData.SetImage(ImageDir + "Windows MetaFile.wmf");
shape.Width = 100;
shape.Height = 100;

doc.FirstSection.Body.FirstParagraph.AppendChild(shape);

doc.Save(ArtifactsDir + "Image.CreateImageDirectly.docx");

shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);

TestUtil.VerifyImageInShape(1600, 1600, ImageType.Wmf, shape);

LoadOptions loadOptions = new LoadOptions();
loadOptions.ConvertMetafilesToPng = true;

doc = new Document(ArtifactsDir + "Image.CreateImageDirectly.docx", loadOptions);
shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);

TestUtil.VerifyImageInShape(1666, 1666, ImageType.Png, shape);

Ayrıca bakınız