C# Class OSAE.OSAEImageManager

显示文件 Open project: opensourceautomation/Open-Source-Automation Class Usage Examples

Public Methods

Method Description
AddImage ( OSAEImage osaeImage ) : int

There should be No logging in the API

Adds an image to the DB

AddImage ( string name, string type, byte imageData ) : int

Adds an image to the OSAE DB

DeleteImage ( int imageId ) : void

Deletes an image from the DB

GetGIFFromFileStream ( String path ) : byte[]
GetGIFFromImageControl ( BitmapImage imageC ) : byte[]
GetImage ( int imageId ) : OSAEImage

Gets an image from the DB

GetImage ( int imageId, bool returnNullIfNotExist ) : OSAEImage

Gets an image from the DB

GetImage ( string imageName ) : OSAEImage

Gets an image from the DB

GetImageList ( ) : List

Returns a list of available images without the type or data for performence reasons.

GetImages ( ) : List

Gets all the images available in the DB

Only call this method if you have to as retrieving all images can take a short while

GetJPGFromImageControl ( BitmapImage imageC ) : byte[]
GetPNGFromImageControl ( BitmapImage imageC ) : byte[]
GifToByteArray ( Image imageIn ) : byte[]
JpgToByteArray ( Image imageIn ) : byte[]
PngToByteArray ( Image imageIn ) : byte[]

Method Details

AddImage() public method

There should be No logging in the API Adds an image to the DB
public AddImage ( OSAEImage osaeImage ) : int
osaeImage OSAEImage The image information to add
return int

AddImage() public method

Adds an image to the OSAE DB
public AddImage ( string name, string type, byte imageData ) : int
name string The name of the image this should not include the path or extension
type string the type of the image e.g. jpg, png do not include the .
imageData byte the binary data of the image
return int

DeleteImage() public method

Deletes an image from the DB
public DeleteImage ( int imageId ) : void
imageId int The Id of the image to delete
return void

GetGIFFromFileStream() public method

public GetGIFFromFileStream ( String path ) : byte[]
path String
return byte[]

GetGIFFromImageControl() public method

public GetGIFFromImageControl ( BitmapImage imageC ) : byte[]
imageC System.Windows.Media.Imaging.BitmapImage
return byte[]

GetImage() public method

Gets an image from the DB
public GetImage ( int imageId ) : OSAEImage
imageId int The id of the image to get
return OSAEImage

GetImage() public method

Gets an image from the DB
public GetImage ( int imageId, bool returnNullIfNotExist ) : OSAEImage
imageId int The id of the image to get
returnNullIfNotExist bool If the image is not found, should null be returned? Otherwise return empty image object.
return OSAEImage

GetImage() public method

Gets an image from the DB
public GetImage ( string imageName ) : OSAEImage
imageName string
return OSAEImage

GetImageList() public method

Returns a list of available images without the type or data for performence reasons.
public GetImageList ( ) : List
return List

GetImages() public method

Gets all the images available in the DB
Only call this method if you have to as retrieving all images can take a short while
public GetImages ( ) : List
return List

GetJPGFromImageControl() public method

public GetJPGFromImageControl ( BitmapImage imageC ) : byte[]
imageC System.Windows.Media.Imaging.BitmapImage
return byte[]

GetPNGFromImageControl() public method

public GetPNGFromImageControl ( BitmapImage imageC ) : byte[]
imageC System.Windows.Media.Imaging.BitmapImage
return byte[]

GifToByteArray() public method

public GifToByteArray ( Image imageIn ) : byte[]
imageIn Image
return byte[]

JpgToByteArray() public method

public JpgToByteArray ( Image imageIn ) : byte[]
imageIn Image
return byte[]

PngToByteArray() public method

public PngToByteArray ( Image imageIn ) : byte[]
imageIn Image
return byte[]