DrawOverlayOnEpisodeThumb() public static méthode

Draws a trakt overlay, library/seen/watchlist icon on a episode thumb This is done in memory and wont touch the existing file
public static DrawOverlayOnEpisodeThumb ( string origThumb, MainOverlayImage mainType, RatingOverlayImage ratingType, Size size ) : Bitmap
origThumb string Filename of the untouched episode thumb
mainType MainOverlayImage
ratingType RatingOverlayImage
size System.Drawing.Size Size of returned image
Résultat System.Drawing.Bitmap
Exemple #1
0
        /// <summary>
        /// Loads an Image from memory into a facade item
        /// </summary>
        /// <param name="imageFilePath">Filename of image</param>
        protected void SetImageToGui(string imageFilePath)
        {
            if (string.IsNullOrEmpty(imageFilePath))
            {
                return;
            }

            if (Show == null || Episode == null)
            {
                return;
            }

            // determine the overlay to add to poster
            MainOverlayImage mainOverlay = MainOverlayImage.None;

            // don't show watchlist overlay in personal watchlist window
            if (WindowID == (int)TraktGUIWindows.WatchedListEpisodes)
            {
                if ((GUIWatchListEpisodes.CurrentUser != TraktSettings.Username) && Episode.IsWatchlisted())
                {
                    mainOverlay = MainOverlayImage.Watchlist;
                }
                else if (Episode.IsWatched(Show))
                {
                    mainOverlay = MainOverlayImage.Seenit;
                }
            }
            else
            {
                if (Episode.IsWatchlisted())
                {
                    mainOverlay = MainOverlayImage.Watchlist;
                }
                else if (Episode.IsWatched(Show))
                {
                    mainOverlay = MainOverlayImage.Seenit;
                }
            }

            // add additional overlay if applicable
            if (Episode.IsCollected(Show))
            {
                mainOverlay |= MainOverlayImage.Library;
            }

            RatingOverlayImage ratingOverlay = GUIImageHandler.GetRatingOverlay(Episode.UserRating(Show));

            // get a reference to a MediaPortal Texture Identifier
            string suffix  = mainOverlay.ToString().Replace(", ", string.Empty) + Enum.GetName(typeof(RatingOverlayImage), ratingOverlay);
            string texture = GUIImageHandler.GetTextureIdentFromFile(imageFilePath, suffix);

            // build memory image, resize thumbnail in case its a fanart
            Image memoryImage = null;

            if (mainOverlay != MainOverlayImage.None || ratingOverlay != RatingOverlayImage.None)
            {
                memoryImage = GUIImageHandler.DrawOverlayOnEpisodeThumb(imageFilePath, mainOverlay, ratingOverlay, new Size(400, 225));
                if (memoryImage == null)
                {
                    return;
                }

                // load texture into facade item
                if (GUITextureManager.LoadFromMemory(memoryImage, texture, 0, 0, 0) > 0)
                {
                    ThumbnailImage = texture;
                    IconImage      = texture;
                    IconImageBig   = texture;
                }
            }
            else
            {
                ThumbnailImage = imageFilePath;
                IconImage      = imageFilePath;
                IconImageBig   = imageFilePath;
            }

            // if selected and is current window force an update of thumbnail
            this.UpdateItemIfSelected(WindowID, ItemId);
        }