In the previous article, I already knew how "pseudo 3D" is going on. Today, combined with the previous image advertisement rotation, I made another small image switch. I don't know what to do in the future, first paste here for backup:
:
For other reasons such as the XML read policy of Silverlight, you cannot directly post it in your blog. The following is an online example address:
Http://images.24city.com/jimmy/projection/default.htm
Ideas:
1. encapsulate each image and the title text below into a control
1 < Usercontrol X: Class = "Controltest. model. imgitem"
2 Xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 Xmlns: x = "Http://schemas.microsoft.com/winfx/2006/xaml"
4 Xmlns: d = "Http://schemas.microsoft.com/expression/blend/2008"
5 Xmlns: MC = "Http://schemas.openxmlformats.org/markup-compatibility/2006"
6 MC: ignorable = "D" >
7
8 < Usercontrol. Resources >
9 < Storyboard X: Name = "Sbshow" >
10 < Doubleanimationusingkeyframes Begintime = "00:00:00" Storyboard. targetname = "IMG" Storyboard. targetproperty = "(Uielement. opacity )" >
11 < Easingdoublekeyframe Keytime = "00:00:00" Value = "0.0" />
12 < Easingdoublekeyframe Keytime = "00:00:01" Value = "1.0" />
13 </ Doubleanimationusingkeyframes >
14 </ Storyboard >
15 </ Usercontrol. Resources >
16
17 < Stackpanel Orientation = "Vertical" >
18 < Image X: Name = "IMG" Width = "300" Cursor = "Hand" Grid. Row = "0" >
19 < Image. Projection >
20 < Planeprojection Rotationy = "60" Rotationz = "4" X: Name = "PP" > </ Planeprojection >
21 </ Image. Projection >
22 </ Image >
23
24 < Textblock X: Name = "Txttitle" Text = "Image's title" Textalignment = "Center" Textwrapping = "Wrap" Grid. Row = "0" Visibility = "Collapsed" Horizontalalignment = "Center" Margin = "0, 5, 0, 0" >
25 </ Textblock >
26 </ Stackpanel >
27
28 </ Usercontrol >
2. Load the XML data source dynamically. The xml configuration is as follows:
1 <? XML version = "1.0" encoding = "UTF-8" ?>
2 < Data >
3 < Item SRC = "Img/001.jpg" Title = "The first image (click to jump to Baidu )" Link = "Http://www.baidu.com /" />
4 < Item SRC = "Img/002.jpg" Title = "Second image" Link = "Img/002.jpg" />
5 < Item SRC = "Img/003.jpg" Title = "Third image (click to jump to my blog )" Link = "Http://yjmyzz.cnblogs.com /" />
6 < Item SRC = "Img/004.jpg" Title = "Fourth image" Link = "Img/004.jpg" />
7 < Item SRC = "Img/005.jpg" Title = "Fifth image" Link = "Img/005.jpg" />
8 < Item SRC = "Img/006.jpg" Title = "Sixth image" Link = "Img/006.jpg" />
9 < Item SRC = "Img/007.jpg" Title = "Seventh picture" Link = "Img/007.jpg" />
10 < Item SRC = "Img/008.jpg" Title = "Eighth picture" Link = "Img/008.jpg" />
11 < Item SRC = "Img/009.jpg" Title = "Ninth image" Link = "Img/009.jpg" />
12 < Config Canvasleft = "150" Smallimgtop = "100" Smallimgwidth = "240" Bigimgtop = "10" Bigimgwidth = "500" Itemspace = "80" Midindex = "4" Adjustwidth = "70" />
13 </ Data >
14
3. dynamically generate the encapsulated controls in 1 and then dynamically load them to the canvas on the main interface.
For details, seeSource code
There are still a lot of improvements. When there are too many slices, you can use the left and right arrows to move them horizontally, and now the effect of this direct gradient is also very rough, I remember to tell you to share it with me (the current domestic Silverlight research atmosphere is too light and requires more attention ...)
SourceCode: Http://files.cnblogs.com/yjmyzz/Projection.rar
Please indicate Yang Guo from the bodhi tree (http://www.cnblogs.com/yjmyzz/archive/2009/10/31/1593643.html)