首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何获得powerpoint形状的动画属性?

如何获得powerpoint形状的动画属性?
EN

Stack Overflow用户
提问于 2013-02-08 15:32:41
回答 1查看 215关注 0票数 0
代码语言:javascript
复制
foreach (PowerPoint.AnimationSettings animation in currentslide.Shapes)
{
     getAnimation(ref XmlTextWriter xmlcreate, PowerPoint.Shape shape, int i)
}

private void getAnimation(ref XmlTextWriter xmlcreate, PowerPoint.Shape shape, int i)
    {
        xmlcreate.WriteStartElement("animation",""); //<animation id="Animasyon8" type="Animasyon" userfriendlyindex="2">
        xmlcreate.WriteAttributeString("id", "animasyon" + shape.Id);
        xmlcreate.WriteAttributeString("type", "animasyon");
        xmlcreate.WriteAttributeString("userfriendlyindex", i.ToString());
        xmlcreate.WriteElementString("duration", "1");         //<duration>1</duration>
        xmlcreate.WriteElementString("start", "0");//<start>0</start>
        xmlcreate.WriteElementString("easing", "back");//<easing>back</easing>
        xmlcreate.WriteElementString("media", shape.Id.ToString());//<media>7</media>
        xmlcreate.WriteElementString("firstpositionx", shape.TextFrame2.MarginLeft.ToString());//<firstpositionx>206</firstpositionx>
        xmlcreate.WriteElementString("firstpositiony", shape.TextFrame2.MarginBottom.ToString());//<firstpositiony>64</firstpositiony>
        xmlcreate.WriteElementString("lastpositionx", "206");//<lastpositionx>206</lastpositionx>
        xmlcreate.WriteElementString("lastpositiony", "64");//<lastpositiony>64</lastpositiony>
        xmlcreate.WriteElementString("firstwidth",shape.Width.ToString());//<firstwidth>286</firstwidth>
        xmlcreate.WriteElementString("firstheight",shape.Height.ToString());//<firstheight>115</firstheight>
        xmlcreate.WriteElementString("firstalpha", "0");//<firstalpha>0</firstalpha>
        xmlcreate.WriteElementString("lastwidth","286");//<lastwidth>286</lastwidth>
        xmlcreate.WriteElementString("lastheight", "115");//<lastheight>115</lastheight>
        xmlcreate.WriteElementString("lastalpha", "1");//<lastalpha>1</lastalpha>
        xmlcreate.WriteEndElement();//</animation>
    }

如何才能从Powerpoint形状中获得这些信息(firstpositionx、firstpositiony、lastpositionx、lastpositiony、firstheight、firstwidth、lastheight、lastwidth、firstalpha和lastalpha)来插入我的xml文档?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-08 14:39:53

多亏了http://msdn.microsoft.com/en-us/library/office/aa155781(v=office.10).aspx,我才解决了问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14775961

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档