<doc>
	<legacy_id>2452</legacy_id>
	<name>rotate</name>
	<type>command</type>

	<syntax>
		<example>rotate [<i>image</i>] by <i>numberOfDegrees</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Rotates an <keyword tag="image">image</keyword> through the specified angle.</summary>

	<examples>
<example>rotate image 1 by 90</example>
<example>rotate image "picture" by -10</example>
	</examples>

	<history>
		<introduced version="1.1">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="3.0">3.0</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Images  Multimedia</category>
		<category>Appearance  Positioning</category>
	</classification>

	<references>
		<command tag="revRotatePoly">revRotatePoly Command</command>
		<command tag="crop">crop Command</command>
		<command tag="choose">choose Command</command>
	</references>

	<description>Use the <b>rotate</b> <glossary tag="command">command</glossary> to turn an <keyword tag="image">image</keyword>.<p></p><p><b>Parameters:</b></p><p>The <i>image</i> is any image reference.</p><p></p><p>The <i>numberOfDegrees</i> is a number, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a number.</p><p></p><p><b>Comments:</b></p><p>The entire content of the specified image is selected with the Select paint tool, then rotated. If you don't specify an <i>image</i>, the portion currently selected with the Select <glossary tag="paint tool">paint tool</glossary> is rotated.</p><p></p><p>If the <i>numberOfDegrees</i> is positive, the image rotates counterclockwise. If the <i>numberOfDegrees</i> is negative, the image rotates clockwise.</p><p></p><p>If the rotated image extends beyond the boundaries of the original image, and the image's <b>lockLocation</b> <glossary tag="property">property</glossary> is set to false, the <keyword tag="image">image</keyword> expands to accommodate the rotated contents. If the <property tag="lockLocation">lockLocation</property> is true, the rotated <keyword tag="image">image</keyword> is cropped to fit within the <glossary tag="image">image's</glossary> <keyword tag="rectangle">rectangle</keyword>.</p><p></p><p>The current setting of the <property tag="resizeQuality">resizeQuality property</property> is used to determine whether to apply filtering to the rotation operation. If set to normal no filtering is used; if set to good or best a bilinear filter is used which significantly reduces the distortion that will naturally occur when an image is rotated.</p><p></p><p>The rotation operation does not have an inverse. Since some amount of distortion is unavoidable when rotating an image by an amount that is not a multiple of 90 degrees, rotating an image clockwise, then counterclockwise by the same amount does not completely restore the original image.</p><p></p><p>To rotate an image in a reversible way, or to do repeated rotations without progressive distortion of the image, set its <b>angle</b> <glossary tag="property">property</glossary> instead of using the <b>rotate</b> <glossary tag="command">command</glossary>. Unlike the <b>rotate</b> <glossary tag="command">command</glossary>, the <property tag="angle">angle</property> <glossary tag="property">property</glossary> affects only the screen display of the <keyword tag="image">image</keyword>, not the actual picture data in it, so setting it repeatedly does not introduce distortion.</p><p></p><p><b> Note:</b>Rotating an image using good or best <property tag="resizeQuality">resizeQuality</property> might cause the mask to be promoted to an alpha channel.</p><p></p><p></p><p></p><note>As rotate is an image editing operation, the target image needs to be on the currently visible card of an open stack to function.</note><p></p><p></p><p></p><important>The <b>rotate </b><glossary tag="command">command</glossary> cannot be used on a <glossary tag="referenced control">referenced image</glossary>. Doing so will cause an <glossary tag="execution error">execution error</glossary>. To turn a <glossary tag="referenced control">referenced image</glossary>, set the <glossary tag="image">image's</glossary><property tag="angle">angle </property><glossary tag="property">property</glossary> instead.</important></description>
</doc>