Multimedia controls are the so-called audio and video controls and image controls. In Phone7, there are many differences with silverlight.
1. Image: Image control, used to display local or network images. This control only supports several image formats. If you want to display other image formats, You need to enable encoding and decoding.
<Image x: Name = "image" Source = "Chrysanthemum.jpg" Height = "200" Width = "200"/>
In XAML, you can set the relative path of the image in the Source attribute. In this case, the image must be content and copied to the xap package. Otherwise, the image cannot be displayed.
You can also load images dynamically in the Code:
Image. Source = new BitmapImage (new Uri ("Chrysanthemum.jpg", UriKind. Relative ));
You can also load the network slice, as long as you use an absolute address:
Image1.Source = new BitmapImage (new Uri ("http://ts3.cn.mm.bing.net/images/thumbnail.aspx? Vertex ", UriKind. Absolute ));
Image formats supported by Windows phone7:
Although the Beta version supports GIF files and can obtain the file content, this control cannot be used for display.
2. MediaElement: multimedia playback control. It can play back local and network multimedia, and supports mms:, rtspt:, rtsp: Streaming Media Protocol. This control is very different from windows mobile. The control on mobile is a complete player, but the current control is only a window that can play multimedia, all controls must be implemented by yourself, or even full screen playback.
<MediaElement Grid. row = "1" Height = "649" HorizontalAlignment = "Left" Name = "mediaElement1" verticalignment = "Top" Width = "480" IsMuted = "False" Stretch = "UniformToFill" source = "Medias/Wildlife. wmv "/>
Source: Set the multimedia address to be played (either local or on the network ). If you want to play a file dynamically, you can set it in the program.
MediaElement1.Source = new Uri ("http://mschannel9.vo.msecnd.net/o9/mix/09/wmv/key01.wmv", UriKind. Absolute );
MediaElement1.Source = new Uri ("Medias/Wildlife. wmv", UriKind. Relative );
IsMuted: whether to mute.
Stretch: used to set the filling mode of the video Image in the control, similar to the Image control.
AutoPlay: whether to play automatically.
Media formats supported by Windows phone: