Blackjack
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
<Window x:Class="Casino.Blackjack"
|
||||||
|
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"
|
||||||
|
xmlns:local="clr-namespace:Casino"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Blackjack" Height="1080" Width="1980">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="280"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="70"></RowDefinition>
|
||||||
|
<RowDefinition Height="270"></RowDefinition>
|
||||||
|
<RowDefinition Height="270"></RowDefinition>
|
||||||
|
<RowDefinition Height="270"></RowDefinition>
|
||||||
|
<RowDefinition Height="200"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Image Grid.Column="1" Grid.Row="1" x:Name="Bild_1"/>
|
||||||
|
<Image Grid.Column="3" Grid.Row="1" x:Name="Bild_2"/>
|
||||||
|
<Image Grid.Column="5" Grid.Row="1" x:Name="Bild_3"/>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Casino
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für Blackjack.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Blackjack : Window
|
||||||
|
{
|
||||||
|
public Blackjack()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
LoadCard(28);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadCard(int Bild)
|
||||||
|
{
|
||||||
|
Database db = new Database();
|
||||||
|
byte[] img = db.GetCardImage(Bild);//2-10
|
||||||
|
|
||||||
|
Bild_1.Source = ByteArrayToImage(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BitmapImage ByteArrayToImage(byte[] bytes)
|
||||||
|
{
|
||||||
|
BitmapImage image = new BitmapImage();
|
||||||
|
using (MemoryStream ms = new MemoryStream(bytes))
|
||||||
|
{
|
||||||
|
image.BeginInit();
|
||||||
|
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||||
|
image.StreamSource = ms;
|
||||||
|
image.EndInit();
|
||||||
|
}
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Button Content="Slots" HorizontalAlignment="Left" Height="39" Margin="65,114,0,0" VerticalAlignment="Top" Width="93" Click="Slots_Click"/>
|
<Button Content="Slots" HorizontalAlignment="Left" Height="39" Margin="65,114,0,0" VerticalAlignment="Top" Width="93" Click="Slots_Click"/>
|
||||||
<Button Content="sound" HorizontalAlignment="Left" Height="39" Margin="65,193,0,0" VerticalAlignment="Top" Width="93" Click="Sound_Click"/>
|
<Button Content="sound" HorizontalAlignment="Left" Height="39" Margin="65,193,0,0" VerticalAlignment="Top" Width="93" Click="Sound_Click"/>
|
||||||
|
<Button Content="Blackjack" HorizontalAlignment="Left" Margin="221,114,0,0" VerticalAlignment="Top" Height="40" Width="79" Click="Blackjack_Click"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -30,9 +30,15 @@ namespace Casino
|
|||||||
private void Sound_Click(object sender, RoutedEventArgs e)
|
private void Sound_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Database data = new Database();
|
Database data = new Database();
|
||||||
byte[] blobData = data.GetSound(2);
|
byte[] blobData = data.GetSound(3);
|
||||||
var audioService = new Audioplayer();
|
var audioService = new Audioplayer();
|
||||||
audioService.PlayMusic(blobData);
|
audioService.PlayMusic(blobData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Blackjack_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Blackjack slotsWindow = new Blackjack();
|
||||||
|
slotsWindow.Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user