Catalog · How the catalog works
AwImageGrid
A grid control capable of showing images.
- ★ 11 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
AwImageGrid
License
This project is licensed under the MIT License - see the LICENSE file for details.
Introduction
See: https://stackoverflow.com/a/8954813/757830
For the fun of it, I wrote an ImageGrid component for Jerry Dodge, user of and asker on Stack Overflow.
It has only a vertical scroll bar; resizing the width of the control adjusts the column count and row count. The images are cached as resized bitmaps in an internal list, along with their file names.
Because loading and resampling these images may take some time, depending on image count, resolution and whether you want to use the Graphics32 library for better resample quality, the component delegates the loading process to a separate thread, which (re)runs on setting the column width or the row height, and on changing the file names or the folder path in which the component tries to find all images of types to be supplied in the FileFormats property.
Features
- Creates and resizes image thumbs in a background thread, from file names with the GDI+ library or from manually added images with the Graphics 32 library
- Automatically recognizes all registered image file formats
- Animated scrolling
- Touchscreen support for scrolling by dragging the grid
- Keyboard support for selecting thumbs
- OwnerDraw support, e.g. for adding captions to the thumbs
- Virtual support for bypassing the automatic creation of thumbs
Properties and events
ColCount: number of columns, readonlyCount: number of images, readonlyImages: list of all manually added images where the thumbs are internally created fromItems: list of all filename-thumbnail or image-thumbnail combinationsRowCount: number of rows, readonlyThumbs: list of all internally created thumbsAutoHideScrollBar: hides the scroll bar when all rows are visibleBorderStyle: shows or hides themed borderBorderWidth: margin of the component, outside of the scroll barCellAlignment: alignes thumbs at the left, center or right of the cellCellHeight: height of cellCellLayout: alignes thumbs at the top, middle or bottom of the cellCellSpacing: spacing between the cellsCellWidth: width of cellColor: background color of border and cell spacingColWidth: width of column (equals width of cell plus cell spacing)DefaultDrawing: draws all thumbs by defaultDesignPreview: shows thumbs in the designerDragScroll: supports scrolling the grid by draging the gridFileFormats: image file name extensions by which the file names are filteredFileNames: list holding all file namesFolder: the directory in which the component tries to find all images filesItemIndex: selected cell indexMarkerColor: color of temporarily thumb marker during loading processMarkerStyle: style of temporarily thumb marker during loading processOnClickCell: fires when a cell is clickedOnDrawCell: fires when a cell is drawnOnMeasureThumb: fires when the size of a thumb is to be calculatedOnProgress: fires when an image is resized to thumb formatOnUnresolved: fires when a thumb cannot be created, e.g. when file name is not foundRetainUnresolvedItems: keeps empty thumbs in the listRowHeight: the row height (equals cell height plus cell spacing)ParentBackground: draws the (themed) background of the parent in the border and between the cellsProportional: resizes images proportionallySorted: file names are sortedStretch: stretches small images up to the cell sizeVirtualMode: prevents of automatically creating the thumbsWheelScrollLines: number of rows to be scrolled with mouse wheel

