C# Class PixelShare.Core.SnapperWindow

Inheritance: Window
ファイルを表示 Open project: Wiladams/NewTOAPIA

Public Methods

Method Description
OnCloseRequested ( ) : bool

This is our opportunity to shut things down cleanly as the window has been requested to close. We shut down the thread that's taking the snapshots, and wait 100 milliseconds before returning 'true' which indicates that we are ok with the shutdown continuing.

OnKeyUp ( KeyboardActivityArgs ke ) : IntPtr
OnMaximized ( int width, int height ) : void
OnMinimized ( ) : void
OnResizedTo ( int width, int height ) : void

After resizing has occured, this method is called. At this point, you know the new width and height of the client area. We set the field 'fNeedsResize' to true so that the next time the snapper thread asks to take a snapshot, the PixelBuffer object will be resized. the newWidth, and newHeight capture the new sizes. This could be eliminated as the CaptureClientArea could simply take the current ClientRectangle size at the time of the call.

SnapperWindow ( ) : System
SnapperWindow ( int x, int y, int width, int height ) : System

Private Methods

Method Description
RunSnaps ( ) : void

This thread routine takes snapshots of the screen periodically. The frame rate is governed by the FrameRate property of the window. The frame rate is governed by taking time stamps after each frame is captured and sent to the network. If there is more than 10 ms before the next frame is to be captured, the thread will sleep for that amount of time before performing the next capture.

SendSnapshot ( ) : void
SnapClientArea ( ) : void

Method Details

OnCloseRequested() public method

This is our opportunity to shut things down cleanly as the window has been requested to close. We shut down the thread that's taking the snapshots, and wait 100 milliseconds before returning 'true' which indicates that we are ok with the shutdown continuing.
public OnCloseRequested ( ) : bool
return bool

OnKeyUp() public method

public OnKeyUp ( KeyboardActivityArgs ke ) : IntPtr
ke NewTOAPIA.UI.KeyboardActivityArgs
return System.IntPtr

OnMaximized() public method

public OnMaximized ( int width, int height ) : void
width int
height int
return void

OnMinimized() public method

public OnMinimized ( ) : void
return void

OnResizedTo() public method

After resizing has occured, this method is called. At this point, you know the new width and height of the client area. We set the field 'fNeedsResize' to true so that the next time the snapper thread asks to take a snapshot, the PixelBuffer object will be resized. the newWidth, and newHeight capture the new sizes. This could be eliminated as the CaptureClientArea could simply take the current ClientRectangle size at the time of the call.
public OnResizedTo ( int width, int height ) : void
width int
height int
return void

SnapperWindow() public method

public SnapperWindow ( ) : System
return System

SnapperWindow() public method

public SnapperWindow ( int x, int y, int width, int height ) : System
x int
y int
width int
height int
return System