C# Class MediaPortal.GUI.Library.GUIImage

A GUIControl for displaying Images.
Inheritance: GUIControl
Mostrar archivo Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Private Properties

Property Type Description
Cleanup void
DrawBorder void
FinalizeBorder void
FreeResourcesAndRegEvent void
GUIPropertyManager_OnPropertyChanged void
OnListTexturesDisposedEvent void
OnPackedTexturesDisposedEvent void
ParseParameters int[]
ReleaseTexture void
UnsubscribeAndReleaseListTextures void
UnsubscribeListTextures void
UnsubscribeOnPropertyChanged void

Public Methods

Method Description
AllocResources ( ) : void

Allocate the DirectX resources needed for rendering this GUIImage.

Animate ( float timePassed, Animator animator ) : void
BeginAnimation ( ) : void
CanFocus ( ) : bool

Returns if the control can have the focus.

Dispose ( ) : void

Free the DirectX resources needed for rendering this GUIImage.

FinalizeConstruction ( ) : void

This function is called after all of the XmlSkinnable fields have been filled with appropriate data. Use this to do any construction work other than simple data member assignments, for example, initializing new reference types, extra calculations, etc..

GUIImage ( int dwParentID ) : System
GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, Color color ) : System
GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, Color color, int border, int strBorderPosition, bool borderTextureRotate, bool borderTextureRepeat, Color borderColor ) : System
GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, long dwColorKey ) : System

The constructor of the GUIImage class.

GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, long dwColorKey, int border, int strBorderPosition, bool borderTextureRepeat, bool borderTextureRotate, long dwBorderColorKey ) : System
GetCenter ( float &centerX, float &centerY ) : void
LockMemoryImageTexture ( Bitmap &bitmap ) : bool
Refresh ( ) : void
RemoveMemoryImageTexture ( ) : void
Render ( float timePassed ) : void

Renders the Image

RenderRect ( float timePassed, Rectangle rectSrc, Rectangle rectDst ) : void
ScaleToScreenResolution ( ) : void

Does any scaling on the inital size\position values to fit them to screen resolution.

Select ( int frameNumber ) : void

If the texture holds more then 1 frame (like an animated gif) then you can select the current frame with this method

SetBorder ( string border, BorderPosition position, bool textureRepeat, bool textureRotate, string textureFilename, long colorKey, bool hasCorners, bool cornerTextureRotate ) : void
SetFileName ( string fileName ) : void

Set the filename of the texture and re-allocates the DirectX resources for this GUIImage.

SetItems ( int iItems ) : void

If the texture has more then 1 frame like an animated gif then you can specify the max# of frames to play with this method

SetMemoryImageSize ( int width, int height ) : void
SetPosition ( int dwPosX, int dwPosY ) : void
UnLockMemoryImageTexture ( ) : void
UpdateVisibility ( ) : void

Protected Methods

Method Description
Animate ( ) : void

This function will do the animation (when texture is an animated gif) by switching from frame 1->frame2->frame 3->...

Calculate ( ) : void

Sets the state to render the image

Update ( ) : void

Private Methods

Method Description
Cleanup ( ) : void
DrawBorder ( bool flip ) : void
FinalizeBorder ( ) : void
FreeResourcesAndRegEvent ( ) : void
GUIPropertyManager_OnPropertyChanged ( string tag, string tagValue ) : void
OnListTexturesDisposedEvent ( object sender, EventArgs e ) : void
OnPackedTexturesDisposedEvent ( object sender, EventArgs e ) : void
ParseParameters ( string valueText ) : int[]
ReleaseTexture ( string file ) : void
UnsubscribeAndReleaseListTextures ( ) : void
UnsubscribeListTextures ( ) : void
UnsubscribeOnPropertyChanged ( ) : void

Method Details

AllocResources() public method

Allocate the DirectX resources needed for rendering this GUIImage.
public AllocResources ( ) : void
return void

Animate() protected method

This function will do the animation (when texture is an animated gif) by switching from frame 1->frame2->frame 3->...
protected Animate ( ) : void
return void

Animate() public method

public Animate ( float timePassed, Animator animator ) : void
timePassed float
animator Animator
return void

BeginAnimation() public method

public BeginAnimation ( ) : void
return void

Calculate() protected method

Sets the state to render the image
protected Calculate ( ) : void
return void

CanFocus() public method

Returns if the control can have the focus.
public CanFocus ( ) : bool
return bool

Dispose() public method

Free the DirectX resources needed for rendering this GUIImage.
public Dispose ( ) : void
return void

FinalizeConstruction() public method

This function is called after all of the XmlSkinnable fields have been filled with appropriate data. Use this to do any construction work other than simple data member assignments, for example, initializing new reference types, extra calculations, etc..
public FinalizeConstruction ( ) : void
return void

GUIImage() public method

public GUIImage ( int dwParentID ) : System
dwParentID int
return System

GUIImage() public method

public GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, Color color ) : System
dwParentID int
dwControlId int
dwPosX int
dwPosY int
dwWidth int
dwHeight int
strTexture string
color Color
return System

GUIImage() public method

public GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, Color color, int border, int strBorderPosition, bool borderTextureRotate, bool borderTextureRepeat, Color borderColor ) : System
dwParentID int
dwControlId int
dwPosX int
dwPosY int
dwWidth int
dwHeight int
strTexture string
color Color
border int
strBorderPosition int
borderTextureRotate bool
borderTextureRepeat bool
borderColor Color
return System

GUIImage() public method

The constructor of the GUIImage class.
public GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, long dwColorKey ) : System
dwParentID int The parent of this GUIImage control.
dwControlId int The ID of this GUIImage control.
dwPosX int The X position of this GUIImage control.
dwPosY int The Y position of this GUIImage control.
dwWidth int The width of this GUIImage control.
dwHeight int The height of this GUIImage control.
strTexture string The filename of the texture of this GUIImage control.
dwColorKey long The color that indicates transparancy.
return System

GUIImage() public method

public GUIImage ( int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight, string strTexture, long dwColorKey, int border, int strBorderPosition, bool borderTextureRepeat, bool borderTextureRotate, long dwBorderColorKey ) : System
dwParentID int
dwControlId int
dwPosX int
dwPosY int
dwWidth int
dwHeight int
strTexture string
dwColorKey long
border int
strBorderPosition int
borderTextureRepeat bool
borderTextureRotate bool
dwBorderColorKey long
return System

GetCenter() public method

public GetCenter ( float &centerX, float &centerY ) : void
centerX float
centerY float
return void

LockMemoryImageTexture() public method

public LockMemoryImageTexture ( Bitmap &bitmap ) : bool
bitmap Bitmap
return bool

Refresh() public method

public Refresh ( ) : void
return void

RemoveMemoryImageTexture() public method

public RemoveMemoryImageTexture ( ) : void
return void

Render() public method

Renders the Image
public Render ( float timePassed ) : void
timePassed float
return void

RenderRect() public method

public RenderRect ( float timePassed, Rectangle rectSrc, Rectangle rectDst ) : void
timePassed float
rectSrc Rectangle
rectDst Rectangle
return void

ScaleToScreenResolution() public method

Does any scaling on the inital size\position values to fit them to screen resolution.
public ScaleToScreenResolution ( ) : void
return void

Select() public method

If the texture holds more then 1 frame (like an animated gif) then you can select the current frame with this method
public Select ( int frameNumber ) : void
frameNumber int
return void

SetBorder() public method

public SetBorder ( string border, BorderPosition position, bool textureRepeat, bool textureRotate, string textureFilename, long colorKey, bool hasCorners, bool cornerTextureRotate ) : void
border string
position BorderPosition
textureRepeat bool
textureRotate bool
textureFilename string
colorKey long
hasCorners bool
cornerTextureRotate bool
return void

SetFileName() public method

Set the filename of the texture and re-allocates the DirectX resources for this GUIImage.
public SetFileName ( string fileName ) : void
fileName string
return void

SetItems() public method

If the texture has more then 1 frame like an animated gif then you can specify the max# of frames to play with this method
public SetItems ( int iItems ) : void
iItems int
return void

SetMemoryImageSize() public method

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

SetPosition() public method

public SetPosition ( int dwPosX, int dwPosY ) : void
dwPosX int
dwPosY int
return void

UnLockMemoryImageTexture() public method

public UnLockMemoryImageTexture ( ) : void
return void

Update() protected method

protected Update ( ) : void
return void

UpdateVisibility() public method

public UpdateVisibility ( ) : void
return void