Convert PNG to PPTX in C++

Convert PNG images to PPTX using Aspose.Slides for C++ without Microsoft PowerPoint.

Convert PNG to PPTX Using C++

To convert PNG to PPTX, create a Presentation, add the PNG image to a slide, and save the presentation in PPTX format.

C++ code for converting PNG into PPTX

auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto slideSize = presentation->get_SlideSize()->get_Size();

auto imageData = File::ReadAllBytes(u"image.png");
auto presentationImage = presentation->get_Images()->AddImage(imageData);
slide->get_Shapes()->AddPictureFrame(
    ShapeType::Rectangle,
    0,
    0,
    slideSize.get_Width(),
    slideSize.get_Height(),
    presentationImage);

presentation->Save(u"document.pptx", SaveFormat::Pptx);
presentation->Dispose();

Convert PNG to PPTX in C++

Aspose.Slides for C++ is a presentation processing API that can create slides from images and save the result in presentation formats. Using Aspose.Slides for C++, developers can convert PNG images to PPTX with just a few lines of C++ code.

Aspose.Slides for C++ can place PNG images on slides and save the presentation as PPTX and other related formats.

How to convert PNG to PPTX using Aspose.Slides for C++ API

These are the steps to convert PNG to PPTX in C++.

  1. Install Aspose.Slides for C++.
  2. Add a library reference to your C++ project.
  3. Create a Presentation instance and add the PNG image to a slide.
  4. Save the presentation as a PPTX presentation.

Built with Aspose.Slides

Convert PNG to PPTX Online

The free Aspose.Slides Conversion app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own PNG files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides converts files before you write code.
  • Upload PNG files and save them as PPTX.
  • Download the result or convert more files.

Convert PNG to Other Supported Formats

You can also convert PNG images and save them to other file formats. See all supported formats below.