在 Python 中將圖像合併為 BMP
用於使用 Python 代碼將圖像合併為 BMP 文件的高速跨平台 Python 庫
使用 Aspose.Slides 將圖像合併為 BMP
Aspose.Slides for Python via .NET 是一個強大的 Python 庫,用於創建、轉換、合併和操作演示文稿、PDF 、圖像和其他文件。當您將圖像合併為 BMP 時,您實際上是在組合圖像以獲得單個 BMP 文件。
在 Python 中將圖像合併為 BMP
使用 Aspose.Slides for Python via .NET ,只需幾行代碼即可快速將圖像合併到 BMP
將圖像合併為 BMP 的 Python 代碼
import aspose.slides as slides
import aspose.pydrawing as drawing
with slides.Presentation() as pres:
slide = pres.slides[0]
image1 = pres.images.add_image(drawing.Bitmap("image1.png"))
slide.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 0, 100, 100, image1)
image2 = pres.images.add_image(drawing.Bitmap("image2.png"))
slide.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 200, 100, 100, image2)
for sld in pres.slides:
bmp = sld.get_thumbnail(1, 1)
bmp.save("Slide_{num}.bmp".format(num=str(sld.slide_number)), drawing.imaging.ImageFormat.bmp)
如何在 Python 中將圖像合併為 BMP
通過 .NET 安裝 Aspose.Slides for Python。請參閱 安裝 。
添加庫作為項目中的引用。
創建一個 Presentation 類的實例。
加載要合併為相框的圖像。
保存生成的 BMP 文件。
在線合併 PDF 文件
合併其他文件
您還可以合併其他格式的文件以獲得單個文件