public void GatherStatistics(Bitmap image) { // check pixel format if (image.PixelFormat == PixelFormat.Format24bppRgb) { ColorImageStatisticsDescription statDesc = new ColorImageStatisticsDescription(image); // show statistics propertyGrid.SelectedObject = statDesc; propertyGrid.ExpandAllGridItems(); } else { propertyGrid.SelectedObject = null; } }