/// <summary> /// Returns item size for the given view mode. /// </summary> /// <param name="view">The view mode for which the item measurement should be made.</param> public override Size MeasureItem(RootKit.Windows.Forms.View view) { if (view == RootKit.Windows.Forms.View.Thumbnails) { Size itemSize = new Size(); mTextHeight = (int)(5.8f * (float)CaptionFont.Height); int textHeight = mImageListView.Font.Height; // Calculate item size Size itemPadding = new Size(4, 4); itemSize.Width = ImageListView.ThumbnailSize.Width + 4 * itemPadding.Width + mTileWidth; itemSize.Height = Math.Max(mTextHeight, ImageListView.ThumbnailSize.Height) + 2 * itemPadding.Height; itemSize.Height += textHeight + System.Math.Max(4, textHeight / 3); // textHeight / 3 = vertical space between thumbnail and text itemSize.Height += textHeight + System.Math.Max(4, textHeight / 3); // textHeight / 3 = vertical space between thumbnail and text //itemSize.Height += mTextHeight + System.Math.Max(4, mTextHeight / 3); // textHeight / 3 = vertical space between thumbnail and text itemSize.Height += textHeight + System.Math.Max(4, textHeight / 3); // textHeight / 3 = vertical space between thumbnail and text return(itemSize); } else { return(base.MeasureItem(view)); } //Size itemPadding = new Size(4, 4); //itemSize = mImageListView.ThumbnailSize + itemPadding + itemPadding; //itemSize.Height += textHeight + System.Math.Max(4, textHeight / 3); // textHeight / 3 = vertical space between thumbnail and text }
/// <summary> /// Returns item size for the given view mode. /// </summary> /// <param name="view">The view mode for which the item measurement should be made.</param> public override Size MeasureItem(RootKit.Windows.Forms.View view) { if (view == RootKit.Windows.Forms.View.Thumbnails) { Size itemSize = new Size(); mTextHeight = (int)(5.8f * (float)CaptionFont.Height); // Calculate item size Size itemPadding = new Size(4, 4); itemSize.Width = ImageListView.ThumbnailSize.Width + 4 * itemPadding.Width + mTileWidth; itemSize.Height = Math.Max(mTextHeight, ImageListView.ThumbnailSize.Height) + 2 * itemPadding.Height; return(itemSize); } else { return(base.MeasureItem(view)); } }