Bild aus datenbank hinzufügen

This commit is contained in:
2026-09-01 10:31:05 +02:00
parent 83e0119ad4
commit b1c54aeda0
5 changed files with 69 additions and 14 deletions
+25
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -19,9 +20,33 @@ namespace Casino
/// </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);
}
}
}