How to Save an EMF Image from IPictureFrame as JPEG or PNG in C#?

I have aspose library running on windows.

One of the shapes is EMF image.

var slide = presentation.Slides[0]; // Change the index to select a different slide

// Iterate through shapes to find the image
foreach (var shape in slide.Shapes)
{
    if (shape is IPictureFrame)
    {
        // Cast the shape to PictureFrame
        var pf = (IPictureFrame)shape;
    }
}

How it’s possible to save EMF as jpeg or png?

@IevgenN,
Thank you for posting the question.

To extract an image from a PictureFrame object and save it as a PNG, please try using the following code snippet:

var image = pf.PictureFormat.Picture.Image.SystemImage;
image.Save("image.png", ImageFormat.Png);

You can also save images in other formats.

More examples: