Convert Image to JPG in C++
Convert image files to JPG images using Aspose.Slides for C++ without Microsoft PowerPoint.
Convert Image to JPG in C++
Aspose.Slides for C++ is a presentation processing API that can import images into slides and render the result as JPG images.
Aspose.Slides for C++ can convert image content to JPG images and other presentation-related formats.
Convert Image to JPG Using C++
To convert an image to JPG, create a Presentation from the image file and render each slide as a JPG image.
C++ code for converting Image into JPG
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto imageData = File::ReadAllBytes(u"image.png");
auto presentationImage = presentation->get_Images()->AddImage(imageData);
slide->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 10, 10, 100, 100, presentationImage);
// Convert the slide to an image.
auto slideImage = slide->GetImage(2.0f, 2.0f);
// Save the image in JPG format.
slideImage->Save(u"slide.jpg", ImageFormat::Jpeg);
slideImage->Dispose();
presentation->Dispose();
How to Convert Image to JPG Using Aspose.Slides for C++ API
These are the steps to convert Image to JPG in C++.
Install Aspose.Slides for C++ .
Add a library reference (import the library) to your C++ project.
Open the source image file in C++.
Save the result as a JPG file.
Free Online Converter
Convert presentations and slides online.
Convert Image to Other Supported Formats
You can also convert images and save them to other file formats. See all supported formats below.