aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-04-14 00:43:41 -0400
committerLuke <luke.pulverenti@gmail.com>2015-04-14 00:43:41 -0400
commit935de313d58c7a7ba792345c16cfd1c1aad09a78 (patch)
tree2e9334986de5864b00d4901f031b5de6a970305e /MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs
parent71a4f2761e784513ae2f3dda03aa549903808ebb (diff)
parentbd253399c2f1913c544c93fd6927dee37f8add2f (diff)
Merge pull request #1079 from MediaBrowser/dev
3.0.5582.0
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs70
1 files changed, 0 insertions, 70 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs b/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs
deleted file mode 100644
index 71cced041..000000000
--- a/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using ImageMagickSharp;
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Model.Drawing;
-using System.Globalization;
-
-namespace MediaBrowser.Server.Implementations.Drawing
-{
- public class UnplayedCountIndicator
- {
- private const int OffsetFromTopRightCorner = 38;
-
- private readonly IApplicationPaths _appPaths;
-
- public UnplayedCountIndicator(IApplicationPaths appPaths)
- {
- _appPaths = appPaths;
- }
-
- public void DrawUnplayedCountIndicator(MagickWand wand, ImageSize imageSize, int count)
- {
- var x = imageSize.Width - OffsetFromTopRightCorner;
- var text = count.ToString(CultureInfo.InvariantCulture);
-
- using (var draw = new DrawingWand())
- {
- using (PixelWand pixel = new PixelWand())
- {
- pixel.Color = "#52B54B";
- pixel.Opacity = 0.2;
- draw.FillColor = pixel;
- draw.DrawCircle(x, OffsetFromTopRightCorner, x - 20, OffsetFromTopRightCorner - 20);
-
- pixel.Opacity = 0;
- pixel.Color = "white";
- draw.FillColor = pixel;
- draw.Font = PlayedIndicatorDrawer.ExtractFont("robotoregular.ttf", _appPaths);
- draw.FontStyle = FontStyleType.NormalStyle;
- draw.TextAlignment = TextAlignType.CenterAlign;
- draw.FontWeight = FontWeightType.RegularStyle;
- draw.TextAntialias = true;
-
- var fontSize = 30;
- var y = OffsetFromTopRightCorner + 11;
-
- if (text.Length == 1)
- {
- x += 1;
- }
- else if (text.Length == 2)
- {
- x += 1;
- }
- else if (text.Length >= 3)
- {
- //x += 1;
- y -= 2;
- fontSize = 24;
- }
-
- draw.FontSize = fontSize;
- draw.DrawAnnotation(x, y, text);
-
- draw.FillColor = pixel;
- wand.CurrentImage.DrawImage(draw);
- }
-
- }
- }
- }
-}