WriteAsEmf()

SvgImage::WriteAsEmf(System::SharedPtr<System::IO::Stream>) method

Saves the SVG image as an EMF file.

void Aspose::Slides::SvgImage::WriteAsEmf(System::SharedPtr<System::IO::Stream> stream) override

Arguments

ParameterTypeDescription
streamSystem::SharedPtr<System::IO::Stream>Target stream

Remarks

The following example demonstrates how to save the SVG image into a metafile.

// Creates the new SVG image
System::SharedPtr<ISvgImage> svgImage = System::MakeObject<SvgImage>(System::IO::File::ReadAllText(u"content.svg"));

// Saves the SVG image as a metafille
auto fileStream = System::IO::File::OpenWrite(u"SvgAsEmf.emf");
svgImage->WriteAsEmf(fileStream);

This sample demonstrates how to add the SVG image as a metafile to the presentation image collection.

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>();

// Creates the new SVG image
System::SharedPtr<ISvgImage> svgImage = System::MakeObject<SvgImage>(System::IO::File::ReadAllText(u"content.svg"));
auto memStream = System::MakeObject<System::IO::MemoryStream>();

// Saves the SVG image as a metafille
svgImage->WriteAsEmf(memStream);
// Adds metafile to the image collection
pres->get_Images()->AddImage(memStream->ToArray());

See Also