/// <summary>
        /// Draws the specified item on the given graphics.
        /// </summary>
        /// <param name="g">The System.Drawing.Graphics to draw on.</param>
        /// <param name="item">The ImageListViewItem to draw.</param>
        /// <param name="state">The current view state of item.</param>
        /// <param name="bounds">The bounding rectangle of item in client coordinates.</param>
        public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
        {
            if (ImageListView.View == View.Details)
            {
                base.DrawItem(g, item, state, bounds);
                return;
            }

            g.SmoothingMode = SmoothingMode.HighQuality;
            var borderRadius = Helpers.IsOS(WindowsOS.Win11) ? 5 : 1;
            var itemPadding  = new Size(5, 5);
            var itemMargin   = new Size(5, 5);
            var itemBounds   = new Rectangle(new(
                                                 bounds.X,
                                                 bounds.Y + itemMargin.Height),
                                             new(bounds.Width - itemMargin.Width, bounds.Height - 2 * itemMargin.Width));

            // on selected
            if ((state & ItemState.Selected) != ItemState.None)
            {
                using var brush = new SolidBrush(theme.AccentColor);
                Utility.FillRoundedRectangle(g, brush, itemBounds, borderRadius);
            }

            // on hover
            if ((state & ItemState.Hovered) != ItemState.None)
            {
                using var brush = new SolidBrush(theme.AccentLightColor);
                Utility.FillRoundedRectangle(g, brush, itemBounds, borderRadius);
            }

            // Draw the image
            var img = item.GetCachedImage(CachedImageType.Thumbnail);

            if (img != null)
            {
                var pos = Utility.GetSizedImageBounds(img, new Rectangle(
                                                          itemBounds.Location + itemPadding, new Size(
                                                              itemBounds.Width - 2 * itemPadding.Width,
                                                              itemBounds.Height - 2 * itemPadding.Width)));

                g.DrawImage(img, pos);
            }
        }
Beispiel #2
0
        public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
        {
            var colorScheme = MaterialSkin.MaterialSkinManager.Instance.ColorScheme;

            if (IsItemSelected())
            {
                g.FillRectangle(colorScheme.LightPrimaryBrush, bounds);
            }

            if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
            {
                g.FillRectangle(colorScheme.DarkPrimaryBrush, bounds);
            }

            if ((state & ItemState.Hovered) != ItemState.None)
            {
                using (var hoverBrush = new SolidBrush(ImageListView.Colors.HoverColor1))
                    g.FillRectangle(colorScheme.AccentBrush, bounds);
            }

            Image img = item.GetCachedImage(CachedImageType.Thumbnail);

            if (img != null)
            {
                Rectangle pos = Utility.GetSizedImageBounds(img, new Rectangle(bounds.Location + new Size(4, 12), ImageListView.ThumbnailSize));
                g.DrawImage(img, pos);
            }

            if (state == ItemState.None)
            {
                g.DrawRectangle(colorScheme.DarkPrimaryPen, bounds.Left + 1, bounds.Top + 1, bounds.Width - 3, bounds.Height - 3);
            }

            bool IsItemSelected() => (ImageListView.Focused &&
                                      ((state & ItemState.Selected) != ItemState.None)) ||
            (!ImageListView.Focused &&
             ((state & ItemState.Selected) != ItemState.None) &&
             ((state & ItemState.Hovered) != ItemState.None));
        }
Beispiel #3
0
        public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
        {
            Clip = false;

            Size      itemPadding = new Size(4, 4);
            Rectangle imageBounds = bounds;

            string text      = Path.GetFileNameWithoutExtension(item.Text);
            Size   szt       = TextRenderer.MeasureText(text, ImageListView.Font);
            int    textWidth = szt.Width + (itemPadding.Width * 2);

            if ((state & ItemState.Hovered) != ItemState.None && textWidth > bounds.Width)
            {
                bounds = new Rectangle(bounds.X + (bounds.Width / 2) - (textWidth / 2), bounds.Y, textWidth, bounds.Height);
            }

            // Paint background
            if (ImageListView.Enabled)
            {
                using (Brush bItemBack = new SolidBrush(ImageListView.Colors.BackColor))
                {
                    g.FillRectangle(bItemBack, bounds);
                }
            }
            else
            {
                using (Brush bItemBack = new SolidBrush(ImageListView.Colors.DisabledBackColor))
                {
                    g.FillRectangle(bItemBack, bounds);
                }
            }

            if ((state & ItemState.Disabled) != ItemState.None) // Paint background Disabled
            {
                using (Brush bDisabled = new LinearGradientBrush(bounds.Offset(1), ImageListView.Colors.DisabledColor1, ImageListView.Colors.DisabledColor2, LinearGradientMode.Vertical))
                {
                    g.FillRectangle(bDisabled, bounds);
                }
            }
            else if ((ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None)) ||
                     (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None) && ((state & ItemState.Hovered) != ItemState.None))) // Paint background Selected
            {
                using (Brush bSelected = new LinearGradientBrush(bounds.Offset(1), ImageListView.Colors.SelectedColor1, ImageListView.Colors.SelectedColor2, LinearGradientMode.Vertical))
                {
                    g.FillRectangle(bSelected, bounds);
                }
            }
            else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None)) // Paint background unfocused
            {
                using (Brush bGray64 = new LinearGradientBrush(bounds.Offset(1), ImageListView.Colors.UnFocusedColor1, ImageListView.Colors.UnFocusedColor2, LinearGradientMode.Vertical))
                {
                    g.FillRectangle(bGray64, bounds);
                }
            }

            // Paint background Hovered
            if ((state & ItemState.Hovered) != ItemState.None)
            {
                using (Brush bHovered = new LinearGradientBrush(bounds.Offset(1), ImageListView.Colors.HoverColor1, ImageListView.Colors.HoverColor2, LinearGradientMode.Vertical))
                {
                    g.FillRectangle(bHovered, bounds);
                }
            }

            // Draw the image
            Image img = item.GetCachedImage(CachedImageType.Thumbnail);

            if (img != null)
            {
                Rectangle pos = Utility.GetSizedImageBounds(img, new Rectangle(imageBounds.Location + itemPadding, ImageListView.ThumbnailSize));
                g.DrawImage(img, pos);
            }

            // Draw item text
            Color foreColor = ImageListView.Colors.ForeColor;

            if ((state & ItemState.Disabled) != ItemState.None)
            {
                foreColor = ImageListView.Colors.DisabledForeColor;
            }
            else if ((state & ItemState.Selected) != ItemState.None)
            {
                if (ImageListView.Focused)
                {
                    foreColor = ImageListView.Colors.SelectedForeColor;
                }
                else
                {
                    foreColor = ImageListView.Colors.UnFocusedForeColor;
                }
            }

            Rectangle       rt = new Rectangle(bounds.Left, bounds.Top + (2 * itemPadding.Height) + ImageListView.ThumbnailSize.Height, bounds.Width, szt.Height);
            TextFormatFlags flags;

            if ((state & ItemState.Hovered) != ItemState.None)
            {
                flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.NoClipping;
            }
            else
            {
                flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis;
            }

            TextRenderer.DrawText(g, text, ImageListView.Font, rt, foreColor, flags);
        }
        public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
        {
            Region oldClip = g.Clip;

            g.Clip = new Region(ClientBounds);

            // Paint background
            if ((state & ItemState.Selected) != ItemState.None)
            {
                if ((state & ItemState.Hovered) != ItemState.None)
                {
                    using (Brush bSelected = new SolidBrush(hoveredSelectedColor))
                    {
                        g.FillRectangle(bSelected, bounds);
                    }
                    using (Pen pSelected = new Pen(hoveredSelectedBorderColor))
                    {
                        g.DrawRectangle(pSelected, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1);
                    }
                }
                else if (!ImageListView.Focused)
                {
                    using (Brush bSelected = new SolidBrush(unfocusedSelectedColor))
                    {
                        g.FillRectangle(bSelected, bounds);
                    }
                }
                else
                {
                    using (Brush bSelected = new SolidBrush(focusedSelectedColor))
                    {
                        g.FillRectangle(bSelected, bounds);
                    }
                }
            }
            else if ((state & ItemState.Hovered) != ItemState.None)
            {
                using (Brush bHovered = new SolidBrush(hoveredColor))
                {
                    g.FillRectangle(bHovered, bounds);
                }
            }

            // Draw the image
            Image img = item.GetCachedImage(CachedImageType.Thumbnail);

            if (img != null)
            {
                Rectangle pos = Utility.GetSizedImageBounds(img, new Rectangle(bounds.Location + itemPadding,
                                                                               ImageListView.ThumbnailSize));
                g.DrawImage(img, pos);
            }

            // Draw item text
            Color foreColor = ImageListView.Colors.ForeColor;

            if ((state & ItemState.Disabled) != ItemState.None)
            {
                foreColor = ImageListView.Colors.DisabledForeColor;
            }
            else if ((state & ItemState.Selected) != ItemState.None)
            {
                if (ImageListView.Focused)
                {
                    foreColor = ImageListView.Colors.SelectedForeColor;
                }
                else
                {
                    foreColor = ImageListView.Colors.UnFocusedForeColor;
                }
            }
            Size      szt = System.Windows.Forms.TextRenderer.MeasureText(item.Text, ImageListView.Font);
            Rectangle rt  = new Rectangle(bounds.Left + itemPadding.Width,
                                          bounds.Top + 2 * itemPadding.Height + ImageListView.ThumbnailSize.Height,
                                          ImageListView.ThumbnailSize.Width, szt.Height);

            System.Windows.Forms.TextRenderer.DrawText(g, item.Text, ImageListView.Font, rt, foreColor,
                                                       System.Windows.Forms.TextFormatFlags.EndEllipsis |
                                                       System.Windows.Forms.TextFormatFlags.HorizontalCenter |
                                                       System.Windows.Forms.TextFormatFlags.VerticalCenter | System.Windows.Forms.TextFormatFlags.SingleLine);

            g.Clip = oldClip;
        }
        /// <summary>
        /// Draws the specified item on the given graphics.
        /// </summary>
        /// <param name="g">The System.Drawing.Graphics to draw on.</param>
        /// <param name="item">The ImageListViewItem to draw.</param>
        /// <param name="state">The current view state of item.</param>
        /// <param name="bounds">The bounding rectangle of item in client coordinates.</param>
        public override void DrawItem(System.Drawing.Graphics g, ImageListViewItem item, ItemState state, System.Drawing.Rectangle bounds)
        {
            // Paint background
            var inner = bounds;

            inner.Inflate(-1, -1);
            System.Drawing.SolidBrush borderColor = new System.Drawing.SolidBrush(System.Drawing.Color.LightGray);

            if (ImageListView.Enabled || !item.Enabled)

            {
                //Draw border
                g.FillRectangle(borderColor, bounds);
                // Fill inside
                if (ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    g.FillRectangle(SystemBrushes.Highlight, inner);
                }
                else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    g.FillRectangle(SystemBrushes.GrayText, inner);
                }
                else
                {
                    g.FillRectangle(SystemBrushes.Window, inner);
                }
            }
            else
            {
                g.FillRectangle(SystemBrushes.Control, bounds);
            }
            if (ImageListView.View != Manina.Windows.Forms.View.Details)
            {
                Size itemPadding = new Size(4, 4);

                // Draw the image
                Image img = item.GetCachedImage(CachedImageType.Thumbnail);
                if (img != null)
                {
                    Rectangle border = new Rectangle(bounds.Location + itemPadding, ImageListView.ThumbnailSize);
                    Rectangle pos    = Utility.GetSizedImageBounds(img, border);
                    g.DrawImage(img, pos);


                    if (ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                    {
                        using (Pen pen = new Pen(SystemColors.Highlight, 3))
                        {
                            g.DrawRectangle(pen, border);
                        }
                    }
                    else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                    {
                        using (Pen pen = new Pen(SystemColors.GrayText, 3))
                        {
                            pen.Alignment = PenAlignment.Center;
                            g.DrawRectangle(pen, border);
                        }
                    }
                    else
                    {
                        using (Pen pGray128 = new Pen(Color.FromArgb(128, SystemColors.GrayText)))
                        {
                            g.DrawRectangle(pGray128, border);
                        }
                    }
                }

                // Draw item text

                SizeF      szt = TextRenderer.MeasureText(g, item.Text, ImageListView.Font);
                RectangleF rt;
                using (StringFormat sf = new StringFormat())
                {
                    rt = new RectangleF(
                        bounds.Left + itemPadding.Width,
                        bounds.Top + 3 * itemPadding.Height + ImageListView.ThumbnailSize.Height,
                        ImageListView.ThumbnailSize.Width,
                        szt.Width <= ImageListView.ThumbnailSize.Width ? szt.Height : szt.Height * 2
                        );
                    sf.Alignment   = StringAlignment.Center;
                    sf.FormatFlags = StringFormatFlags.LineLimit;
                    sf.Trimming    = StringTrimming.EllipsisCharacter;
                    rt.Width      += 1;
                    rt.Inflate(1, 2);
                    if (ImageListView.Focused && ((state & ItemState.Focused) != ItemState.None))
                    {
                        rt.Inflate(-1, -1);
                    }
                    // Highlight text rectangle on selection

                    /*
                     * if (ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                     * {
                     *  g.FillRectangle(SystemBrushes.Highlight, rt);
                     * }
                     * else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                     * {
                     *  g.FillRectangle(SystemBrushes.GrayText, rt);
                     * }
                     */
                    if ((state & ItemState.Disabled) != ItemState.None)
                    {
                        g.DrawString(item.Text, ImageListView.Font, SystemBrushes.GrayText, rt, sf);
                    }
                    else if (((state & ItemState.Selected) != ItemState.None))
                    {
                        g.DrawString(item.Text, ImageListView.Font, SystemBrushes.HighlightText, rt, sf);
                    }
                    else
                    {
                        g.DrawString(item.Text, ImageListView.Font, SystemBrushes.WindowText, rt, sf);
                    }
                }
                // focus text on focused item

                /*
                 * if (ImageListView.Focused && ((state & ItemState.Focused) != ItemState.None))
                 * {
                 *  Rectangle fRect = Rectangle.Round(rt);
                 *  fRect.Inflate(1, 1);
                 *  ControlPaint.DrawFocusRectangle(g, fRect);
                 * }
                 */
            }
            else // if (ImageListView.View == Manina.Windows.Forms.View.Details)
            {
                if (ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    g.FillRectangle(SystemBrushes.Highlight, bounds);
                }
                else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    g.FillRectangle(SystemBrushes.GrayText, bounds);
                }

                Size offset = new Size(2, (bounds.Height - ImageListView.Font.Height) / 2);
                using (StringFormat sf = new StringFormat())
                {
                    sf.FormatFlags   = StringFormatFlags.NoWrap;
                    sf.Alignment     = StringAlignment.Near;
                    sf.LineAlignment = StringAlignment.Center;
                    sf.Trimming      = StringTrimming.EllipsisCharacter;
                    // Sub text
                    List <ImageListView.ImageListViewColumnHeader> uicolumns = ImageListView.Columns.GetDisplayedColumns();
                    RectangleF rt = new RectangleF(bounds.Left + offset.Width, bounds.Top + offset.Height, uicolumns[0].Width - 2 * offset.Width, bounds.Height - 2 * offset.Height);
                    foreach (ImageListView.ImageListViewColumnHeader column in uicolumns)
                    {
                        rt.Width = column.Width - 2 * offset.Width;
                        int iconOffset = 0;
                        if (column.Type == ColumnType.Name)
                        {
                            // Allocate space for checkbox and file icon
                            if (ImageListView.ShowCheckBoxes && ImageListView.ShowFileIcons)
                            {
                                iconOffset += 2 * 16 + 3 * 2;
                            }
                            else if (ImageListView.ShowCheckBoxes)
                            {
                                iconOffset += 16 + 2 * 2;
                            }
                            else if (ImageListView.ShowFileIcons)
                            {
                                iconOffset += 16 + 2 * 2;
                            }
                        }
                        rt.X     += iconOffset;
                        rt.Width -= iconOffset;

                        Brush forecolor = SystemBrushes.WindowText;
                        if ((state & ItemState.Disabled) != ItemState.None)
                        {
                            forecolor = SystemBrushes.GrayText;
                        }
                        else if ((state & ItemState.Selected) != ItemState.None)
                        {
                            forecolor = SystemBrushes.HighlightText;
                        }

                        if (column.Type == ColumnType.Rating && ImageListView.RatingImage != null && ImageListView.EmptyRatingImage != null)
                        {
                            int w      = ImageListView.RatingImage.Width;
                            int y      = (int)(rt.Top + (rt.Height - ImageListView.RatingImage.Height) / 2.0f);
                            int rating = item.StarRating;
                            if (rating < 0)
                            {
                                rating = 0;
                            }
                            if (rating > 5)
                            {
                                rating = 5;
                            }
                            for (int i = 1; i <= rating; i++)
                            {
                                g.DrawImage(ImageListView.RatingImage, rt.Left + (i - 1) * w, y);
                            }
                            for (int i = rating + 1; i <= 5; i++)
                            {
                                g.DrawImage(ImageListView.EmptyRatingImage, rt.Left + (i - 1) * w, y);
                            }
                        }
                        else
                        {
                            g.DrawString(item.SubItems[column].Text, ImageListView.Font, forecolor, rt, sf);
                        }

                        rt.X -= iconOffset;
                        rt.X += column.Width;
                    }
                }

                if (ImageListView.Focused && ((state & ItemState.Focused) != ItemState.None))
                {
                    ControlPaint.DrawFocusRectangle(g, bounds);
                }
            }
        }
Beispiel #6
0
        public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
        {
            Clip = (ImageListView.View == View.Details);

            if (ImageListView.View == View.Details)
            {
                base.DrawItem(g, item, state, bounds);
            }
            else
            {
                Rectangle _controlBounds = ClientBounds;

                // Get item image
                Image _img = null;

                if ((state & ItemState.Hovered) != ItemState.None)
                {
                    _img = GetImageAsync(item, new Size(bounds.Width - 8, bounds.Height - 8));
                }

                if (_img == null)
                {
                    _img = item.GetCachedImage(CachedImageType.Thumbnail);
                }

                if (_img != null)
                {
                    // Calculate image bounds
                    Rectangle _pos         = Utility.GetSizedImageBounds(_img, Rectangle.Inflate(bounds, -4, -4));
                    int       _imageWidth  = _pos.Width;
                    int       _imageHeight = _pos.Height;
                    int       _imageX      = _pos.X;
                    int       _imageY      = _pos.Y;

                    // Paint background
                    if (ImageListView.Enabled)
                    {
                        using (Brush _bItemBack = new SolidBrush(ImageListView.Colors.BackColor))
                        {
                            g.FillRectangle(_bItemBack, bounds);
                        }
                    }
                    else
                    {
                        using (Brush _bItemBack = new SolidBrush(ImageListView.Colors.DisabledBackColor))
                        {
                            g.FillRectangle(_bItemBack, bounds);
                        }
                    }

                    if ((ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None)) ||
                        (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None) &&
                         ((state & ItemState.Hovered) != ItemState.None)))
                    {
                        using (
                            Brush _bSelected = new LinearGradientBrush(bounds, ImageListView.Colors.SelectedColor1,
                                                                       ImageListView.Colors.SelectedColor2,
                                                                       LinearGradientMode.Vertical))
                        {
                            Utility.FillRoundedRectangle(g, _bSelected, bounds, 5);
                        }
                    }
                    else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                    {
                        using (
                            Brush _bGray64 = new LinearGradientBrush(bounds, ImageListView.Colors.UnFocusedColor1,
                                                                     ImageListView.Colors.UnFocusedColor2,
                                                                     LinearGradientMode.Vertical))
                        {
                            Utility.FillRoundedRectangle(g, _bGray64, bounds, 5);
                        }
                    }

                    if (((state & ItemState.Hovered) != ItemState.None))
                    {
                        using (
                            Brush _bHovered = new LinearGradientBrush(bounds, ImageListView.Colors.HoverColor1,
                                                                      ImageListView.Colors.HoverColor2,
                                                                      LinearGradientMode.Vertical))
                        {
                            Utility.FillRoundedRectangle(g, _bHovered, bounds, 5);
                        }
                    }

                    // Draw the image
                    g.DrawImage(_img, _imageX, _imageY, _imageWidth, _imageHeight);

                    // Draw image border
                    if (Math.Min(_imageWidth, _imageHeight) > 32)
                    {
                        using (Pen _pOuterBorder = new Pen(ImageListView.Colors.ImageOuterBorderColor))
                        {
                            g.DrawRectangle(_pOuterBorder, _imageX, _imageY, _imageWidth, _imageHeight);
                        }

                        if (Math.Min(_imageWidth, _imageHeight) > 32)
                        {
                            using (Pen _pInnerBorder = new Pen(ImageListView.Colors.ImageInnerBorderColor))
                            {
                                g.DrawRectangle(_pInnerBorder, _imageX + 1, _imageY + 1, _imageWidth - 2,
                                                _imageHeight - 2);
                            }
                        }
                    }
                }
                else
                {
                    // Paint background
                    if (ImageListView.Enabled)
                    {
                        using (Brush _bItemBack = new SolidBrush(ImageListView.Colors.BackColor))
                        {
                            g.FillRectangle(_bItemBack, bounds);
                        }
                    }
                    else
                    {
                        using (Brush _bItemBack = new SolidBrush(ImageListView.Colors.DisabledBackColor))
                        {
                            g.FillRectangle(_bItemBack, bounds);
                        }
                    }
                }

                // Item border
                using (Pen _pWhite128 = new Pen(Color.FromArgb(128, ImageListView.Colors.ControlBackColor)))
                {
                    Utility.DrawRoundedRectangle(g, _pWhite128, bounds.Left + 1, bounds.Top + 1, bounds.Width - 3,
                                                 bounds.Height - 3, 4);
                }

                if (ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    using (Pen _pHighlight128 = new Pen(ImageListView.Colors.SelectedBorderColor))
                    {
                        Utility.DrawRoundedRectangle(g, _pHighlight128, bounds.Left, bounds.Top, bounds.Width - 1,
                                                     bounds.Height - 1, 4);
                    }
                }
                else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
                {
                    using (Pen _pGray128 = new Pen(ImageListView.Colors.UnFocusedBorderColor))
                    {
                        Utility.DrawRoundedRectangle(g, _pGray128, bounds.Left, bounds.Top, bounds.Width - 1,
                                                     bounds.Height - 1, 4);
                    }
                }
                else if ((state & ItemState.Selected) == ItemState.None)
                {
                    using (Pen _pGray64 = new Pen(ImageListView.Colors.BorderColor))
                    {
                        Utility.DrawRoundedRectangle(g, _pGray64, bounds.Left, bounds.Top, bounds.Width - 1,
                                                     bounds.Height - 1, 4);
                    }
                }

                if (ImageListView.Focused && ((state & ItemState.Hovered) != ItemState.None))
                {
                    using (Pen _pHighlight64 = new Pen(ImageListView.Colors.HoverBorderColor))
                    {
                        Utility.DrawRoundedRectangle(g, _pHighlight64, bounds.Left, bounds.Top, bounds.Width - 1,
                                                     bounds.Height - 1, 4);
                    }
                }

                if (item.Tag != null)
                {
                    if (item.Tag is ImageViewItemTAG)
                    {
                        string _type = (item.Tag as ImageViewItemTAG).Type;

                        if (_type == "Medium" || _type == "Loading")
                        {
                            g.FillRectangle(Brushes.OrangeRed, bounds.Left + 2, bounds.Top + 2, 1, 1);
                        }
                    }

                    if (item.Tag is EditModePhotoType)
                    {
                        EditModePhotoType _type = (EditModePhotoType)item.Tag;

                        if (_type == EditModePhotoType.NewAdd)
                        {
                            g.DrawString("+", new Font("Tahoma", 9, FontStyle.Bold), Brushes.Red, bounds.Left + 1, bounds.Top + 1);
                        }
                    }
                }
            }
        }