Busfahrer

This commit is contained in:
2026-09-07 14:28:32 +02:00
parent abe9867cb1
commit a0e5056d30
4 changed files with 111 additions and 5 deletions
+59
View File
@@ -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
{
/// <summary>
/// Interaktionslogik für Busfahrer.xaml
/// </summary>
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;
}
}
}