Convert JPG to Image in C++
Convert JPG files to images using Aspose.Slides for C++ without Microsoft PowerPoint.
Convert JPG to Image in C++
Aspose.Slides for C++ is a presentation processing API that can import JPG files into slides and render the result as image files.
Aspose.Slides for C++ can convert JPG content to images and other presentation-related formats.
Convert JPG to Image Using C++
To convert JPG to another image format, create a new Presentation, add the JPG file to its image collection, place it on a slide with AddPictureFrame, and render the slide in the required image format.
C++ code for converting JPG into Image
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto imageData = File::ReadAllBytes(u"image.jpg");
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 PNG format.
slideImage->Save(u"slide.png", ImageFormat::Png);
slideImage->Dispose();
presentation->Dispose();
How to Convert JPG to Image Using Aspose.Slides for C++ API
These are the steps to convert JPG to Image in C++.
Install Aspose.Slides for C++ .
Add a library reference (import the library) to your C++ project.
Open the source JPG file in C++.
Save the result as an image file.
Free Online Converter
Convert presentations and slides online.
Convert JPG to Other Supported Formats
You can also convert JPG files and save them to other file formats. See all supported formats below.