UNO access pixel coordinates of shapes during presentation

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
urbov
Posts: 1
Joined: Tue Jul 26, 2016 6:38 pm

UNO access pixel coordinates of shapes during presentation

Post by urbov »

Hello,

I'd like to access the bounding-box of each shape on the current slide of my presentation in screen (pixel) coordinates. Could someone point me into the right directions.

XShape getPosition/getSize: https://www.openoffice.org/api/docs/com ... Shape.html

but how to tranform these units into pixel coordinates?

How does Shape:HomogenMatrix3 play its role here?

https://www.openoffice.org/api/docs/com ... Shape.html


Thanks for your help.
OpenOffice 4.1.2 on Windows 8
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: UNO access pixel coordinates of shapes during presentati

Post by Zizi64 »

but how to tranform these units into pixel coordinates?
The Impress is a vectorgraphic application. Therefore it has not a fixed display/slide resolution value. The actual pixel resolution of a slide (what is containing some vectorgraphic shapes) will depend on the zoom level, and the physical display resolution. The "pixel resolution" of the actual view of the shapes will be recalculated for every zoom level...

You can try make a estimating calculation of the pixel-coordinates based on the slide and shape size (mm or inch), the coordinates of the shapes (mm or inch) and the zoom level and the resolution of the display (pixels). At the "Full screen" view, the resolution of the slide and the resolution of the display will be approximately equal - but only when the ratio of the display and theratio of slide (4/3; 16/9; 16/10; etc...) is same).
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply