Ejemplo n.º 1
0
        /// <inheritdoc cref="TrackBarEventArgs"/>
        public async Task OnEventHandler(object publisher, TrackBarEventArgs e)
        {
            var container = ImageContainer.Unknown;

            try
            {
                container = e.Container;

                if (!View.ImageIsDefault(container))
                {
                    var scale = View.GetZoomFactor(container);
                    var rad   = View.GetRotationFactor(container);

                    var copy = await GetImageCopy(container)
                               .ConfigureAwait(true);

                    await Paint(
                        new PipelineBlock(copy)
                        .Add <Bitmap, Bitmap>(
                            (bmp) => _scale.Scale(bmp, scale, scale))
                        .Add <Bitmap, Bitmap>(
                            (bmp) => _rotation.Rotate(bmp, rad)),
                        container
                        ).ConfigureAwait(true);
                }
            }
            catch (ArgumentException ex)
            {
                View.SetDefaultImage(container);
            }
            catch (Exception ex)
            {
                OnError(publisher, Errors.Zoom);
            }
        }
Ejemplo n.º 2
0
 private void trackOpacity_ValueChanged(object sender, TrackBarEventArgs e)
 {
     this.Opacity = e.NewValue / 100.0;
 }
Ejemplo n.º 3
0
 public virtual async Task OnEventHandler(object publisher, TrackBarEventArgs e)
 {
 }