Wp8.1 UI programming 4. Graphics

Source: Internet
Author: User

1. Basic classes commonly used in graphics

Point: (x, y) The point determined by the coordinate.

Size: a small class that determines the height and width.

Rect: rectangle class, which can be determined by a point and a size.

Color: The color class determined by R, G, B, and.

 

Geometry and shape are classes that define space areas. shape has related brushes and can be displayed to the screen, but geometry does not.

Common shape attributes:

Fill: filled brush

Stroke: stroke, boundary color brush

Strokethickness: boundary thickness

Stretch: Fill stretch mode. None indicates to keep the original size, fill indicates to fill up and stretch, uniform indicates to maintain the proportion and adjust the size to fit the size, and uniformtofill indicates to keep the proportion and fill up.

Common shapes include line, rectangle, ellipse, polyline, polygon, and path.

 

2. path can draw any image.

The path. data attribute is of the geometry type. Simple geometry includes linegeometry, rectanglegeometry, and ellipsegeometry.

You can use geometrygroup to combine several ry shapes into more complex shapes.

You can use pathgeometry to create a path and use segment.

Another method to implement path is to use the path markup language, that is, the simple method of segment.

With the data attribute, You can inherit the path to implement custom images.

In addition, the expression blend tool allows you to easily create complex paths and import ps, Illustrator, and Flash files.

 

3. Paint Brush

Solidcolorbrush: A monochrome paint brush that supports color values in colors and hexadecimal color values.

Lineargradientbrush: linear gradient paint brush. It can be any combination of two or more colors.

Imagebrush: image painting brush. Fill is used to fill JPEG or PNG images.

 

4. Crop clip

For controls inherited from uielement, the clip attribute can be cropped out for display. The syntax is the same as the data attribute assignment Syntax of path.

When cropping an image, the clip attribute can only use rectanglegeometry.

Clip is the property of uielement, so all XAML controls can use it to crop images.

In this way, you can implement some functions, such as setting the child controls beyond the layout panel to be invisible.

Wp8.1 UI programming 4. Graphics

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.