Pixel and scale scaling in Silverlight

Source: Internet
Author: User

Recently in the study of Silverlight, also in preparation for the Test six, while the online found some Silverlight tutorials are beta1, in the formal version of a lot of questions, so try to translate Jesse Liberty's blog to improve themselves, At the same time also hope that through this and everyone to study together.

Original address: Http://silverlight.net/blogs/jesseliberty/archive/2008/10/21/sizing-in-silverlight-pixels-and-stars.aspx

Note: Star translation for proportional scaling, looking for a few dictionaries, looks like star does not mean that.

In Silverlight, virtually all measurements (such as high, wide, etc.) are pixels, except when it is clearly stated that they are not.

Pixel

When you create a new shape, or set an edge indent, or fill a control's length and width, implicitly (by default, the display relative) units are pixels. Such as:

Code

<Button Content="Button" Width="100" />
<CheckBox Content="CheckBox" Height="20" Width="75"/>
<StackPanel Orientation="Horizontal" >
  <RadioButton Height="29" Width="106" Content="RadioButton1" />
  <RadioButton Height="29" Width="136" Content="RadioButton2" />
</StackPanel>
<ListBox Width="100" Height="100">
</ListBox>
<Slider Width="250" Height="25"/>
<swc:Calendar Height="150" Width="200" />

From the length of the button to the height of the Calendar control, all units above are pixels.

Proportional scaling

There are two ways to set the row height or column width of the grid, one with absolute value, pixel, and the other by proportional distribution. When you draw two rows through the mouse in the blank part of the blend, the default is not to define the size of the two rows by pixel, which is interrelated, one change, and the other changes. In the panel there will be an open lock to identify it. Also, in a XAML file, add "*" to the value.

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.