public void RedrawDeck() { if (m_ShowDeck != null) { System.Drawing.Graphics pGraphics = this.CreateGraphics(); m_ShowDeck.DrawToGraphics(pGraphics); } else if (m_DeckList != null) { System.Drawing.Graphics pGraphics = this.CreateGraphics(); pGraphics.Clear(Color.Honeydew); int count = m_DeckList.Count; int CurrentX = 0; for (int i = 0; i < count; i++) { kernal.PlayedDeck deck = m_DeckList[i]; Size deckSize = deck.GetSize(); var saveState = pGraphics.Save(); pGraphics.TranslateTransform(CurrentX, 0); deck.DrawToGraphics(pGraphics); pGraphics.Restore(saveState); CurrentX += deckSize.Width; } } }
public void SetShowDeck(kernal.PlayedDeck deck) { m_ShowDeck = deck; m_DeckList = null; System.Drawing.Size size = m_ShowDeck.GetSize(); size.Width += (7 * 2); //бордеры формочки size.Height += (30 + 6); if (size.Width < 100) { size.Width = 100; } if (size.Width < 100) { size.Width = 100; } Size = size; RedrawDeck(); }