# Convert JPG to Image in C++

> Convert JPG to image in C++. Use the C++ library API to convert JPG files to images.

Source: https://products.aspose.com/slides/cpp/conversion/jpg-to-image/
Updated: 2026-10-27



## 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

```cpp
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();
```

## Convert JPG to Image in C++

[**Aspose.Slides for C++**](/slides/cpp/) 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.

## How to Convert JPG to Image Using Aspose.Slides for C++ API

These are the steps to convert JPG to Image in C++.

1. Install [**Aspose.Slides for C++**](/slides/cpp/).

1. Add a library reference (import the library) to your C++ project.

1. Open the source JPG file in C++.

1. Save the result as an image file.

## Convert JPG to Image Online

[Aspose.Slides Conversion](https://products.aspose.app/slides/conversion)

## Convert JPG to Other Supported Formats

- [JPG TO PNG](/slides/cpp/conversion/jpg-to-png/)
- [JPG TO PDF](/slides/cpp/conversion/jpg-to-pdf/)
