public System.Windows.Controls.Image GetCardImage(CardFactory card)
 {
     SettingCard();
     System.Drawing.Image image2 = 
         pic.Clone(new System.Drawing.Rectangle(XBegin[card.thisCardHierarchy], 
             YBegin[card.thisCardSuit], 148, 215), 
             System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
     
    using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
     {
         image2.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
         Image image = new Image() { Width = width, Height = height, Source = GetBitmapImage(ms.ToArray()) };
         image.Margin = new System.Windows.Thickness(5, 0, 0, 0); 
        return image;
     }
 }
示例#2
0
 /// <summary>
 /// Создать основную ксласс с основной информацией по карте
 /// </summary>
 /// <param name="Card">Большая карта</param>
 /// <returns>Информация по карте</returns>
 ShortCard CreateShortCard(CardFactory Card)
 {
     return new ShortCard(Card.thisCardHierarchy, Card.thisCardSuit);
 }
示例#3
0
 /// <summary>
 /// Добавляет карту в колоду игрока
 /// </summary>
 /// <param name="cf">новая карта</param>
 public void AddCardToDeck(CardFactory cf)
 {
     if (cf.thisCardHierarchy == CardHierarchy.Ace)
         deckHasAce = true;
     gameDeck.Push(cf);
 }