Skip to content

Instantly share code, notes, and snippets.

@appakz
Created February 21, 2025 15:31
Show Gist options
  • Save appakz/eac3e8fd51d7dd597ec886918f6b2bdb to your computer and use it in GitHub Desktop.
Save appakz/eac3e8fd51d7dd597ec886918f6b2bdb to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Drawing;
namespace ImageViewer
{
internal class CustomListView : ListView
{
/// <summary>
/// When called, this function should use the provided Graphics instance to paint all the provided images to the
/// control surface in a grid layout.
///
/// Things to note about this control:
/// 1. There are properties called TileSize and TilePadding you can use in the layout logic.
/// 2. Don't make any assumptions about the number of images that are passed in.
/// 3. Each call to PaintTiles is independent and will not be affected by previous calls.
/// 4. Both the graphics and imageList parameters are guaranteed to be non-null.
///
/// </summary>
/// <param name="graphics">Graphics instance to be used when painting images</param>
/// <param name="imageList">List of images to be painted to the control surface</param>
protected override void PaintTiles(Graphics graphics, IList<Image> imageList)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment