public CardImage CreateLeaderImage() { var name = "Leader"; var cardImage = new CardImage(name, ImageOrientation.Portrait); cardImage.PrintCardBorderAndBackground(Color.White, Color.White); var graphics = cardImage.Graphics; var fullRectangle = cardImage.FullRectangle; var imageWidth = fullRectangle.Width; var imageHeight = GraphicsUtilities.PrintFullWidthPng( graphics, @"Misc\Leader", fullRectangle.X, fullRectangle.Y, imageWidth); var bottomOfImage = fullRectangle.Y + imageHeight; var imageXOffset = 0; var maxTextBoxWidth = cardImage.UsableRectangle.Width; var yOffset = (int)(cardImage.UsableRectangle.Width * .05f); PrintCardName("Leader", cardImage, GraphicsUtilities.BlackBrush, true, imageXOffset, maxTextBoxWidth, yOffset); var usableRectangle = cardImage.UsableRectangle; var textBoxWidth = cardImage.UsableRectangle.Width; var influenceImageSide = InfluenceImageSide(cardImage); var textRectangleHeight = usableRectangle.Bottom - (influenceImageSide + bottomOfImage); var top = bottomOfImage; var textXOffset = 0; PrintCardText("LEAD |a role from your hand |or |THINK |and draw new cards", cardImage, top, textBoxWidth, textRectangleHeight, textXOffset, true, GraphicsUtilities.BlackBrush); return(cardImage); }
private CardImage CreateJackImage(string path) { var cardImage = new CardImage("JackImage", ImageOrientation.Portrait); var graphics = cardImage.Graphics; var fullRectangle = cardImage.FullRectangle; var usableRectangle = cardImage.UsableRectangle; cardImage.PrintCardBorderAndBackground(Color.Black, Color.Black); var imageOffset = (int)(fullRectangle.Height * JackImageHeightOffsetPercentage); var imageHeight = GraphicsUtilities.PrintFullWidthPng(graphics, path, fullRectangle.X, fullRectangle.Y + imageOffset, fullRectangle.Width); var xOffset = 0; var yOffset = (int)(usableRectangle.Width * .15f); var brush = new SolidBrush(Color.FromArgb(208, 208, 208)); PrintCardName("Jack", cardImage, brush, false, xOffset, usableRectangle.Width, yOffset); var bottomOfImage = fullRectangle.Top + imageOffset + imageHeight; PrintCardText( "Lead or follow any role", cardImage, bottomOfImage, usableRectangle.Width, usableRectangle.Bottom - bottomOfImage, xOffset, false, brush); return(cardImage); }
private int PrintCardImage(OrderCard orderCard, CardImage cardImage) { var graphics = cardImage.Graphics; var fullRectangle = cardImage.FullRectangle; var imageWidth = fullRectangle.Width; var imageHeight = GraphicsUtilities.PrintFullWidthPng( graphics, $@"CardImages\{orderCard.CardName}", fullRectangle.X + (orderCard.ImageIsRoughlyCentered ? CenteredImageOffset(cardImage) : 0), fullRectangle.Y, imageWidth); return(fullRectangle.Y + imageHeight); }