I’ve been digging around the documentation and inspecting examples, but I can’t quite gather the information I look for. This is about images and how they’re represented from UNO’s perspective; let’s look at TextGraphicObject for now:
Dimensions.
I thought that ActualSize contains the original dimension of an image, as documented, but that doesn’t seem the case. The original image (720×540px, 72px/in) dropped into Writer has the following ActualSize and Size properties:
Code: Select all
(com.sun.star.awt.Size){ Width = (long)0x40f1, Height = (long)0x30b5 } // 16625×12469
(com.sun.star.awt.Size){ Width = (long)0x319c, Height = (long)0x2535 } // 12700×9525
Code: Select all
(com.sun.star.awt.Size){ Width = (long)0xb46, Height = (long)0x87b } // 2886×2171
(com.sun.star.awt.Size){ Width = (long)0x5a6, Height = (long)0x43d } // 1446×1085
Relative Width.
However, what I’m more interested in is the size/width of the image relative to the page’s size/width. But where do I find that page size information?
Alignment.
I’m stomped, I haven’t found where the alignment of an image is stored. There is a getPosition for Shapes (but not for TextGraphicObjects) from which I may approximate an alignment relative to the page dimensions. But considering that Word has an explicit alignment (left, center, right relative to page or text) I can’t find an equivalent here.
Mirroring.
I was surprised to see that the horizontally mirrored properties exist for odd and even pages, whereas the vertically mirrored property does not. Is that correct? And why would that be so?
Rotation.
A rotated image seems to be embedded in a ShapeCollection whose only child is the image. That’s what MRI tells me. However, iterating over the document’s DrawPages yields the image, not its collection. Anyway, it seems that rotation is expressed by two properties, GraphicRotation (no docs) which is either 0 or not defined, and RotateAngle which seems only documented in a deprecated RotationDescriptor. The value of RotateAngle (if defined) seems to be a counter-clockwise angle multiplied by 100?
Naming.
It looks like Shapes in particular have a Name and a LinkDisplayName properties, both indicating the “kind” of the shape, e.g. “Rounded Rectangular Callout n”. Are these fixed to identify the visual shape, or are these names that can be changed; if so, where can I find the actual shape definition for a Shape object?
Other Properties.
In general I noticed that the list of actual properties in MRI far exceeds the ones documented for the TextGraphicObject.