C# Class csImb.Screenshots

Mostra file Open project: TNOCS/csTouch Class Usage Examples

Public Properties

Property Type Description
Screenshot IMB3.TEventEntry

Public Methods

Method Description
GetImageFromControl ( FrameworkElement controlToConvert ) : System.Windows.Media.Imaging.PngBitmapEncoder

Convert any control to a PngBitmapEncoder

GetImageOfControl ( Control controlToConvert ) : ImageSource

Get an ImageSource of a control

GetJpgImage ( FrameworkElement source, double scale, int quality ) : byte[]
InitChannel ( ) : bool
LoadBitmap ( Bitmap source ) : System.Windows.Media.Imaging.BitmapSource
ProcessScreenshot ( Image screenshot ) : void

Send a screenshot over the bus. Identical to TakeScreenshot, except that this method does not capture the screenshot itself.

SaveImageOfControl ( Control controlToConvert, string fileName ) : ImageSource

Save an image of a control

Start ( int interval ) : void
Stop ( ) : void

Private Methods

Method Description
AddImageComment ( Stream jpegStreamIn, string propValue, int propId ) : Stream
CropImage ( Image img, Rectangle cropArea ) : Image
GetImageByteArray ( System.Windows.Media.Imaging.BitmapSource bi ) : byte[]
GetImageFromByteArray ( byte pixelInfo, int height, int width ) : System.Windows.Media.Imaging.BitmapSource
GetSubRectangle ( Image imgToDivide, int totalX, int totalY, int x, int y ) : Image
TakeScreenshot ( ) : void

Take a screenshot and send it over the bus.

TimerTick ( object sender, EventArgs e ) : void
WpfToRealPixels ( Window w, Point p ) : Point

Get screen from Window (uses WindowInteropHelper to get the handle from a Window).

resizeImage ( Image imgToResize, Size size ) : Image

Method Details

GetImageFromControl() public static method

Convert any control to a PngBitmapEncoder
public static GetImageFromControl ( FrameworkElement controlToConvert ) : System.Windows.Media.Imaging.PngBitmapEncoder
controlToConvert System.Windows.FrameworkElement The control to convert to an ImageSource
return System.Windows.Media.Imaging.PngBitmapEncoder

GetImageOfControl() public static method

Get an ImageSource of a control
public static GetImageOfControl ( Control controlToConvert ) : ImageSource
controlToConvert System.Windows.Controls.Control The control to convert to an ImageSource
return ImageSource

GetJpgImage() public method

public GetJpgImage ( FrameworkElement source, double scale, int quality ) : byte[]
source System.Windows.FrameworkElement
scale double
quality int
return byte[]

InitChannel() public method

public InitChannel ( ) : bool
return bool

LoadBitmap() public static method

public static LoadBitmap ( Bitmap source ) : System.Windows.Media.Imaging.BitmapSource
source System.Drawing.Bitmap
return System.Windows.Media.Imaging.BitmapSource

ProcessScreenshot() public method

Send a screenshot over the bus. Identical to TakeScreenshot, except that this method does not capture the screenshot itself.
public ProcessScreenshot ( Image screenshot ) : void
screenshot System.Drawing.Image Original image with 96x96 DPI
return void

SaveImageOfControl() public static method

Save an image of a control
public static SaveImageOfControl ( Control controlToConvert, string fileName ) : ImageSource
controlToConvert System.Windows.Controls.Control The control to convert to an ImageSource
fileName string The location to save the image to
return ImageSource

Start() public method

public Start ( int interval ) : void
interval int
return void

Stop() public method

public Stop ( ) : void
return void

Property Details

Screenshot public_oe property

public TEventEntry,IMB3 Screenshot
return IMB3.TEventEntry