WriteAsEmf()
Contents
[
Hide
]ISvgImage::WriteAsEmf(System::SharedPtr<System::IO::Stream>) method
Saves the SVG image as an EMF file.
virtual void Aspose::Slides::ISvgImage::WriteAsEmf(System::SharedPtr<System::IO::Stream> stream)=0
Arguments
Parameter | Type | Description |
---|---|---|
stream | System::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
- Typedef SharedPtr
- Class Stream
- Class ISvgImage
- Namespace Aspose::Slides
- Library Aspose.Slides