C# 클래스 PhotoSharingApp.Universal.Controls.CropControl

A crop control that allows the user to crop images to a 1:1 ratio before uploading.
상속: Windows.UI.Xaml.Controls.Control, ICropControl, INotifyPropertyChanged
파일 보기 프로젝트 열기: Microsoft/Appsample-Photosharing

Private Properties

프로퍼티 타입 설명
AddCornerEvents void
Corner_PointerMoved void
Corner_PointerPressed void
Corner_PointerReleased void
RemoveCornerEvents void
SelectRegion_ManipulationCompleted void
SelectRegion_ManipulationDelta void
UpdatePreviewImage void
selectedRegion_PropertyChanged void
sourceImage_SizeChanged void

공개 메소드들

메소드 설명
CropControl ( ) : System

Initializes a new instance of the CropControl class.

Dispose ( ) : void

Releases resources and unregisters from event handlers.

GetCroppedImage ( ) : Task

Creates the non-scaled cropped image.

LoadImage ( IRandomAccessStream fileStream ) : System.Threading.Tasks.Task

Loads the image.

보호된 메소드들

메소드 설명
OnApplyTemplate ( ) : void

Template to manage crop selection of image.

비공개 메소드들

메소드 설명
AddCornerEvents ( Control corner ) : void

Adds pointer events to the given control.

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.

RemoveCornerEvents ( Control corner ) : void

Remove pointer events for the corner.

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

UpdatePreviewImage ( ) : void

Updates the preview image.

selectedRegion_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Show the select region information.

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.

메소드 상세

CropControl() 공개 메소드

Initializes a new instance of the CropControl class.
public CropControl ( ) : System
리턴 System

Dispose() 공개 메소드

Releases resources and unregisters from event handlers.
public Dispose ( ) : void
리턴 void

GetCroppedImage() 공개 메소드

Creates the non-scaled cropped image.
public GetCroppedImage ( ) : Task
리턴 Task

LoadImage() 공개 메소드

Loads the image.
The file stream must not be null
public LoadImage ( IRandomAccessStream fileStream ) : System.Threading.Tasks.Task
fileStream IRandomAccessStream The file stream.
리턴 System.Threading.Tasks.Task

OnApplyTemplate() 보호된 메소드

Template to manage crop selection of image.
protected OnApplyTemplate ( ) : void
리턴 void