Rendertransformorigin instructions for use-[Silverlight Development]

Source: Internet
Author: User
Document directory
  • Note:
Rendertransformorigin: gets or sets any centers that may render the conversion declared by rendertransform, relative to the boundary of the element. This is a Dependency Property. Namespace:System. Windows
Assembly:Presentationcore (in presentationcore. dll)
Xmlns for XAML:Http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

  • Object Center: Defines the reference point of all relative positions in the rendertransform transformation. The default value is the upper left corner of the graph (0, 0). The property value is the relative value, that is, the X and Y directions (0-1) the length and width of the rectangle in which the image is located (as can be seen in expression blend) are used as the reference percentages. This attribute is based on the upper left corner of the rectangle in the default state.

  • For example:In roatetransform, the center is relative to rendertransformorigin, that is, the absolute center position is obtained after the rendertransformorigin is superimposed. The centerx and centery are susceptible to scaletransform. For example, the width of a rectangle is 100, to rotate it around the center, the Center Coordinate should be 50,100. if the gender of scalex and scaley of scaletransform during this period is 1 or 2. (In this case, it has nothing to do with scaletransform's center point.) at this time, its height is changed to twice the original height, that is, its center is changed to 50,100*2 = 200. The formula is: 0.5 * scalex * width, 0.5 * scaley * Height (if not the center, 0.5 is replaced with another value)

Use the scaletransform object to stretch or contract objects horizontally or vertically. The scalex attribute specifies the amount of objects that stretch or contract along the X axis, and the scaley attribute specifies the amount of objects that stretch or contract along the Y axis. The scale operation is centered on the points specified by the centerx and centery attributes.

Obtain the original reference point in the upper left corner after using scaletransform, canvas. left-centerx/width * (scalex-1), canvas. top-centery/height * (scaley-1), translatetransform is not affected by the relative position defined by rendertransform (because it is a relative position), nor does it affect the role of translatetransform. however, it will affect the location of the relative absolute reference point.

Note:

Rendertransformorigin uses the point structure value in a non-standard way, because point does not represent the absolute position in the coordinate system. Conversely, the value between 0 and 1 is interpreted as a factor in the range of the current element on each X axis and Y axis. For example, (0.5, 0.5) places the rendering transformation in the center of the element, and () places the rendering transformation in the lower right corner of the element. Nan is not an acceptable value.

It can also accept values other than 0 and 1, and lead to more unusual conversion effects. For example, if you set rendertransformorigin to (5, 5) and then apply rotatetransform, the rotation point is located outside the boundaries of the element. The conversion will rotate the elements along the center of the center as far as the bottom right of the circle. The origin may be somewhere in the parent element and may be outside the frame or view. The negative vertex value is similar to this value, which exceeds the upper left boundary. Rendering conversion does not affect the layout, and is usually used for animation processing or applying temporary effects to elements.

 

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.