WatchedIndicatorDrawer.cs 1000 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Drawing;
  2. namespace MediaBrowser.Server.Implementations.Drawing
  3. {
  4. public class WatchedIndicatorDrawer
  5. {
  6. private const int IndicatorHeight = 50;
  7. private const int FontSize = 50;
  8. public void Process(Graphics graphics, Size imageSize)
  9. {
  10. var x = imageSize.Width - IndicatorHeight;
  11. using (var backdroundBrush = new SolidBrush(Color.FromArgb(225, 204, 51, 51)))
  12. {
  13. graphics.FillRectangle(backdroundBrush, x, 0, IndicatorHeight, IndicatorHeight);
  14. const string text = "a";
  15. x = imageSize.Width - 55;
  16. using (var font = new Font("Webdings", FontSize, FontStyle.Regular, GraphicsUnit.Pixel))
  17. {
  18. using (var fontBrush = new SolidBrush(Color.White))
  19. {
  20. graphics.DrawString(text, font, fontBrush, x, -2);
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }