diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-19 13:45:48 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-19 13:45:48 -0400 |
| commit | c233f2190c8d71508b5de40c18ad21d245a10de4 (patch) | |
| tree | c4e552631bcfff04bf9fa065117cc08d3242fb75 /MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs | |
| parent | 9e91e3b2dde25c466a82a53c2f83beae69dbc7b9 (diff) | |
fixes #518 - Add api param for watched indicator on images
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs b/MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs new file mode 100644 index 000000000..921494dba --- /dev/null +++ b/MediaBrowser.Server.Implementations/Drawing/WatchedIndicatorDrawer.cs @@ -0,0 +1,33 @@ +using System.Drawing; + +namespace MediaBrowser.Server.Implementations.Drawing +{ + public class WatchedIndicatorDrawer + { + private const int IndicatorHeight = 50; + private const int FontSize = 50; + + public void Process(Graphics graphics, Size imageSize) + { + var x = imageSize.Width - IndicatorHeight; + + using (var backdroundBrush = new SolidBrush(Color.FromArgb(225, 204, 51, 51))) + { + graphics.FillRectangle(backdroundBrush, x, 0, IndicatorHeight, IndicatorHeight); + + const string text = "a"; + + x = imageSize.Width - 55; + + using (var font = new Font("Webdings", FontSize, FontStyle.Regular, GraphicsUnit.Pixel)) + { + using (var fontBrush = new SolidBrush(Color.White)) + { + graphics.DrawString(text, font, fontBrush, x, -2); + } + } + } + + } + } +} |
