C# Class AffdexMe.MainWindow

MainWindow
Inheritance: System.Windows.Window, System.Windows.Markup.IComponentConnector
Datei anzeigen Open project: Affectiva/affdexme-win Class Usage Examples

Private Properties

Property Type Description
Appearance_Click void
CenterWindowOnScreen void
ConstructImage System.Windows.Media.Imaging.BitmapSource
DrawCapturedImage void
DrawData void
Emojis_Click void
Metrics_Click void
Points_Click void
ResetCameraProcessing void
ResetDisplayArea void
ShowExceptionAndShutDown void
StartCameraProcessing void
StopCameraProcessing void
TakeScreenShot void
TurnOnClassifiers void
Window_Closing void
Window_Loaded void
btnAppShot_Click void
btnChooseWin_Click void
btnExit_Click void
btnResetCamera_Click void
btnStartCamera_Click void
btnStopCamera_Click void
changeButtonStyle void

Public Methods

Method Description
MainWindow ( ) : System
MainWindow_ContentRendered ( object sender, EventArgs e ) : void

Once the window las been loaded and the content rendered, the camera can be initialized and started. This sequence allows for the underlying controls and watermark logo to be displayed.

SaveSettings ( ) : void

Saves the settings.

onImageCapture ( Affdex image ) : void

Handles the Image capture from source produced by Affdex.Detector

onImageResults ( Affdex.Face>.Dictionary faces, Affdex image ) : void

Handles the Image results event produced by Affdex.Detector

onProcessingException ( Affdex ex ) : void

Handles occurence of exception produced by Affdex.Detector

onProcessingFinished ( ) : void

Handles the end of processing event; not used

Private Methods

Method Description
Appearance_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the Appearance control.

CenterWindowOnScreen ( ) : void

Center the main window on the screen

ConstructImage ( byte imageData, int width, int height ) : System.Windows.Media.Imaging.BitmapSource

Constructs the bitmap image from byte array.

DrawCapturedImage ( Affdex image ) : void

Draws the image captured from the camera.

DrawData ( Affdex image, Affdex.Face>.Dictionary faces ) : void

Draws the facial analysis captured by Affdex.Detector.

Emojis_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the Emojis control.

Metrics_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the Metrics control.

Points_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the Points control.

ResetCameraProcessing ( ) : void

Resets the camera processing.

ResetDisplayArea ( ) : void

Resets the display area.

ShowExceptionAndShutDown ( String exceptionMessage ) : void

Displays a alert with exception details

StartCameraProcessing ( ) : void

Starts the camera processing.

StopCameraProcessing ( ) : void

Stops the camera processing.

TakeScreenShot ( String fileName ) : void

Take a shot of the current canvas and save it to a png file on disk

TurnOnClassifiers ( ) : void

Turns the on classifiers.

Window_Closing ( object sender, System e ) : void

Handles the Closing event of the Window control.

Window_Loaded ( object sender, RoutedEventArgs e ) : void

Handles the Loaded event of the Window control.

btnAppShot_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click eents of the Take Screenshot control

btnChooseWin_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the btnChooseWin control.

btnExit_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the btnExit control.

btnResetCamera_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the btnResetCamera control.

btnStartCamera_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the btnStartCamera control.

btnStopCamera_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the btnStopCamera control.

changeButtonStyle ( System.Windows.Controls.Button button, bool isOn ) : void

Changes the button style based on the specified flag.

Method Details

MainWindow() public method

public MainWindow ( ) : System
return System

MainWindow_ContentRendered() public method

Once the window las been loaded and the content rendered, the camera can be initialized and started. This sequence allows for the underlying controls and watermark logo to be displayed.
public MainWindow_ContentRendered ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

SaveSettings() public method

Saves the settings.
public SaveSettings ( ) : void
return void

onImageCapture() public method

Handles the Image capture from source produced by Affdex.Detector
public onImageCapture ( Affdex image ) : void
image Affdex The instance containing the image captured from camera.
return void

onImageResults() public method

Handles the Image results event produced by Affdex.Detector
public onImageResults ( Affdex.Face>.Dictionary faces, Affdex image ) : void
faces Affdex.Face>.Dictionary The detected faces.
image Affdex The instance containing the image analyzed.
return void

onProcessingException() public method

Handles occurence of exception produced by Affdex.Detector
public onProcessingException ( Affdex ex ) : void
ex Affdex The instance containing the exception details.
return void

onProcessingFinished() public method

Handles the end of processing event; not used
public onProcessingFinished ( ) : void
return void