C# Class ROS_ImageWPF.GenericImageIMPL

Afficher le fichier Open project: uml-robotics/ROS.NET Class Usage Examples

Méthodes publiques

Méthode Description
BytesToImage ( byte data, BitmapImage &img ) : bool

Attempts to convert the byte array, data, into a valid Image, img

GenericImageIMPL ( System.Windows.Media.ImageBrush ib ) : System

Create a GenericImageIMPL to render images on specified ImageBrush UIElement

UpdateImage ( Bitmap bmp ) : void

Looks up the bitmaps dress, then starts passing the image around as a Byte[] and a System.Media.Size to the overloaded UpdateImages that make this work

UpdateImage ( ImageSource imgsrc ) : void

Directly sets this GenericImage's image based on an already created WPF ImageSource

UpdateImage ( byte data ) : void

Uses a memory stream to turn a byte array into a BitmapImage via helper method, BytesToImage, then passes the image to UpdateImage(BitmapImage)

UpdateImage ( byte data, Size size, bool hasHeader, string encoding = null ) : void

if hasHeader is true, then UpdateImage(byte[]) is called otherwise, the size is compared to lastSize, if they differ or header is null, a header is created, and concatinated with data, then UpdateImage(byte[]) is called

Méthodes protégées

Méthode Description
SizeConverter ( System s ) : Size

turns a System.Drawing.Size into the WPF double,double version

Private Methods

Méthode Description
MakeHeader ( byte rawdata, Size size ) : void

makes a file header with appropriate width, height, length, and such for the bytearray + drawing.size sent as members of the lazycopypastefixerupper

concat ( byte a, byte b ) : byte[]

takes 1 byte array, and 1 byte array, and then returns 1 byte array

Method Details

BytesToImage() public static méthode

Attempts to convert the byte array, data, into a valid Image, img
public static BytesToImage ( byte data, BitmapImage &img ) : bool
data byte image data (ideally)
img System.Windows.Media.Imaging.BitmapImage target image
Résultat bool

GenericImageIMPL() public méthode

Create a GenericImageIMPL to render images on specified ImageBrush UIElement
public GenericImageIMPL ( System.Windows.Media.ImageBrush ib ) : System
ib System.Windows.Media.ImageBrush Target ImageBrush
Résultat System

SizeConverter() protected static méthode

turns a System.Drawing.Size into the WPF double,double version
protected static SizeConverter ( System s ) : Size
s System ///
Résultat System.Windows.Size

UpdateImage() public méthode

Looks up the bitmaps dress, then starts passing the image around as a Byte[] and a System.Media.Size to the overloaded UpdateImages that make this work
public UpdateImage ( Bitmap bmp ) : void
bmp System.Drawing.Bitmap ///
Résultat void

UpdateImage() public méthode

Directly sets this GenericImage's image based on an already created WPF ImageSource
public UpdateImage ( ImageSource imgsrc ) : void
imgsrc ImageSource The image to show on this GenericImage
Résultat void

UpdateImage() public méthode

Uses a memory stream to turn a byte array into a BitmapImage via helper method, BytesToImage, then passes the image to UpdateImage(BitmapImage)
public UpdateImage ( byte data ) : void
data byte ///
Résultat void

UpdateImage() public méthode

if hasHeader is true, then UpdateImage(byte[]) is called otherwise, the size is compared to lastSize, if they differ or header is null, a header is created, and concatinated with data, then UpdateImage(byte[]) is called
public UpdateImage ( byte data, Size size, bool hasHeader, string encoding = null ) : void
data byte /// image data ///
size System.Windows.Size /// image size ///
hasHeader bool /// whether or not a header needs to be concatinated ///
encoding string
Résultat void