Exemple #1
0
        private void InitFromStreamWithSize(Stream stream, int width, int height)
        {
            var data = NSData.FromStream(stream);

            this.imageData = new ReferencedImageData(data, CGImageSource.FromData(data));
            if (!LoadImageWithSize(new Size(width, height)))
            {
                throw new ArgumentOutOfRangeException("stream");
            }
        }
Exemple #2
0
 private void Dispose(bool disposing)
 {
     if (this.image != null)
     {
         this.image.Dispose();
         this.image = null;
     }
     if (this.imageData != null)
     {
         this.imageData.Release();
         this.imageData = null;
     }
 }
 void Dispose(bool disposing)
 {
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
     if (imageData != null)
     {
         imageData.Release();
         imageData = null;
     }
 }
Exemple #4
0
        public Icon(Icon original, Size size)
        {
            if (original == null)
            {
                throw new ArgumentException("original");
            }

            // The original icon was loaded from multi-image file.
            this.imageData = original.imageData.Acquire();
            if (!LoadImageWithSize(size))
            {
                this.image = original.image.Clone();
            }
        }