// $Author: asskoala $
// $Date: 2005/12/11 21:07:21 $
// $Revision: 1.1 $

using System;
using System.Drawing;

using Icarus.Graphics.Animation;

namespace Icarus.LUCIE
{
	/// <summary>
	/// This is a simple component that just displays a static image.
	/// </summary>
	public class ImageComponent : AbstractComponent
	{
		private Frameset mFrameset;

		/// <summary>
		/// Creates a new image component. Note that the image will be automagically sized to the proper dimensions.
		/// </summary>
		/// <param name="image">The image to display. Note that it doesn't have to have the fancy frameset markup. Any old image will do.</param>
		public ImageComponent(Bitmap image) 
		{
			this.mFrameset = new Frameset();
			mFrameset.addFrame(image, new Point(0, 0));
			this.Size = image.Size;
		}

		protected override void RenderSelf(Rectangle coordinates, Icarus.Graphics.Animation.IRenderParameters parameters)
		{
			mFrameset.getFrameAt(0).Render(coordinates, parameters);
		}
	}
}
