[使用C#填充PPT幻灯片图像

问题描述 投票:0回答:1

我有一个动态生成的图表,我将其存储为Image对象,现在想将其导出到PPT幻灯片。我尝试使用此处提出的教程(https://www.c-sharpcorner.com/forums/how-to-add-images-to-existing-ppt-slides-using-c-sharp),但该教程使用图像的path将其导出到幻灯片。虽然我有图像,但先将其保存到路径然后从那里导出它并没有什么意义。

这就是为什么我想知道是否有办法做到这一点?不使用图像的路径,而是使用实际的图像对象本身(或字节数组或类似的东西)。

感谢任何解决方案。

c# powerpoint
1个回答
0
投票

请参见函数Presentation.Images.Append(图像图像)。它将返回一个新的图像对象,然后可以将其放置在SlidePicture.PictureFill.Picture.EmbedImage上。也许您还必须先向“幻灯片”添加“ SlidePicture”。如果仍无法解决,请尝试进一步整理文档。这是我使用的来源:https://www.e-iceblue.com/Tutorials/Spire.Presentation/Spire.Presentation-Program-Guide/Image-and-Shapes/Replace-Image-with-New-Image-in-PowerPoint-in-C.html

© www.soinside.com 2019 - 2024. All rights reserved.