aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/GDI/PlayedIndicatorDrawer.cs
blob: 4428e4cbac38381cf6c7b9e1cdc653ce1fcf6395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Drawing;

namespace Emby.Drawing.GDI
{
    public class PlayedIndicatorDrawer
    {
        private const int IndicatorHeight = 40;
        public const int IndicatorWidth = 40;
        private const int FontSize = 40;
        private const int OffsetFromTopRightCorner = 10;

        public void DrawPlayedIndicator(Graphics graphics, Size imageSize)
        {
            var x = imageSize.Width - IndicatorWidth - OffsetFromTopRightCorner;

            using (var backdroundBrush = new SolidBrush(Color.FromArgb(225, 82, 181, 75)))
            {
                graphics.FillEllipse(backdroundBrush, x, OffsetFromTopRightCorner, IndicatorWidth, IndicatorHeight);

                x = imageSize.Width - 45 - OffsetFromTopRightCorner;

                using (var font = new Font("Webdings", FontSize, FontStyle.Regular, GraphicsUnit.Pixel))
                {
                    using (var fontBrush = new SolidBrush(Color.White))
                    {
                        graphics.DrawString("a", font, fontBrush, x, OffsetFromTopRightCorner - 2);
                    }
                }
            }
        }
    }
}