TileIconifier.Core.Shortcut.ShortcutItemImage.CachedImage C# (CSharp) Méthode

CachedImage() public méthode

public CachedImage ( ) : Image
Résultat Image
        public Image CachedImage()
        {
            if (_imageCacheBytes == Bytes) return _imageCache;

            if (_imageCacheBytes == Bytes &&
                _imageCacheBytes.SequenceEqual(Bytes))
                return _imageCache;

            _imageCache = ImageUtils.ByteArrayToImage(Bytes);
            _imageCacheBytes = Bytes?.ToArray();

            return _imageCache;
        }

Usage Example

 private void UpdatePictureBoxImage(PannablePictureBox pannablePictureBox, ShortcutItemImage shortcutItemImage)
 {
     pannablePictureBox.SetImage(shortcutItemImage.CachedImage(),
         shortcutItemImage.Width,
         shortcutItemImage.Height,
         shortcutItemImage.X,
         shortcutItemImage.Y);
 }