GroupShape类

GroupShape类

表示包含各个形状的组形状。

遗产: GroupShapeShape

GroupShape 类型公开以下成员:

特性

属性描述
macro_name获取和设置宏的名称。
is_equation指示形状是否仅包含方程。
is_smart_art指示形状是否为智能艺术。
z_order_position返回形状在 z 顺序中的位置。
name获取和设置形状的名称。
alternative_text返回或设置 Shape 对象的描述性(替代)文本字符串。
title指定当前形状对象的标题(说明文字)。
line_format返回一个 MsoLineFormat 对象,其中包含指定形状的线条格式属性。
fill_format返回一个 MsoFillFormat 对象,其中包含指定形状的填充格式属性。
line获取线条样式
fill返回一个 Shape.fill_format 对象,其中包含指定形状的填充格式属性。
shadow_effect表示一个 ShadowEffect 对象,该对象指定图表元素或形状的阴影效果。
reflection表示一个 ReflectionEffect 对象,该对象指定图表元素或形状的反射效果。
glow表示一个 GlowEffect 对象,该对象指定图表元素或形状的发光效果。
soft_edges获取并设置应用于边缘的模糊半径(以点为单位)。
three_d_format获取和设置形状的 3d 格式。
text_frame返回一个 TextFrame 对象,其中包含指定形状的对齐和锚定属性。
format_picture获取和设置图片格式选项。
is_hidden指示对象是否可见。
is_lock_aspect_ratioTrue 表示不允许更改纵横比。
rotation_angle获取和设置形状的旋转。
hyperlink获取形状的超链接。
id获取该形状的标识符。
spid指定应用程序可用于识别特定形状的可选字符串。
spt指定应用程序可用于将特定形状与定义的形状类型相关联的可选数字。
worksheet获取包含此形状的 Shape.worksheet 对象。
is_group指示形状是否是一个组。
is_in_group指示形状是否分组。
is_word_art指示该形状是否为艺术字。
text_effect返回一个 TextEffectFormat 对象,其中包含指定形状的文本效果格式设置属性。
适用于表示艺术字的形状对象。
is_locked如果对象被锁定,则为 True;如果在工作表受保护时可以修改对象,则为 False。
is_printable如果对象可打印则为 True
mso_drawing_type获取 mso 绘图类型。
auto_shape_type获取和设置自动形状类型。
anchor_type获取并设置形状锚点占位符。
placement表示绘图对象附加到其下面的单元格的方式。
该属性控制对象在工作表上的放置。
upper_left_row表示左上角行索引。
upper_delta_y获取或设置形状相对于其左上角行的垂直偏移量。
upper_left_column表示左上角列索引。
upper_delta_x获取或设置形状相对于其左上角列的水平偏移量。
lower_right_row代表右下角行索引。
lower_delta_y获取或设置形状相对于其右下角行的垂直偏移量。
lower_right_column代表右下角列索引。
lower_delta_x获取或设置形状相对于其右下角列的水平偏移量。
right表示形状相对于其右下角列的水平偏移的宽度,以像素为单位。
bottom表示形状相对于其下底角行的垂直偏移的宽度(以像素为单位)。
width表示形状的宽度,以像素为单位。
width_inch表示形状的宽度,单位为英寸。
width_pt表示形状的宽度,以点为单位。
width_cm表示形状的宽度,单位为厘米。
height表示形状的高度,以像素为单位。
height_inch表示形状的高度,单位为英寸。
height_pt表示形状的高度,以点为单位。
height_cm表示形状的高度,单位为厘米。
left表示形状相对于其左列的水平偏移量,以像素为单位。
left_inch表示形状相对于其左列的水平偏移量,以英寸为单位。
left_cm表示形状相对于其左列的水平偏移量,以厘米为单位。
top表示形状与其顶行的垂直偏移(以像素为单位)。
top_inch表示形状相对于其顶行的垂直偏移量,以英寸为单位。
top_cm表示形状相对于其顶行的垂直偏移量,以厘米为单位。
top_to_corner获取和设置形状距工作表顶部边框的垂直偏移量(以像素为单位)。
left_to_corner获取和设置形状距工作表左边框的水平偏移量。
x获取和设置形状相对于工作表左边框的水平偏移量,以像素为单位。
y获取和设置形状距工作表上边框的垂直偏移量(以像素为单位)。
width_scale获取和设置宽度比例,以原始图片宽度的百分比为单位。
如果形状不是图片,则WidthScale属性仅返回100;
height_scale获取和设置高度比例,单位为原始图片高度的百分比。
如果形状不是图片,则HeightScale属性仅返回100;
top_in_shape表示形状相对于父形状上边框的垂直偏移量,
以父形状高度的 1/4000 为单位。
left_in_shape表示形状相对于父形状左边框的水平偏移,
以父形状宽度的 1/4000 为单位。
width_in_shape表示形状的宽度,单位为父形状的 1/4000。
height_in_shape表示形状相对于父形状上边框的垂直偏移量,单位为父形状高度的1/4000。
group获取包含该形状的组形状。
type获取自动形状类型。
has_line获取和设置形状的线边框是否可见。
is_filled指示填充格式是否可见。
is_flipped_horizontally获取并设置形状是否水平翻转。
is_flipped_vertically获取并设置形状是否垂直翻转。
actual_lower_right_row获取实际的底行。
connection_points获取连接点
relative_to_original_picture_size指示形状是否相对于原始图片尺寸。
linked_cell获取或设置链接到控件值的工作表范围。
input_range获取或设置用于填充指定组合框的工作表范围。
text_shape_type获取和设置预设文本形状类型。
text_body获取和设置形状文本的设置。
font代表形状的字体。
text_options代表形状的文本选项。
text表示此 TextBox 对象中的字符串。
is_rich_text文本是否为富文本。
html_text获取和设置包含此文本框中的数据和某些格式的 html 字符串。
text_vertical_overflow获取和设置包含文本的形状的文本垂直溢出类型。
text_horizontal_overflow获取和设置包含文本的形状的文本水平溢出类型。
is_text_wrapped获取和设置包含文本的形状的文本环绕类型。
text_orientation_type获取和设置形状的文本方向类型。
text_horizontal_alignment获取和设置形状的文本水平对齐类型。
text_vertical_alignment获取和设置形状的文本垂直对齐类型。
text_direction获取/设置该对象的文本流方向。
control_data获取控制数据。
active_x_control获取 ActiveX 控件。
paths获取自定义几何形状的路径。
geometry获取几何图形
create_id获取并设置该形状的创建 ID。

通过索引获取子形状。

索引器

名称描述
[index]儿童体型指数。

方法

方法描述
to_image创建形状图像并将其以指定格式保存到流中。
to_image将形状保存到文件中。
to_image将形状保存到流中。
format_characters使用字体设置格式化一些字符。
format_characters使用字体设置格式化一些字符。
get_result_of_smart_art将智能艺术转换为分组形状。
to_front_or_back将形状置于前面或将形状置于后面。
get_locked_property获取锁定属性的值。
set_locked_property设置锁定属性。
add_hyperlink添加到形状的超链接。
remove_hyperlink删除形状的超链接。
move_to_range将形状移动到指定范围。
align_top_right_corner将图片移动到右上角。
get_connection_points获取连接点
get_linked_cell获取链接到控件值的范围。
set_linked_cell设置链接到控件值的范围。
get_input_range获取用于填充控件的范围。
set_input_range设置用于填充控件的范围。
update_selected_value用链接单元格的值更新所选值。
calculate_text_size重新计算文本区域
characters返回一个 Characters 对象,该对象表示文本中的一系列字符。
get_characters返回所有字符对象
表示文本中的一系列字符。
get_rich_formattings返回所有字符对象
表示文本中的一系列字符。
remove_active_x_control删除 ActiveX 控件。
is_same_setting返回形状是否相同。
get_actual_box获取形状的实际位置和大小(应用旋转、翻转等后)
ungroup取消形状项目的分组。
get_grouped_shapes获取按此形状分组的形状。

例子

from aspose.cells import Workbook
from aspose.cells.drawing import MsoLineDashStyle, MsoLineStyle, PlacementType
from aspose.pydrawing import Color

# Instantiate a new Workbook.
excelbook = Workbook()
# Add a group box to the first worksheet.
box = excelbook.worksheets[0].shapes.add_group_box(1, 0, 1, 0, 300, 250)
# Set the caption of the group box.
box.text = "Age Groups"
box.placement = PlacementType.FREE_FLOATING
# Make it 2-D box.
box.shadow = False
# Add a radio button.
radio1 = excelbook.worksheets[0].shapes.add_radio_button(3, 0, 2, 0, 30, 110)
# Set its text string.
radio1.text = "20-29"
# Set A1 cell as a linked cell for the radio button.
radio1.linked_cell = "A1"
# Make the radio button 3-D.
radio1.shadow = True
# Set the foreground color of the radio button.
radio1.fill_format.fore_color = Color.light_green
# Set the line style of the radio button.
radio1.line_format.style = MsoLineStyle.THICK_THIN
# Set the weight of the radio button.
radio1.line_format.weight = 4.0
# Set the line color of the radio button.
radio1.line_format.fore_color = Color.blue
# Set the dash style of the radio button.
radio1.line_format.dash_style = MsoLineDashStyle.SOLID
# Make the line format visible.
radio1.line_format.is_visible = True
# Make the fill format visible.
radio1.fill_format.is_visible = True
# Add another radio button.
radio2 = excelbook.worksheets[0].shapes.add_radio_button(6, 0, 2, 0, 30, 110)
# Set its text string.
radio2.text = "30-39"
# Set A1 cell as a linked cell for the radio button.
radio2.linked_cell = "A1"
# Make the radio button 3-D.
radio2.shadow = True
# Set the foreground color of the radio button.
radio2.fill_format.fore_color = Color.light_green
# Set the line style of the radio button.
radio2.line_format.style = MsoLineStyle.THICK_THIN
# Set the weight of the radio button.
radio2.line_format.weight = 4.0
# Set the line color of the radio button.
radio2.line_format.fore_color = Color.blue
# Set the dash style of the radio button.
radio2.line_format.dash_style = MsoLineDashStyle.SOLID
# Make the line format visible.
radio2.line_format.is_visible = True
# Make the fill format visible.
radio2.fill_format.is_visible = True
# Add another radio button.
radio3 = excelbook.worksheets[0].shapes.add_radio_button(9, 0, 2, 0, 30, 110)
# Set its text string.
radio3.text = "40-49"
# Set A1 cell as a linked cell for the radio button.
radio3.linked_cell = "A1"
# Make the radio button 3-D.
radio3.shadow = True
# Set the foreground color of the radio button.
radio3.fill_format.fore_color = Color.light_green
# Set the line style of the radio button.
radio3.line_format.style = MsoLineStyle.THICK_THIN
# Set the weight of the radio button.
radio3.line_format.weight = 4.0
# Set the line color of the radio button.
radio3.line_format.fore_color = Color.blue
# Set the dash style of the radio button.
radio3.line_format.dash_style = MsoLineDashStyle.SOLID
# Make the line format visible.
radio3.line_format.is_visible = True
# Make the fill format visible.
radio3.fill_format.is_visible = True
# Get the shapes.
shapeobjects = [box, radio1, radio2, radio3]
# Group the shapes.
group = excelbook.worksheets[0].shapes.group(shapeobjects)
# Save the excel file.
excelbook.save("groupshapes.xls")

也可以看看