From a0e5056d302b322301e9f505ea844576695e096d Mon Sep 17 00:00:00 2001 From: "NBTEMP\\bib" Date: Mon, 7 Sep 2026 14:28:32 +0200 Subject: [PATCH] Busfahrer --- Casino/Blackjack.xaml | 6 ++-- Casino/Blackjack.xaml.cs | 14 ++++++++-- Casino/Busfahrer.xaml | 37 +++++++++++++++++++++++++ Casino/Busfahrer.xaml.cs | 59 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 Casino/Busfahrer.xaml create mode 100644 Casino/Busfahrer.xaml.cs diff --git a/Casino/Blackjack.xaml b/Casino/Blackjack.xaml index aa61493..4082968 100644 --- a/Casino/Blackjack.xaml +++ b/Casino/Blackjack.xaml @@ -30,8 +30,8 @@ - - - + + + diff --git a/Casino/Blackjack.xaml.cs b/Casino/Blackjack.xaml.cs index 86a6d46..d3aaf36 100644 --- a/Casino/Blackjack.xaml.cs +++ b/Casino/Blackjack.xaml.cs @@ -23,7 +23,8 @@ namespace Casino public Blackjack() { InitializeComponent(); - LoadCard(28); + rand(); + LoadCard(55); } private void LoadCard(int Bild) @@ -31,7 +32,7 @@ namespace Casino Database db = new Database(); byte[] img = db.GetCardImage(Bild);//2-10 - Bild_1.Source = ByteArrayToImage(img); + Dealer_Bild_1.Source = ByteArrayToImage(img); } private BitmapImage ByteArrayToImage(byte[] bytes) @@ -46,5 +47,14 @@ namespace Casino } return image; } + + private int rand() + { + Random ran = new Random(); + int temp = ran.Next(13, 66); + Console.WriteLine(temp); + + return 0; + } } } diff --git a/Casino/Busfahrer.xaml b/Casino/Busfahrer.xaml new file mode 100644 index 0000000..7f05207 --- /dev/null +++ b/Casino/Busfahrer.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Casino/Busfahrer.xaml.cs b/Casino/Busfahrer.xaml.cs new file mode 100644 index 0000000..1d437ef --- /dev/null +++ b/Casino/Busfahrer.xaml.cs @@ -0,0 +1,59 @@ +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 +{ + /// + /// Interaktionslogik für Busfahrer.xaml + /// + public partial class Busfahrer : Window + { + public Busfahrer() + { + rand(); + LoadCard(55); + } + + 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; + } + + private int rand() + { + Random ran = new Random(); + int temp = ran.Next(13, 66); + Console.WriteLine(temp); + + return 0; + } + } +}