Difference between revisions of "Documentation/DevGuide/Drawings/Rotating and Shearing"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
m
 
(4 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
|NextPage=Documentation/DevGuide/Drawings/Transforming
 
|NextPage=Documentation/DevGuide/Drawings/Transforming
 
}}
 
}}
{{DISPLAYTITLE:Rotating and Shearing}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Drawings/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Rotating and Shearing}}
 
<!--<idltopic>com.sun.star.drawing.RotationDescriptor</idltopic>-->
 
<!--<idltopic>com.sun.star.drawing.RotationDescriptor</idltopic>-->
 
Most shapes, except OLE and group objects, can be ''rotated'' and ''sheared''. All of these objects include the <idl>com.sun.star.drawing.RotationDescriptor</idl> service that has the properties <code>RotateAngle</code> and <code>ShearAngle</code>.
 
Most shapes, except OLE and group objects, can be ''rotated'' and ''sheared''. All of these objects include the <idl>com.sun.star.drawing.RotationDescriptor</idl> service that has the properties <code>RotateAngle</code> and <code>ShearAngle</code>.
Line 24: Line 25:
 
|}
 
|}
  
{{Documentation/Note|Notice that the rotation works counter-clockwise, while shearing works clockwise.}}
+
{{Note|Notice that the rotation works counter-clockwise, while shearing works clockwise.}}
  
 
[[Image:RotationShearing.png|none|thumb|400px|Rotation and Shearing by 25 degrees]]
 
[[Image:RotationShearing.png|none|thumb|400px|Rotation and Shearing by 25 degrees]]
  
 
The following example shows how a shape can be rotated by 25 degrees counterclockwise:
 
The following example shows how a shape can be rotated by 25 degrees counterclockwise:
 
+
<syntaxhighlight lang="java">
 
   // xShape will be rotated by 25 degrees
 
   // xShape will be rotated by 25 degrees
 
       XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(
 
       XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(
 
           XPropertySet.class, xShape );
 
           XPropertySet.class, xShape );
       xPropSet.setPropertyValue( "RotateAngle", new Integer( 2500 ) );
+
       xPropSet.setPropertyValue( "RotateAngle", new Integer( 2500 ) );</syntaxhighlight>
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Drawing Documents and Presentation Documents]]
+
 
 +
[[Category:Documentation/Developer's Guide/Drawing Documents and Presentation Documents]]

Latest revision as of 14:26, 20 December 2020



Most shapes, except OLE and group objects, can be rotated and sheared. All of these objects include the com.sun.star.drawing.RotationDescriptor service that has the properties RotateAngle and ShearAngle.

Setting the com.sun.star.drawing.RotationDescriptor rotates or shears a shape:

Properties of com.sun.star.drawing.RotationDescriptor
RotateAngle long - This is the angle for rotation of this shape in 1/100th of a degree. The shape is rotated counter-clockwise around the center of the bounding box.
ShearAngle long - This is the amount of shearing for this shape in 1/100th of a degree. The shape is sheared clockwise around the center of the bounding box.
Documentation note.png Notice that the rotation works counter-clockwise, while shearing works clockwise.
Rotation and Shearing by 25 degrees

The following example shows how a shape can be rotated by 25 degrees counterclockwise:

  // xShape will be rotated by 25 degrees
      XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(
          XPropertySet.class, xShape );
      xPropSet.setPropertyValue( "RotateAngle", new Integer( 2500 ) );
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages