Windows Store App Spin Center

Source: Internet
Author: User

the position of the center of rotation can be set by settingCenterofrotationx,Centerofrotationyand theCenterofrotationzproperty to specify. Centerofrotationxand theCenterofrotationythe default value of the property is0.5that represents the axis of rotation exactly at the center of the rotated object. When these two property values are0and the1, the center of rotation is on a set of pairs of edges that rotate the object, and the center of rotation moves to the outer edge of the rotated object, and the rotated object rotates around its outer edge. When the range of these two property values is in the0and the1indicates that the center of rotation is in a specific position of the rotated object, and if this range is exceeded, the rotation center is moved out of the rotation object according to the size of the value beyond. Centerofrotationzthe default value of the property is0, which indicates that the center of the rotation is rotated in the center of the object and can be assigned a positive or negative value so that the center of rotation moves to the front or back of the rotated object.

by settingCenterofrotationxproperty values can move the center of rotation alongXaxis and parallel toYaxis movement, similarly by settingCenterofrotationyproperty values can move the center of rotation alongYaxis and parallel toXaxis movement. Here's a look at the differentCenterofrotationyProperty value pairs3Dimpact of the effect,10-10is shown.

< Span lang= "en-US" >&NBSP; centerofrotationy = "0.5" ( default value                        &NBSP; Centerofrotationy = "0.1"

< Span lang= "X-none" style= "font-family:; line-height:14pt; mso-ascii-font-family: "times New roman"; mso-hansi-font-family: "times New roman" "> figure 10-1 0 Centerofrotationy property effect

Next, you'll learn how to change Centerofrotationx property value to move the center of rotation so that the interface element rotates around the specified rotation center.

StartVisual Studio, create a newWindowsApp Store's blank app project, name it3DCenterOfRotationApp, first in the project'sAssetsfolder, add a name of "Windows 8.png"The picture, double-click on this page to open the3dcenterofrotationapp.xamlfile, replace the original with the following codeGridelement.

<grid background= "Gray" >

&NBSP;    <stackpanel  Width= "2 40 " height= "2 40 "background=" White

         <image  width= "2 40 40 windows 8 png

<Image.Projection>

<planeprojection centerofrotationx= "0.9 " rotationy= "/> "

</Image.Projection>

</Image>

</StackPanel>

</Grid>

The code above is similar to the example code described earlier, and the difference is that this exampleplaneprojectionElements ofCenterofrotationxproperty value is set to0.9that represents the center of rotation along theXaxis and parallel toYThe axis moves right to the right edge of the picture, and thenRotationYproperty value is set to $so that the picture will go aroundYaxis Clockwise rotation $degree.

Press the F5 running the program will produce 10-11 shown in 3D effect.

Figure10-11 rotation around the specified rotation center.3D

since the setting of the rotation center is very similar here only with Centerofrotationx attribute as an example, an interested reader can modify it on the basis of the example above planeprojection value of the property, feel the different 3D effect.

Windows Store App Spin Center

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.