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 { } }
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 { } }
/// <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)); }); }