C# 클래스 ROS_ImageWPF.GenericImageIMPL

파일 보기 프로젝트 열기: uml-robotics/ROS.NET 1 사용 예제들

공개 메소드들

메소드 설명
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

보호된 메소드들

메소드 설명
SizeConverter ( System s ) : Size

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

비공개 메소드들

메소드 설명
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

메소드 상세

BytesToImage() 공개 정적인 메소드

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
리턴 bool

GenericImageIMPL() 공개 메소드

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
리턴 System

SizeConverter() 보호된 정적인 메소드

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

UpdateImage() 공개 메소드

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 ///
리턴 void

UpdateImage() 공개 메소드

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
리턴 void

UpdateImage() 공개 메소드

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 ///
리턴 void

UpdateImage() 공개 메소드

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
리턴 void