C# Class XamlBrewer.Uwp.Controls.ImageCropper

Inheritance: Windows.UI.Xaml.Controls.Control, INotifyPropertyChanged
显示文件 Open project: XamlBrewer/UWP-ImageCropper-

Public Properties

Property Type Description
SourceImageProperty Windows.UI.Xaml.DependencyProperty

Public Methods

Method Description
ImageCropper ( ) : System

Protected Methods

Method Description
OnApplyTemplate ( ) : void

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.

Private Methods

Method Description
AddCornerEvents ( Control corner ) : void
Corner_PointerMoved ( object sender, PointerRoutedEventArgs e ) : void

If a pointer which is captured by the corner moves, the select region will be updated.

Corner_PointerPressed ( object sender, PointerRoutedEventArgs e ) : void

If a pointer presses in the corner, it means that the user starts to move the corner. 1. Capture the pointer, so that the UIElement can get the Pointer events (PointerMoved, PointerReleased...) even the pointer is outside of the UIElement. 2. Record the start position of the move.

Corner_PointerReleased ( object sender, PointerRoutedEventArgs e ) : void

The pressed pointer is released, which means that the move is ended. 1. Release the Pointer. 2. Clear the position history of the Pointer.

LoadImage ( StorageFile imageFile ) : System.Threading.Tasks.Task

Loads the image.

OnSourceImageChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
SelectRegion_ManipulationCompleted ( object sender, ManipulationCompletedRoutedEventArgs e ) : void

The manipulation is completed, and then update the preview image

SelectRegion_ManipulationDelta ( object sender, ManipulationDeltaRoutedEventArgs e ) : void

The user manipulates the selectRegion. The manipulation includes 1. Translate 2. Scale

SourceImage_SizeChanged ( object sender, SizeChangedEventArgs e ) : void

This event will be fired when 1. An new image is opened. 2. The source of the sourceImage is set to null. 3. The view state of this application is changed.

UpdatePreviewImage ( ) : void

Update preview image.

Method Details

ImageCropper() public method

public ImageCropper ( ) : System
return System

OnApplyTemplate() protected method

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.
protected OnApplyTemplate ( ) : void
return void

Property Details

SourceImageProperty public_oe static_oe property

public static DependencyProperty,Windows.UI.Xaml SourceImageProperty
return Windows.UI.Xaml.DependencyProperty