Merge Images in C++
Use Aspose.Slides for C++ to combine images in C++ applications.
Merge image to image using Aspose.Slides
Aspose.Slides for C++ is a C++ API for working with presentations and image content. You can add multiple images to a slide as picture frames and render the slide as a single image file.
Merge image to image in C++
Using
Aspose.Slides for C++
, you can merge image files by adding them with AddImage and AddPictureFrame, rendering the slide with GetImage, and saving it with ImageFormat::Png.
C++ code for merging image to image
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto firstImageData = File::ReadAllBytes(u"first.png");
auto firstImage = presentation->get_Images()->AddImage(firstImageData);
slide->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 0, 0, 320, 240, firstImage);
auto secondImageData = File::ReadAllBytes(u"second.png");
auto secondImage = presentation->get_Images()->AddImage(secondImageData);
slide->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 0, 260, 320, 240, secondImage);
auto image = slide->GetImage(2.0, 2.0);
image->Save(u"merged.png", ImageFormat::Png);
image->Dispose();
presentation->Dispose();
How to merge images in C++
Install Aspose.Slides for C++. See Installation .
Add the library as a reference in your project.
Create a
Presentationinstance and access the slide.Add the source images with
AddImageand place them withAddPictureFrame.Render the slide with
GetImageand save it withImageFormat::Png.
Merge Files Online
Merge presentations, documents, and images online.
Merge other files
You can also combine files in other formats.