Shape
ภาพรวม
Shape เป็นคลาสใน Aspose.Words FOSS สำหรับ Python. สืบทอดจาก: BaseModel, NodeCastMixin.
วัตถุ Shape เปิดเผยคุณสมบัติด้านเรขาคณิตและเนื้อหาเช่น ความกว้าง, ความสูง, image_data และ text_box, และสามารถแคสต์เป็นประเภทโหนดอื่นผ่าน as_body(), as_paragraph(), etc.
คลาสนี้ให้ 8 เมธอดสำหรับทำงานกับวัตถุ Shape ในโปรแกรม Python. เมธอดที่มีรวมถึง: as_body, as_cell, as_paragraph, as_row, as_run, as_section, as_shape, as_table. สมาชิกสาธารณะทั้งหมดสามารถเข้าถึงได้จากแอปพลิเคชัน Python ใดก็ได้หลังจากติดตั้งแพคเกจ Aspose.Words FOSS สำหรับ Python. คุณสมบัติ: allow_overlap, alternative_text, anchor_locked, behind_text, fill_color, has_image, และอีก 18 รายการ.
คุณสมบัติ
| ชื่อ | ประเภท | การเข้าถึง | คำอธิบาย |
|---|---|---|---|
type | str | อ่าน | รับค่าประเภท. |
shape_type | `int | None` | อ่าน |
name | str | อ่าน | รับชื่อ. |
alternative_text | str | อ่าน | รับข้อความแทน. |
width | `float | None` | อ่าน |
height | `float | None` | อ่าน |
is_inline | `bool | None` | อ่าน |
has_image | `bool | None` | อ่าน |
image_data | Optional[ImageData] | อ่าน | รับข้อมูลภาพ. |
text_box | `dict[str, Any] | None` | อ่าน |
fill_color | str | อ่าน | รับสีเติม. |
stroke | Optional[Border] | อ่าน | รับค่า stroke. |
text_box_anchor | int | อ่าน | รับจุดยึดของกล่องข้อความ. |
wrap_type | int | อ่าน | รับค่าประเภทการห่อ. |
relative_horizontal_position | int | อ่าน | รับตำแหน่งแนวนอนสัมพัทธ์. |
relative_vertical_position | int | อ่าน | รับตำแหน่งแนวตั้งสัมพันธ์. |
left | float | อ่าน | รับค่า left. |
top | float | อ่าน | รับค่าบน. |
horizontal_alignment | int | อ่าน | รับการจัดแนวนอน. |
vertical_alignment | int | อ่าน | รับการจัดตำแหน่งแนวตั้ง. |
behind_text | bool | อ่าน | รับข้อความเบื้องหลัง. |
allow_overlap | bool | อ่าน | รับค่า allow overlap. |
is_layout_in_cell | bool | อ่าน | รับค่า is layout ในเซลล์. |
anchor_locked | bool | อ่าน | รับค่า anchor ที่ล็อกไว้. |
วิธีการ
| ลายเซ็น | คำอธิบาย |
|---|---|
as_body() | เรียก as_body บนอินสแตนซ์ Shape นี้. |
as_cell() | เรียก as_cell บนอินสแตนซ์ Shape นี้. |
as_paragraph() | เรียก as_paragraph บนอินสแตนซ์ Shape นี้. |
as_row() | เรียก as_row บนอินสแตนซ์ Shape นี้. |
as_run() | เรียก as_run บนอินสแตนซ์ Shape นี้. |
as_section() | เรียก as_section บนอินสแตนซ์ Shape นี้. |
as_shape() | เรียก as_shape บนอินสแตนซ์ Shape นี้. |
as_table() | เรียก as_table บนอินสแตนซ์ Shape นี้. |