Пример #1
0
        private Dictionary <string, Image> BuildImageList()
        {
            if (_controller == null || _controller.TileBrushManager == null)
            {
                return(null);
            }

            Dictionary <string, Image> imgList = new Dictionary <string, Image>();

            foreach (var brushCollection in _controller.TileBrushManager.DynamicBrushCollections)
            {
                foreach (DynamicTileBrush brush in brushCollection.Brushes)
                {
                    Bitmap image = ImageUtility.CreateCenteredBitmap(brush.MakePreview(64, 64), 64, 64);
                    image.Tag = brush.Uid;
                    imgList.Add(brush.Name, image);
                }
            }
            foreach (var brushCollection in _controller.TileBrushManager.StaticBrushCollections)
            {
                foreach (StaticTileBrush brush in brushCollection.Brushes)
                {
                    Bitmap image = ImageUtility.CreateCenteredBitmap(brush.MakePreview(64, 64), 64, 64);
                    image.Tag = brush.Uid;
                    imgList.Add(brush.Name, image);
                }
            }

            return(imgList);
        }
Пример #2
0
        private Dictionary <string, Image> BuildImageList(Guid objectPoolUid)
        {
            if (!_controller.ObjectPoolManager.Pools.Contains(objectPoolUid))
            {
                return(null);
            }

            Dictionary <string, Image> imgList = new Dictionary <string, Image>();

            foreach (ObjectClass obj in _controller.ObjectPoolManager.Pools[objectPoolUid].Objects)
            {
                if (obj.Image != null)
                {
                    Bitmap image = ImageUtility.CreateCenteredBitmap(obj.Image, 64, 64);
                    image.Tag = obj.Uid;
                    imgList.Add(obj.Name, image);
                }
            }

            return(imgList);
        }