Merge Images to BMP in PHP
Arrange multiple images on a slide and render them as a single BMP file with Aspose.Slides for PHP via Java.
Merge Images to BMP in PHP
Load the source files with Images::fromFile, add them to the slide with addPictureFrame, render the slide with getImage, and save the result with ImageFormat::Bmp.
PHP code for merging images into BMP
$presentation = new Presentation();
try {
$slide = $presentation->getSlides()->get_Item(0);
$firstSourceImage = Images::fromFile("image1.png");
try {
$firstPresentationImage = $presentation->getImages()->addImage($firstSourceImage);
} finally {
$firstSourceImage->dispose();
}
$secondSourceImage = Images::fromFile("image2.jpg");
try {
$secondPresentationImage = $presentation->getImages()->addImage($secondSourceImage);
} finally {
$secondSourceImage->dispose();
}
$slide->getShapes()->addPictureFrame(
ShapeType::Rectangle, 0, 0, 360, 270, $firstPresentationImage);
$slide->getShapes()->addPictureFrame(
ShapeType::Rectangle, 360, 0, 360, 270, $secondPresentationImage);
$slideImage = $slide->getImage(1.0, 1.0);
try {
$slideImage->save("merged-image.bmp", ImageFormat::Bmp);
} finally {
$slideImage->dispose();
}
} finally {
$presentation->dispose();
}Merge Images to BMP using Aspose.Slides
Aspose.Slides for PHP via Java lets you place multiple images on one presentation slide and render the composed slide as a single BMP file. The example below arranges two images side by side, but you can use the same approach for other layouts.
How to merge images to BMP in PHP
- Install Aspose.Slides for PHP via Java. See Installation.
- Configure Aspose.Slides in your PHP project.
- Create a
Presentationand access its first slide through a variable. - Load the source images with
Images::fromFileand place them on the slide withaddPictureFrame. - Render the slide with
getImageand save the result withImageFormat::Bmp.
Built with Aspose.Slides
Merge Image to BMP Online
The free Aspose.Slides Merger app is built with Aspose.Slides for PHP via Java, 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 supported formats.