Exemplo n.º 1
0
 private void _listBoxController_SelectedItemChanged(object sender, EventArgs e)
 {
     _selectedImageResource = _listBoxController.GetSelectedItem <ImageResourceInfo>();
     if (_selectedImageResource == null)
     {
         if (this.pictureBoxPreview.Image != null)
         {
             this.pictureBoxPreview.Image = null;
         }
         return;
     }
     if (_imageCache.Keys.Contains(_selectedImageResource) == false)
     {
         Image thumbnailImage = DrawingTool.GetAutoScaleThumbnailImage(
             _selectedImageResource.GetImage(), this.pictureBoxPreview.Width, this.pictureBoxPreview.Height);
         _imageCache.Add(_selectedImageResource, thumbnailImage);
     }
     this.pictureBoxPreview.Image = _imageCache[_selectedImageResource];
 }