ooodev.format.inner.direct.write.fill.area.img module
Module for Fill Properties Fill Image.
New in version 0.9.0.
- class ooodev.format.inner.direct.write.fill.area.img.Img(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False)[source]
Bases:
StyleBase
Class for Fill Properties Fill Image.
See also
New in version 0.9.0.
- __init__(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False)[source]
Constructor
- Parameters:
bitmap (XBitmap, optional) – Bitmap instance. If
name
is not already in the Bitmap Table then this property is required.name (str, optional) – Specifies the name of the image. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.
mode (ImgStyleKind, optional) – Specifies the image style, tiled, stretched etc. Default
ImgStyleKind.TILED
.size (SizePercent, SizeMM, optional) – Size in percent (
0 - 100
) or size inmm
units.position (RectanglePoint) – Tiling position of Image.
pos_offset (Offset, optional) – Tiling position offset.
tile_offset (OffsetColumn, OffsetRow, optional) – The tiling offset.
auto_name (bool, optional) – Specifies if
name
is ensured to be unique. Defaults toFalse
.
- Return type:
None
Note
If
auto_name
isFalse
then a bitmap for a givenname
is only required the first call. All subsequent call of the samename
will retrieve the bitmap form the LibreOffice Bitmap Table.See also
- apply(obj: Any)[source]
- apply(obj, **kwargs)
Applies styles to object
- Parameters:
obj (object) – UNO object that has supports
com.sun.star.style.FillProperties
orcom.sun.star.beans.PropertySet
service.- Return type:
None
- copy()[source]
- copy(**kwargs)
- copy(**kwargs)
Gets a copy of instance as a new instance
- Return type:
TypeVar
(_TImg
, bound= Img)- Parameters:
self (_TImg) –
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO object.
- Raises:
NotSupportedError – If
obj
is not supported.- Returns:
Img
instance that representsobj
fill image.- Return type:
- classmethod from_preset(preset)[source]
- classmethod from_preset(preset, **kwargs)
- classmethod from_preset(preset, **kwargs)
Gets an instance from a preset.
- Parameters:
preset (PresetImageKind) – Preset.
- Returns:
Instance from preset.
- Return type:
- on_property_restore_setting(source, event_args)[source]
Triggers before each property that is about to be set during restore
- Parameters:
source (Any) – Event Source.
event_args (KeyValueCancelArgs) – Event Args
- Return type:
None
- property prop_bitmap: XBitmap | None
Gets bitmap
- Return type:
XBitmap | None
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_is_offset_column: bool
Gets if the offset value is a column offset.
- Return type:
bool
- property prop_is_offset_row: bool
Gets if the offset value is a row offset.
- Return type:
bool
- property prop_is_size_mm: bool
Gets if size is stored in
mm
units.- Return type:
bool
- property prop_is_size_percent: bool
Gets if size is stored in percentage units.
- Return type:
bool
- property prop_mode: ImgStyleKind | None
Gets/Sets if fill image is tiled
- Return type:
ImgStyleKind | None
- property prop_position: RectanglePoint | None
Gets/Sets if fill image is tiled
- Return type:
RectanglePoint | None
- property prop_size: SizePercent | SizeMM | None
Gets/Sets if fill image is stretched
- Return type:
SizePercent | SizeMM | None
- property prop_tile_offset: OffsetColumn | OffsetRow | None
Gets/Sets Tile Offset
- Return type:
OffsetColumn | OffsetRow | None
- class ooodev.format.inner.direct.write.fill.area.img.ImgStyleKind(value)[source]
Bases:
Enum
Image Style Kind for Image Fill
- static from_bitmap_mode(value)[source]
Gets
ImgStyleKind
fromBitmapMode
- Return type:
- Parameters:
value (BitmapMode) –
- CUSTOM = BitmapMode.NO_REPEAT
Image does not repeat
- STRETCHED = BitmapMode.STRETCH
Image is stretched
- TILED = BitmapMode.REPEAT
Image Repeats