コード例 #1
0
        private static void DrawFaction(Rectangle rectangle, PdfCanvas canvas, Cursor topCursor, HeroFaction heroFaction)
        {
            const float factionImageHeight        = 10f;
            const float factionImageHeightPadding = 3f;
            var         factionRectangle          = new Rectangle(
                rectangle.GetLeft(),
                topCursor.GetCurrent() - factionImageHeight,
                rectangle.GetWidth(),
                factionImageHeight);

            if (heroFaction != HeroFaction.Unaffiliated)
            {
                DrawImage(
                    factionRectangle,
                    canvas,
                    Path.Combine(CurrentPath, "Legendary", "images", "Factions", $"{heroFaction}.png"),
                    centerHorizontally: true);
            }

            topCursor.AdvanceCursor(-(factionRectangle.GetHeight() + factionImageHeightPadding));
        }
コード例 #2
0
        private static void DrawFaction(Rectangle rectangle, PdfContentByte canvas, Cursor topCursor, HeroFaction heroFaction)
        {
            const float factionImageHeight        = 10f;
            const float factionImageHeightPadding = 3f;
            var         factionRectangle          = new Rectangle(
                rectangle.Left,
                topCursor.GetCurrent() - factionImageHeight,
                rectangle.Right,
                topCursor.GetCurrent());

            if (heroFaction != HeroFaction.Unaffiliated)
            {
                DrawImage(factionRectangle, canvas, GetCurrentPath + $"Legendary\\Images\\Factions\\{heroFaction}.png",
                          centerHorizontally: true);
            }

            topCursor.AdvanceCursor(-(factionRectangle.Height + factionImageHeightPadding));
        }