| View previous topic :: View next topic |
| Author |
Message |
yuanpeng General User

Joined: 23 Sep 2003 Posts: 18 Location: Taiwan
|
Posted: Sat Oct 23, 2004 5:32 pm Post subject: How to use the basic codes to make drawing object flip |
|
|
Hi everyone
I like to use some basic codes to make the drawing object flip vertically or horizontally.
 |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Mon Oct 25, 2004 6:31 am Post subject: |
|
|
Do you mean like this?
| Code: |
Sub Main
oDoc = ThisComponent
oDocCtrl = oDoc.getCurrentController()
oDocFrame = oDocCtrl.getFrame()
oDispatchHelper = createUnoService( "com.sun.star.frame.DispatchHelper" )
' Flip selected object vertically. (i.e. top becomes bottom, vice versa)
oDispatchHelper.executeDispatch( oDocFrame, ".uno:MirrorVert", "", 0, Array() )
' Flip selected object horizontally. (i.e. left becomes right, vice versa)
oDispatchHelper.executeDispatch( oDocFrame, ".uno:MirrorHorz", "", 0, Array() )
End Sub
|
_________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
yuanpeng General User

Joined: 23 Sep 2003 Posts: 18 Location: Taiwan
|
Posted: Sat Feb 26, 2005 8:23 am Post subject: |
|
|
Thank a lot, that's what I mean |
|
| Back to top |
|
 |
Tommy27 OOo Advocate


Joined: 18 Nov 2006 Posts: 300
|
Posted: Sun May 18, 2008 4:48 am Post subject: |
|
|
could you make a macro to rotate images in draw 90° left and 90° right?
i tried to record this macro but i've seen that the macro recording option is not enabled in Draw
http://www.openoffice.org/issues/show_bug.cgi?id=89609 |
|
| Back to top |
|
 |
Tommy27 OOo Advocate


Joined: 18 Nov 2006 Posts: 300
|
Posted: Mon May 19, 2008 8:22 pm Post subject: |
|
|
found the tight macros here: http://groups.google.it/group/it-alt.comp.software.openoffice/browse_thread/thread/6f79ba34b0c88ed8?hl=it#
| Code: |
Sub DrawRotateRight
'ruota tutte le forme selezionate di 90 gradi
oSelection = thiscomponent.currentselection
If Not IsNull(oSelection) Then
For I = 0 To oSelection.Count - 1
oShape = oSelection.getByIndex(I)
oShape.RotateAngle = -9000
Next I
End If
End Sub
Sub DrawRotateLeft
'ruota tutte le forme selezionate di 90 gradi
oSelection = thiscomponent.currentselection
If Not IsNull(oSelection) Then
For I = 0 To oSelection.Count - 1
oShape = oSelection.getByIndex(I)
oShape.RotateAngle = 9000
Next I
End If
End Sub |
you can create custom macros for any angle.
angle values must be expressed in the line
oShape.RotateAngle = 9000
9000 = 90°
3000= 30°
negative values rotate towards left
positive values rotate towards right |
|
| Back to top |
|
 |
Tommy27 OOo Advocate


Joined: 18 Nov 2006 Posts: 300
|
Posted: Thu May 29, 2008 12:16 pm Post subject: |
|
|
the Mirror Horizontal and Mirror Vertical macros don't work for picture pasted and copied to a Writer file.
instead the rotate 90° macros work either in Draw or Writer.
why this different behaviour? |
|
| Back to top |
|
 |
|