如何获取 msoShapeRoundedRectangularCallout 上标注箭头的方向?
How do I get the direction of a callout arrow on a msoShapeRoundedRectangularCallout?
我正在保存演示文稿中的形状图像,但我不知道如何在带有标注的圆角矩形上获取标注箭头的距离和方向。 MSOautoshape 106: 黄色角在左上角位置,但图像保存的图像由于标注而有偏移。
var tempString = shape.AutoShapeType.ToString();
if ( tempString.Contains("Callout")){
Debug.WriteLine(shape.Callout.Angle);
}
此代码抛出一个错误,它仅适用于 "LINE" 标注。我对如何解决这个问题有点不知所措。请帮忙
Callout
属性 实际上只对“线路标注”有效:
问题中显示的那种形状使用Adjustments
属性 到 read/control 的设置到一个形状:
Word.Shape shp = ActiveDocument.Shapes[1];
Word.Adjustments = adj = shp.Adjustments;
for (int p = 1; p<=adj.Count; p++)
{
Debug.Print(adj.Item[p].ToString());
}
有必要对特定 Shape
和各种生成的设置进行试验,以确定各种值的含义。在我对指定形状的测试中,我得到了三个调整值。第一个似乎表示标注的 angle/offset,第二个 length/distance 到矩形,第三个我无法确定(是静态的)。
来自对象模型语言参考:
Type of Adjustment Valid values
Linear (horizontal or vertical)
Generally the value 0.0 represents the left or top edge of the shape
and the value 1.0 represents the right or bottom edge of the shape.
Valid values correspond to valid adjustments you can make to the shape
manually. For example, if you can only pull an adjustment handle half
way across the shape manually, the maximum value for the corresponding
adjustment will be 0.5. For shapes such as callouts, where the values
0.0 and 1.0 represent the limits of the rectangle defined by the starting and ending points of the callout line, negative numbers and
numbers greater than 1.0 are valid values.
Radial
An adjustment value of 1.0 corresponds to the width of the shape. The maximum value is
0.5, or half way across the shape.
Angle
Values are expressed in degrees. If you specify a value outside the range – 180 to 180, it
will be normalized to be within that range.
我正在保存演示文稿中的形状图像,但我不知道如何在带有标注的圆角矩形上获取标注箭头的距离和方向。 MSOautoshape 106: 黄色角在左上角位置,但图像保存的图像由于标注而有偏移。
var tempString = shape.AutoShapeType.ToString();
if ( tempString.Contains("Callout")){
Debug.WriteLine(shape.Callout.Angle);
}
此代码抛出一个错误,它仅适用于 "LINE" 标注。我对如何解决这个问题有点不知所措。请帮忙
Callout
属性 实际上只对“线路标注”有效:
问题中显示的那种形状使用Adjustments
属性 到 read/control 的设置到一个形状:
Word.Shape shp = ActiveDocument.Shapes[1];
Word.Adjustments = adj = shp.Adjustments;
for (int p = 1; p<=adj.Count; p++)
{
Debug.Print(adj.Item[p].ToString());
}
有必要对特定 Shape
和各种生成的设置进行试验,以确定各种值的含义。在我对指定形状的测试中,我得到了三个调整值。第一个似乎表示标注的 angle/offset,第二个 length/distance 到矩形,第三个我无法确定(是静态的)。
来自对象模型语言参考:
Type of Adjustment Valid values
Linear (horizontal or vertical)
Generally the value 0.0 represents the left or top edge of the shape and the value 1.0 represents the right or bottom edge of the shape. Valid values correspond to valid adjustments you can make to the shape manually. For example, if you can only pull an adjustment handle half way across the shape manually, the maximum value for the corresponding adjustment will be 0.5. For shapes such as callouts, where the values 0.0 and 1.0 represent the limits of the rectangle defined by the starting and ending points of the callout line, negative numbers and numbers greater than 1.0 are valid values.
Radial
An adjustment value of 1.0 corresponds to the width of the shape. The maximum value is 0.5, or half way across the shape.
Angle
Values are expressed in degrees. If you specify a value outside the range – 180 to 180, it will be normalized to be within that range.