Пример #1
0
        internal SourceBitmap(Source from, string url, byte[] bitmapBytes)
        {
            try
            {
                bitmapData = bitmapBytes;
                ms = new MemoryStream(bitmapData);
                bitmap = new Bitmap(ms);
                s = Settings.Instance;
                parent = from;
                Url = url;
            }
            catch
            {
                Dispose(true);

                throw;
            }
        }
Пример #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (bitmap != null)
                {
                    var tb = bitmap;
                    bitmap = null;
                    tb.Dispose();
                }

                if (ms != null)
                {
                    var tms = ms;
                    ms = null;
                    tms.Dispose();
                }

                bitmapData = null;
                parent = null;
                s = null;
            }
        }