private void DrawIconPentagon(CardImage cardImage) { var graphics = cardImage.Graphics; var usableRectangleWithPadding = cardImage.UsableRectangWithPadding; var radius = (usableRectangleWithPadding.Width) * (7.0 / 10) / 1.902; var x = usableRectangleWithPadding.Width / 2; var y = usableRectangleWithPadding.Height / 2; var c1 = (int)(Math.Cos(2 * Math.PI / 5) * radius); var c2 = (int)(Math.Cos(Math.PI / 5) * radius); var s1 = (int)(Math.Sin(2 * Math.PI / 5) * radius); var s2 = (int)(Math.Sin(4 * Math.PI / 5) * radius); var points = new[] { new Point(usableRectangleWithPadding.Right - x, (int)(usableRectangleWithPadding.Bottom - (y + radius))), new Point(usableRectangleWithPadding.Right - (x + s1), usableRectangleWithPadding.Bottom - (y + c1)), new Point(usableRectangleWithPadding.Right - (x + s2), usableRectangleWithPadding.Bottom - (y + -c2)), new Point(usableRectangleWithPadding.Right - (x + -s2), usableRectangleWithPadding.Bottom - (y + -c2)), new Point(usableRectangleWithPadding.Right - (x + -s1), usableRectangleWithPadding.Bottom - (y + c1)) }; var halfPentagonImageSize = pentagonImageSize / 2; GraphicsUtilities.PrintScaledPng(graphics, "Axe BW", points[0].X - halfPentagonImageSize, points[0].Y - halfPentagonImageSize, pentagonImageSize, pentagonImageSize); GraphicsUtilities.PrintScaledPng(graphics, "Sword BW", points[1].X - halfPentagonImageSize, points[1].Y - halfPentagonImageSize, pentagonImageSize, pentagonImageSize); GraphicsUtilities.PrintScaledPng(graphics, "Staff BW", points[2].X - halfPentagonImageSize, points[2].Y - halfPentagonImageSize, pentagonImageSize, pentagonImageSize); GraphicsUtilities.PrintScaledPng(graphics, "Pick BW", points[3].X - halfPentagonImageSize, points[3].Y - halfPentagonImageSize, pentagonImageSize, pentagonImageSize); GraphicsUtilities.PrintScaledPng(graphics, "Chisel BW", points[4].X - halfPentagonImageSize, points[4].Y - halfPentagonImageSize, pentagonImageSize, pentagonImageSize); }
private void PrintImageMapping(Graphics graphics, Image image1, string label1, Image image2, string label2, int x, int y, int imageSize) { var imageMappingFont = new Font(bodyFontFamily, bodyFontSize, GraphicsUnit.Pixel); var mappingTextWidth = imageSize + 2 * (arrowImageSize + 2 * ArrowPadding); var label1Rectangle = new RectangleF(x - (arrowImageSize + 2 * ArrowPadding), y + imageSize, mappingTextWidth, imageMappingFont.Height); var label2Rectangle = new RectangleF(x + imageSize + 2 * ArrowPadding + arrowImageSize - (arrowImageSize + 2 * ArrowPadding), y + imageSize, mappingTextWidth, imageMappingFont.Height); GraphicsUtilities.PrintScaledImage(graphics, image1, x, y, imageSize, imageSize); GraphicsUtilities.DrawString(graphics, label1, imageMappingFont, GraphicsUtilities.BlackBrush, label1Rectangle, GraphicsUtilities.HorizontalCenterAlignment); GraphicsUtilities.PrintScaledPng(graphics, "arrow", x + imageSize + ArrowPadding, y + (imageSize / 2), arrowImageSize, arrowImageSize); GraphicsUtilities.PrintScaledImage(graphics, image2, x + imageSize + ArrowPadding + arrowImageSize + ArrowPadding, y, imageSize, imageSize); GraphicsUtilities.DrawString(graphics, label2, imageMappingFont, GraphicsUtilities.BlackBrush, label2Rectangle, GraphicsUtilities.HorizontalCenterAlignment); }
private void PrintToolImage(NewToolCard newCard, CardImage cardImage) { var graphics = cardImage.Graphics; var usableRectangWithPadding = cardImage.UsableRectangWithPadding; var cardFrontLargeImageSize = usableRectangWithPadding.Width - (2 * cardFrontSmallImageSize); GraphicsUtilities.PrintScaledPng( graphics, newCard.Tool, usableRectangWithPadding.X + usableRectangWithPadding.Width / 2 - cardFrontLargeImageSize / 2, usableRectangWithPadding.Y + usableRectangWithPadding.Height / 2 - (cardFrontLargeImageSize / 2), cardFrontLargeImageSize, cardFrontLargeImageSize); }
private void PrintToolIcon(NewToolCard newCard, Graphics graphics, int x, int y) { GraphicsUtilities.PrintScaledPng(graphics, $"{newCard.Tool} BW", x, y, cardFrontSmallImageSize, cardFrontSmallImageSize); }