Example #1
0
        public override void Initialize()
        {
            byte[] idArray = Spotify.StringToImageId(_id);

            if (idArray.Length != 20)
            {
                throw new Exception("Internal error in FromId");
            }

            try
            {
                _dataLoadLazy = new Lazy <byte[]>(GetImageData);
                _imageLoaded  = OnImageLoadedCallback;

                lock (Spotify.Mutex)
                {
                    Handle = Spotify.sp_image_create(Session.GetHandle(), idArray);
                    Spotify.sp_image_add_load_callback(Handle, _imageLoaded, IntPtr.Zero);
                }
            }
            catch
            {
            }
        }
Example #2
0
        public override void Initialize()
        {
            byte[] idArray = Spotify.StringToImageId(_id);

            if (idArray.Length != 20)
            {
                throw new Exception("Internal error in FromId");
            }

            try
            {
                _dataLoadLazy = new Lazy<byte[]>(GetImageData);
                _imageLoaded = OnImageLoadedCallback;

                lock (Spotify.Mutex)
                {
                    Handle = Spotify.sp_image_create(Session.GetHandle(), idArray);
                    Spotify.sp_image_add_load_callback(Handle, _imageLoaded, IntPtr.Zero);
                }
            }
            catch
            {
            }
        }
Example #3
0
File: Mask.cs Project: jfreax/BAIMP
        /// <summary>
        /// Gets the mask as image.
        /// </summary>
        /// <returns>The mask as image.</returns>
        public void GetMaskAsImageAsync(ImageLoadedCallback callback)
        {
            Task.Factory.StartNew( () => {
                XD.Image maskImage = GetMaskBuilder().ToVectorImage().WithBoxSize(scan.RequestedBitmapSize);

                Application.Invoke(() => callback(maskImage));
            });
        }