53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
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 Slots.xaml
|
|
/// </summary>
|
|
public partial class Slots : Window
|
|
{
|
|
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;
|
|
}
|
|
|
|
|
|
public Slots()
|
|
{
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
}
|
|
private void LoadCard()
|
|
{
|
|
Database db = new Database();
|
|
byte[] img = db.GetCardImage(1);
|
|
|
|
kartenBild.Source = ByteArrayToImage(img);
|
|
}
|
|
}
|
|
}
|