feature req: fake cover with title name (1 Viewer)

HappyTalk

Portal Pro
July 16, 2006
307
8
UK
It would be nice if when showing a fake cover for entries with no matching cover image if the actual title text were superimposed within it, using centered text. A suitable movie style font could be used so it almost looks like a movie cover albeit somewhat generic. At the moment if in an icon view you do not know what a video is until you select it and see in the top bar. An example might be like this:-

fakecover.jpg


Taken a stage further you could allow the fake cover selectable in the config to append a digit 1-9 which would select a different cover dependant on the rating, or if that is not available just use the image name without a digit appended. Or you could just randomise the cover used, by allowing any cover that starts with the fake cover name.
 

zebons

Portal Pro
January 2, 2006
1,484
114
It would be nice if when showing a fake cover for entries with no matching cover image if the actual title text were superimposed within it, using centered text. A suitable movie style font could be used so it almost looks like a movie cover albeit somewhat generic.
I don't really know how to do that... Any idea ?
 

Inker

Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    It would be nice if when showing a fake cover for entries with no matching cover image if the actual title text were superimposed within it, using centered text. A suitable movie style font could be used so it almost looks like a movie cover albeit somewhat generic.
    I don't really know how to do that... Any idea ?

    Quite simple really, just draw an image in code, and give that to mp as the texture (you might have to adept it a bit to wrap text etc).

    From TV-Series code:
    Code:
    /// <summary>
            /// Create a banner image of the specified size, outputting the input text on it
            /// </summary>
            /// <param name="sizeImage">Size of the image to be generated</param>
            /// <param name="label">Text to be output on the image</param>
            /// <returns>a bitmap object</returns>
            private static Bitmap drawSimpleBanner(Size sizeImage, string label)
            {
                Bitmap image = new Bitmap(sizeImage.Width, sizeImage.Height);
                Graphics gph = Graphics.FromImage(image);
                //gph.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.White)), new Rectangle(0, 0, sizeImage.Width, sizeImage.Height));
                GUIFont fontList = GUIFontManager.GetFont(s_sFontName);
                Font font = new Font(fontList.FontName, 36);
                gph.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                gph.DrawString(label, font, new SolidBrush(Color.FromArgb(200, Color.White)), 5, (sizeImage.Height - font.GetHeight()) / 2);
                gph.Dispose();
                return image;
            }

    Maybe this helps you.

    Inker
     

    zebons

    Portal Pro
    January 2, 2006
    1,484
    114
    It would be nice if when showing a fake cover for entries with no matching cover image if the actual title text were superimposed within it, using centered text. A suitable movie style font could be used so it almost looks like a movie cover albeit somewhat generic.
    I don't really know how to do that... Any idea ?

    Quite simple really, just draw an image in code, and give that to mp as the texture (you might have to adept it a bit to wrap text etc).

    From TV-Series code:
    Code:
    /// <summary>
            /// Create a banner image of the specified size, outputting the input text on it
            /// </summary>
            /// <param name="sizeImage">Size of the image to be generated</param>
            /// <param name="label">Text to be output on the image</param>
            /// <returns>a bitmap object</returns>
            private static Bitmap drawSimpleBanner(Size sizeImage, string label)
            {
                Bitmap image = new Bitmap(sizeImage.Width, sizeImage.Height);
                Graphics gph = Graphics.FromImage(image);
                //gph.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.White)), new Rectangle(0, 0, sizeImage.Width, sizeImage.Height));
                GUIFont fontList = GUIFontManager.GetFont(s_sFontName);
                Font font = new Font(fontList.FontName, 36);
                gph.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                gph.DrawString(label, font, new SolidBrush(Color.FromArgb(200, Color.White)), 5, (sizeImage.Height - font.GetHeight()) / 2);
                gph.Dispose();
                return image;
            }

    Maybe this helps you.

    Inker
    Thanks but how can I choose the Image's size as it depend on skin design ?
    How can I download the TVSeries code source to take a look on it ? I try but I cann't do a svn checkout on 'http://mp-tvseries.svn.sourceforge.net/viewvc/mp-tvseries/'
    Isn't it a potential performance problem if the plugin have to generate many missing Images ?
     

    HappyTalk

    Portal Pro
    July 16, 2006
    307
    8
    UK
    I would expect that generating text would not be any slower than having to manipulate a bitmap image. It's a shame that the function in the core MP code that prints the icons does not have an AlternateText parameter that it uses if it cannot find the supplied bitmap, similarly to how html works. (That said if the skins were created using html/css the U.I could render in a remote web browser unaltered via a webserver)
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    It would be nice if when showing a fake cover for entries with no matching cover image if the actual title text were superimposed within it, using centered text. A suitable movie style font could be used so it almost looks like a movie cover albeit somewhat generic.
    I don't really know how to do that... Any idea ?

    Quite simple really, just draw an image in code, and give that to mp as the texture (you might have to adept it a bit to wrap text etc).

    From TV-Series code:
    Code:
    /// <summary>
            /// Create a banner image of the specified size, outputting the input text on it
            /// </summary>
            /// <param name="sizeImage">Size of the image to be generated</param>
            /// <param name="label">Text to be output on the image</param>
            /// <returns>a bitmap object</returns>
            private static Bitmap drawSimpleBanner(Size sizeImage, string label)
            {
                Bitmap image = new Bitmap(sizeImage.Width, sizeImage.Height);
                Graphics gph = Graphics.FromImage(image);
                //gph.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.White)), new Rectangle(0, 0, sizeImage.Width, sizeImage.Height));
                GUIFont fontList = GUIFontManager.GetFont(s_sFontName);
                Font font = new Font(fontList.FontName, 36);
                gph.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                gph.DrawString(label, font, new SolidBrush(Color.FromArgb(200, Color.White)), 5, (sizeImage.Height - font.GetHeight()) / 2);
                gph.Dispose();
                return image;
            }

    Maybe this helps you.

    Inker
    Thanks but how can I choose the Image's size as it depend on skin design ?
    How can I download the TVSeries code source to take a look on it ? I try but I cann't do a svn checkout on 'http://mp-tvseries.svn.sourceforge.net/viewvc/mp-tvseries/'
    Isn't it a potential performance problem if the plugin have to generate many missing Images ?

    Well, I assume your image posters have some sort of std. size, or at least aspect ratio, you just create it in that size.

    Checkout should work fine, unless sourceforge is down (again....), just try again. Interesting for you is probably just ImageAllocator. As for performance, its slow if you have to generate hundreds of them, but the idea is that this is for the odd ones that don't have a poster. And don't forgot that you save on the cycles that would normally be spend loading the image from disk (which is very slow for large images if you use the build-in .net methods....take a look at image allocator for a much faster alternative.
     

    Users who are viewing this thread

    Top Bottom