using System;
using System.Drawing;
namespace Microsoft.Windows.Forms.Animate
{
///
/// 动画帧
///
internal sealed class AnimationFrame : DisposableMini
{
private AnimationFrameType m_FrameType;
///
/// 获取帧类型
///
public AnimationFrameType FrameType
{
get
{
return this.m_FrameType;
}
}
private object m_Value;
///
/// 帧值,通常为图片或颜色
///
public object Value
{
get
{
return this.m_Value;
}
}
///
/// 创建一个颜色帧
///
/// 颜色
public AnimationFrame(Color color)
{
this.m_Value = color;
this.m_FrameType = AnimationFrameType.Color;
}
///
/// 创建一个图像帧
///
/// 图像
public AnimationFrame(Image image)
{
this.m_Value = image;
this.m_FrameType = AnimationFrameType.Image;
}
///
/// 释放资源
///
/// 释放托管资源为true,否则为false
protected override void Dispose(bool disposing)
{
if (this.m_Value != null)
{
IDisposable disposable = this.m_Value as IDisposable;
if (disposable != null)
disposable.Dispose();
this.m_Value = null;
}
}
}
}