OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to use the basic codes to make drawing object flip

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
yuanpeng
General User
General User


Joined: 23 Sep 2003
Posts: 18
Location: Taiwan

PostPosted: Sat Oct 23, 2004 5:32 pm    Post subject: How to use the basic codes to make drawing object flip Reply with quote

Hi everyone

I like to use some basic codes to make the drawing object flip vertically or horizontally.

Confused
Back to top
View user's profile Send private message MSN Messenger
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Oct 25, 2004 6:31 am    Post subject: Reply with quote

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
View user's profile Send private message
yuanpeng
General User
General User


Joined: 23 Sep 2003
Posts: 18
Location: Taiwan

PostPosted: Sat Feb 26, 2005 8:23 am    Post subject: Reply with quote

Smile
Thank a lot, that's what I mean
Back to top
View user's profile Send private message MSN Messenger
Tommy27
OOo Advocate
OOo Advocate


Joined: 18 Nov 2006
Posts: 302

PostPosted: Sun May 18, 2008 4:48 am    Post subject: Reply with quote

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 Sad

Arrow http://www.openoffice.org/issues/show_bug.cgi?id=89609
Back to top
View user's profile Send private message
Tommy27
OOo Advocate
OOo Advocate


Joined: 18 Nov 2006
Posts: 302

PostPosted: Mon May 19, 2008 8:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Tommy27
OOo Advocate
OOo Advocate


Joined: 18 Nov 2006
Posts: 302

PostPosted: Thu May 29, 2008 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group