diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-01-07 00:47:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-07 00:47:06 -0500 |
| commit | c986340c02cb0b7fe06569d25a1b5d1c8375f7f6 (patch) | |
| tree | 4971c970bbdb797cc5b3da2d8bae506231b173a5 /Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs | |
| parent | 76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (diff) | |
| parent | 0b804629b85498370c882f5562dfc7acd84bfd11 (diff) | |
Merge pull request #419 from jellyfin/dev
Master 10.0.0
Diffstat (limited to 'Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs')
| -rw-r--r-- | Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs b/Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs deleted file mode 100644 index ee685c3c5..000000000 --- a/Emby.Drawing.ImageMagick/UnplayedCountIndicator.cs +++ /dev/null @@ -1,73 +0,0 @@ -using ImageMagickSharp; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Model.Drawing; -using System.Globalization; -using MediaBrowser.Model.IO; - -namespace Emby.Drawing.ImageMagick -{ - public class UnplayedCountIndicator - { - private const int OffsetFromTopRightCorner = 38; - - private readonly IApplicationPaths _appPaths; - private readonly IFileSystem _fileSystem; - - public UnplayedCountIndicator(IApplicationPaths appPaths, IFileSystem fileSystem) - { - _appPaths = appPaths; - _fileSystem = fileSystem; - } - - 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, _fileSystem); - 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); - } - - } - } - } -} |
