WatchedIndicatorDrawer.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Drawing;
  2. namespace MediaBrowser.Server.Implementations.Drawing
  3. {
  4. public class WatchedIndicatorDrawer
  5. {
  6. private const int IndicatorHeight = 50;
  7. public const int IndicatorWidth = 50;
  8. private const int FontSize = 50;
  9. public void Process(Graphics graphics, Size imageSize)
  10. {
  11. var x = imageSize.Width - IndicatorWidth;
  12. using (var backdroundBrush = new SolidBrush(Color.FromArgb(225, 204, 51, 51)))
  13. {
  14. graphics.FillRectangle(backdroundBrush, x, 0, IndicatorWidth, IndicatorHeight);
  15. const string text = "a";
  16. x = imageSize.Width - 55;
  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(text, font, fontBrush, x, -2);
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }