Merge Image to BMP in C++

Use Aspose.Slides for C++ to combine images and save the result as BMP.

Merge image to BMP 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::Bmp.

C++ code for merging image to BMP

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.bmp", ImageFormat::Bmp);
image->Dispose();

presentation->Dispose();

Merge image to BMP using Aspose.Slides

Aspose.Slides for C++ is a C++ API for working with presentations and image content. You can add images to a slide as picture frames and render the slide as a BMP file.

How to merge image to BMP in C++

  1. Install Aspose.Slides for C++. See Installation.
  2. Add the library as a reference in your project.
  3. Create a Presentation instance and access the slide.
  4. Add the source images with AddImage and place them with AddPictureFrame.
  5. Render the slide with GetImage and save it with ImageFormat::Bmp.

Built with Aspose.Slides

Merge Image to BMP Online

The free Aspose.Slides Merger app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own Image files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides merges files before you write code.
  • Upload several Image files and combine them into one BMP file.
  • Download the merged result as one file.

Merge other files

You can also combine files in other formats.