Merge JPG in C++

High-speed and cross-platform C++ library for merging JPG images using C++ code

Merge JPG to JPG using Aspose.Slides

Aspose.Slides for C++ is a powerful C++ library used to merge and manipulate presentations, images, and other files. When you merge JPG to JPG, you are effectively combining two images to get one picture.

Merge JPG to JPG in C++

Using Aspose.Slides for C++ , you can merge JPG files quickly with just a few lines of code

C++ code for merging JPG to JPG


auto pres = System::MakeObject<Presentation>();
        
auto image1 = pres->get_Images()->AddImage(File::ReadAllBytes(u"image1.jpg"));
pres->get_Slides()->idx_get(0)->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 0.0f, 0.0f, 100.0f, 100.0f, image1);
auto image2 = pres->get_Images()->AddImage(File::ReadAllBytes(u"image2.jpg"));
pres->get_Slides()->idx_get(0)->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 0.0f, 200.0f, 100.0f, 100.0f, image2);

for (int32_t index = 0; index < pres->get_Slides()->get_Count(); index++)
{
    auto slide = pres->get_Slides()->idx_get(index);
    auto fileName = String::Format(u"slide_{0}.jpg", index);
    slide->GetThumbnail()->Save(fileName, ImageFormat::get_Jpeg());
}

How to merge JPG in C++

  1. Install Aspose.Slides for C++. See Installation .

  2. Add the library as a reference in your project.

  3. Create an instance of the Presentation class.

  4. Load the JPG files you want to merge as picture frames.

  5. Save the resulting JPG image.

Merge PDF Files Online

How to Merge PDF in Python

Merge other files

You can also combine files in other formats to get a single file