将图像添加到当前幻灯片中 [英] Add images into current slide.

查看:108
本文介绍了将图像添加到当前幻灯片中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我使用c#.net 2008和vsto为powerpoint开发了一个com-addins。使用我的插件,将图像插入幻灯片。再次将图像插入幻灯片,新图像被删除在上一张图片上。我想通过使用代码在前一个图像的位置后显示新图像。我该怎么办?

谢谢你发誓

Hello,
           i develop a com-addins for powerpoint using c#.net 2008 and vsto.With my add-in , insert an image into a slide.Again inserted an image into a slide , the new image plced on the previous image. I want to display the new image after the position of previous image by using code. How can i do that?

Thanks
Dileep

推荐答案

嗨D D! >当您将图像插入幻灯片时,您必须考虑传递给 Shape.AddPicture()方法的位置参数,即 left 顶部参数。
我认为您的新图像被放置在上一张图像的顶部,因为您对两张图像使用了相同的参数。

看看这个代码:

浮子position_left_image1 = 0;
浮子position_top_image1 = 0;
浮子高度_image1 = 100;

浮子position_left_image2 = 0;
浮点position_top_image2 = position_top_image1 + height_image1;

PowerPoint.Presentation演示;

Shape shapeImage1 = presentation.Slides [1] .AddPicture(.. 。,...,...,position_left_image1,position_top_image1,...,...);
Shape shapeImage2 = presentation.Slides [1] .AddPicture(...,...,... ,position_left_image2,position_top_ima ge2,...,...);

Hi Dileep!

When you insert images onto your slide, you have to consider the position parameters you pass to the Shape.AddPicture() method,
which is the left and top parameters.
I suppose your new image is being placed on top of the previous image because you used the same parameters for the two images.

Check out this code:



float position_left_image1 = 0;
float position_top_image1 = 0;
float height_image1 = 100;

float position_left_image2 = 0;
float position_top_image2 = position_top_image1 + height_image1;

PowerPoint.Presentation presentation;

Shape shapeImage1 = presentation.Slides[1].AddPicture(..., ..., ..., position_left_image1, position_top_image1, ..., ...);
Shape shapeImage2 = presentation.Slides[1].AddPicture(..., ..., ..., position_left_image2, position_top_image2, ..., ...);


这篇关于将图像添加到当前幻灯片中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆