我使用以下代码将图像从PowerPoint保存到本地磁盘:
var shape = presentation.Slides[1].Shapes[1];
shape.Copy(); //copy a shape from a slide to clipboard
bool imgOk = Clipboard.ContainsImage(); //check if copied shape is an image
if (imgOk)
{
Console.WriteLine(imgOk.ToString());
Image img = Clipboard.GetImage();
string filepath = @"D:\Peak Sourcing\Work\ppt_test\img.jpg";
img.Save(filepath);
}
ppt中只有一张幻灯片有一张图片。但图片不会被复制到剪贴板。怎么解决这个问题?