PlayedIndicatorDrawer.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using System.Drawing;
  2. namespace Emby.Drawing.Net
  3. {
  4. public class PlayedIndicatorDrawer
  5. {
  6. private const int IndicatorHeight = 40;
  7. public const int IndicatorWidth = 40;
  8. private const int FontSize = 40;
  9. private const int OffsetFromTopRightCorner = 10;
  10. public void DrawPlayedIndicator(Graphics graphics, Size imageSize)
  11. {
  12. var x = imageSize.Width - IndicatorWidth - OffsetFromTopRightCorner;
  13. using (var backdroundBrush = new SolidBrush(Color.FromArgb(225, 82, 181, 75)))
  14. {
  15. graphics.FillEllipse(backdroundBrush, x, OffsetFromTopRightCorner, IndicatorWidth, IndicatorHeight);
  16. x = imageSize.Width - 45 - OffsetFromTopRightCorner;
  17. using (var font = new Font("Webdings", FontSize, FontStyle.Regular, GraphicsUnit.Pixel))
  18. {
  19. using (var fontBrush = new SolidBrush(Color.White))
  20. {
  21. graphics.DrawString("a", font, fontBrush, x, OffsetFromTopRightCorner - 2);
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }