Hi Douglas,
Am Freitag, den 11.11.2005, 19:59 +0000 schrieb Douglas Staas:
> I'd like to reiterate the following question:
>
> How can I select an graphic object programmatically? Or more to the
> point, how can I determine a graphic's original aspect ratio? A
> current code snippet that expects the graphic to already be selected
> is below. I already have a handle on the object in question
> ( ie: from a loop based on its name using: oPage.getByIndex( i ) ).
For questions on drawing objects you may want to look at ooomacros.org.
A guy named Danny Brewer (hopefully written correctly) made some
libraries and demos doing lots of amazing fun with draw.
If you're using OO.o2.0 you can set watches to a variable (a drawing
object or the docs drawpage in this case) and stop by a breakpoint in
the line after initializing this variable. If you're there look at the
watches window an investigate on the properties of the var - it'll tell
you mostly anything. :)
If you're on version 1.x the nice XRay-macro does similar things, but
someone else has to help here because I've got no URL for that one.
>
> oDocCtrl = ThisComponent.getCurrentController()
> oDocFrame = oDocCtrl.getFrame()
> oDispatchHelper = createUnoService(
> "com.sun.star.frame.DispatchHelper" )
> oDispatchHelper.executeDispatch( oDocFrame, ".uno:OriginalSize",
> "", 0, Array() )
> OriginalAspectRatio = oGraph.size.width / oGraph.size.height
> oSize.height=1250
> oSize.width= OriginalAspectRatio * oSize.height
> oGraph.setSize(oSize)
For getting you started (from my memory, not tested):
oPages = oDoc.GetDrawpages
oPage = oPages(0) ' mostly anything is drawn on the first layer
for i=0 to p.getCount()
oShape = p.getByIndex(i) ' set a watch on oShape
next ' put a breakpoint here
HTH,
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]