在 PowerPoint 2007 中,如何以编程方式定位标注的尾部?

发布于 2024-08-13 11:57:14 字数 1080 浏览 12 评论 0 原文

我正在查看 PowerPoint 2007 文件的 DrawingML,这就是标注对象的坐标和几何图形:

<p:spPr>
    <a:xfrm>
        <a:off x="2819400" y="5181600"/> // X,Y Position of Callout Box
        <a:ext cx="609600" cy="457200"/> // Width,Height of Callout Box
    </a:xfrm>
    <a:prstGeom prst="wedgeRectCallout">
        <a:avLst>
            <a:gd name="adj1" fmla="val 257853"/> // X Position Of Tail
            <a:gd name="adj2" fmla="val -532360"/> // Y Position of Tail
        </a:avLst>
    </a:prstGeom>
    <a:solidFill>
        <a:schemeClr val="accent1">
            <a:alpha val="50000"/>
        </a:schemeClr>
    </a:solidFill>
</p:spPr>

我遇到的问题是告诉它将尾部放置在幻灯片上特定坐标的公式。我已经尝试过这个来计算它,但它不能正常工作。

//This gives me the distance between the Coordinate and the Center of the Callout.
DistanceX = Coordinate.X - (Callout.X + Callout.X_Ext)/2
DistanceY = Coordinate.Y - (Callout.Y + Callout.Y_Ext)/2

但是,几何值不是两点之间的距离。

有谁知道这个的计算公式是什么?

I'm looking at the DrawingML of a PowerPoint 2007 file and this is what it has for the Callout object's coordinates and geometry:

<p:spPr>
    <a:xfrm>
        <a:off x="2819400" y="5181600"/> // X,Y Position of Callout Box
        <a:ext cx="609600" cy="457200"/> // Width,Height of Callout Box
    </a:xfrm>
    <a:prstGeom prst="wedgeRectCallout">
        <a:avLst>
            <a:gd name="adj1" fmla="val 257853"/> // X Position Of Tail
            <a:gd name="adj2" fmla="val -532360"/> // Y Position of Tail
        </a:avLst>
    </a:prstGeom>
    <a:solidFill>
        <a:schemeClr val="accent1">
            <a:alpha val="50000"/>
        </a:schemeClr>
    </a:solidFill>
</p:spPr>

What I'm having trouble with is the formula for telling it to place the tail at a particular coordinate on the slide. I've tried this to calculate it, but it does not work correctly.

//This gives me the distance between the Coordinate and the Center of the Callout.
DistanceX = Coordinate.X - (Callout.X + Callout.X_Ext)/2
DistanceY = Coordinate.Y - (Callout.Y + Callout.Y_Ext)/2

But, the geometric value is not the distance between the two points.

Anybody know what the formula is for calculating this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟凡古楼 2024-08-20 11:57:14

我想我已经弄清楚了这个公式:

DistanceX = Coordinate.X - (Callout.X + (Callout.X_Ext/2))
DistanceY = Coordinate.Y - (Callout.Y + (Callout.Y_Ext/2))

TailX = (DistanceX/Callout.X_Ext) * 100000
TailY = (DistanceY/Callout.Y_Ext) * 100000

I think I've figured out the formula:

DistanceX = Coordinate.X - (Callout.X + (Callout.X_Ext/2))
DistanceY = Coordinate.Y - (Callout.Y + (Callout.Y_Ext/2))

TailX = (DistanceX/Callout.X_Ext) * 100000
TailY = (DistanceY/Callout.Y_Ext) * 100000
深海少女心 2024-08-20 11:57:14

如果可以进行调整,这可能是一个很好的快速方法 - 我还没有测试过。但是,如果我明白你在问什么,那就是如何获取屏幕上特定位置处 wedgeRectCallout 尾部点的 x/y,包括调整尾部大小/位置的情况。我假设您有预定义的 wedgeRectCallout 大小。

您想要的值需要从presetShapeDefinitions.xml 中计算(通过Ecma 下载找到它)。您想要的值位于 wedgeRectCallout 元素中:

<lnTo>
<pt x="xb" y="yb" />
</lnTo>

那么如何计算 x=xby=yb 呢?转至 Ecma 文档并查看如何阅读其中的公式
DrawingML - 框架参考材料 ->绘图 ML - 主要 ->形状定义和属性 -> gd(形状参考线)并计算gdLst中的形状参考线(采用默认或修改后的调整值)。在这种情况下,您需要计算所有/大多数指南以确保获得 xb 和 yb 的值。

如果您遇到任何问题或对此有更多疑问,请告诉我。

That may be a good quick way to do this if the adjustments are available - I haven't tested it. However, if I understand what you're asking, it is how get the x/y of the wedgeRectCallout's tail point at a particular location on screen, including the case where the size/location of the tail is adjusted. I assume you have a predefined size of the wedgeRectCallout.

The value you want needs to be calculated from presetShapeDefinitions.xml (find it with the Ecma downloads). The value you want is here in the wedgeRectCallout element:

<lnTo>
<pt x="xb" y="yb" />
</lnTo>

So how do you calculate x=xb and y=yb? Go to the Ecma docs and view how to read formulas in
DrawingML - Framework Reference Material -> Drawing ML - Main -> Shape Definitions and Attributes -> gd (Shape Guide) and calculate the shape guides in gdLst (which takes the value of default or modified adjustments). In this case, you'll need to calculate all/most guides to ensure you get the values for xb and yb.

Let me know if you run into any issues or have more questions on this.

逆夏时光 2024-08-20 11:57:14

在presetShapeDefinitions.xml文件中,它定义了绘制形状所需的参数和公式,如果您查看形状“wedgeRectCallout”,您将看到许多标签,例如: , , <代码>
了解如何绘制形状所需的重要标签是: 包含形状的公式, 说明如何绘制形状。
我编写了一个小程序,将文件 PresetShapeDefinitions.xml 中的所有公式转换为 javascript。
点击此处进入该程序的网站页面。
这个程序帮助我构建了 PPTXjs 插件,用于将 PPTX 文件转换为 HTML。
希望这有帮助。

in presetShapeDefinitions.xml file , Which defines the parametrs and formulas needed to draw the shapes,if youe look about the shape "wedgeRectCallout" you will see number of tags like : <avLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> , <gdLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> , <ahLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">, <cxnLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">, <rect l="l" t="t" r="r" b="b" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main" /> and <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">.
The important tags the needed to understand how to draw the shape are: <gdLst> and <pathLst>.<gdLst> Contains the formulas of the shape , and <pathLst> says how to draw the shape.
I wrote a small program that translates to javascript all the formulas in the file presetShapeDefinitions.xml.
To the website page of the program click here.
This program helped me build the PPTXjs plugin that converts PPTX files to HTML.
Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文