siverlight+wcf网络分房间斗地主1摆牌实现
2013-11-05 18:36
381 查看
先上一个简单的效果图
/article/2159374.html二
/article/2159375.html
三
一:建立一个siverlight页面 添加张背景图片
<Grid x:Name="LayoutRoot">
<Grid.Background> <!--添加背景图片-->
<ImageBrush ImageSource="Image\game-ddz_bg.png" Stretch="Fill"></ImageBrush>
</Grid.Background>
</Grid>
二:摆牌
其实很简单就是用几个StackPanel ,放上Image标签,由于牌之间有折叠效果,所以用Margin设置一下就行了
三:准备出牌的效果
其实也是设置一下Image的Margin就能显示这种效果了
<Image Source="Image\hong_1.png" Width="95" Height="129" Margin="0,-60,-69,0"></Image>
- .-图片的url设置成"\"斜杠居然运行时显示不出来改成/就好了 Source="Image/hong_1.png"
当然这是简单的直接摆牌,后边需要用一个54的数字来分别对应这些牌,后台产出混乱的54位数组,在分成三份传给前台找到对应的url摆出相应的牌
/article/2159374.html二
/article/2159375.html
三
一:建立一个siverlight页面 添加张背景图片
<Grid x:Name="LayoutRoot">
<Grid.Background> <!--添加背景图片-->
<ImageBrush ImageSource="Image\game-ddz_bg.png" Stretch="Fill"></ImageBrush>
</Grid.Background>
</Grid>
二:摆牌
其实很简单就是用几个StackPanel ,放上Image标签,由于牌之间有折叠效果,所以用Margin设置一下就行了
<UserControl x:Class="Poker_DZZ.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="760" d:DesignWidth="1100"> <Grid x:Name="LayoutRoot" Width="1100" Height="760"> <!--背景图片--> <Grid.Background> <ImageBrush ImageSource="Image/game-ddz_bg.png" Stretch="Fill"></ImageBrush> </Grid.Background> <!--存放地主--> <StackPanel Name="top" VerticalAlignment="Top" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,50,0,0"> <Image Source="Image/faceDown.png" Width="34" Height="78" Margin="0,0,0,0"></Image> <Image Source="Image/faceDown.png" Width="34" Height="78" Margin="0,0,0,0"></Image> <Image Source="Image/faceDown.png" Width="34" Height="78" Margin="0,0,0,0"></Image> </StackPanel> <!--左边对手--> <StackPanel Name="leftcompetitor" VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Vertical" Margin="90,150,0,0"> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,0,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> </StackPanel> <!--右边对手--> <StackPanel Name="rightcompitor" VerticalAlignment="Top" HorizontalAlignment="Right" Orientation="Vertical" Margin="0,150,90,0"> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,0,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> <Image Source="Image/faceDown.png" Width="74" Height="98" Margin="0,-80,0,0"></Image> </StackPanel> <!--自己--> <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Center" Orientation="Vertical" Margin="0,0,50,50" Height="150"> <StackPanel Name="mybuttonsp" Height="30" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Center"> <Button Style="{StaticResource RoundButton}" Content="1分"/> <Button Style="{StaticResource RoundButton}" Margin="10,0,0,0" Content="2分"/> <Button Style="{StaticResource RoundButton}" Margin="10,0,0,0" Content="3分"/> <Button Style="{StaticResource RoundButton}" Margin="10,0,0,0" Content="不 叫"/> </StackPanel> <StackPanel Name="mypoker" VerticalAlignment="Bottom" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,22,0,0" Height="98"> <Image Source="Image\dawang.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\xiaowang.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\fang_2.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\mei_2.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hei_2.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hong_2.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\fang_1.png" Width="74" Height="98" Margin="0,-0,-50,0"></Image> <Image Source="Image\mei_1.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hei_1.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hong_1.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\fang_3.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\mei_3.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hei_3.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> <Image Source="Image\hong_3.png" Width="74" Height="98" Margin="0,0,-50,0"></Image> </StackPanel> </StackPanel> </Grid> </UserControl>
三:准备出牌的效果
其实也是设置一下Image的Margin就能显示这种效果了
<Image Source="Image\hong_1.png" Width="95" Height="129" Margin="0,-60,-69,0"></Image>
- .-图片的url设置成"\"斜杠居然运行时显示不出来改成/就好了 Source="Image/hong_1.png"
当然这是简单的直接摆牌,后边需要用一个54的数字来分别对应这些牌,后台产出混乱的54位数组,在分成三份传给前台找到对应的url摆出相应的牌
相关文章推荐
- siverlight+wcf网络分房间斗地主3点选牌与拖选牌
- 基于网络流量统计与反馈实现边缘机房间媒体流流量调度的一种思路
- C#三种WCF网络客户端的实现方式
- Siverlight与WCF通信之双工netTcp实现视频对话
- C#三种WCF网络客户端的实现方式
- Siverlight与WCF通信之双工netTcp实现视频对话
- siverlight网络分房间斗地主4出牌规则算法
- Siverlight与WCF通信之双工netTcp实现视频对话
- WCF网络客户端的三种实现方式
- 一起谈.NET技术,Siverlight与WCF通信之双工netTcp实现视频对话
- ASI简单实现网络编程
- Android实现网络多线程文件下载
- Linux内核--网络栈实现分析(一)--网络栈初始化
- 如何用70行Java代码实现神经网络算法
- 70行Java代码实现深度神经网络算法分享
- 机器学习之深入理解神经网络理论基础、BP算法及其Python实现
- 网络安全的历史,原理和实现
- Android学习笔记---28_网络通信之通过HTTP协议实现文件上传,组拼http 的post方法,传输内容
- java socket类实现网络通信
- Android 通过WebService进行网络编程,使用工具类轻松实现