Usage

using GHI.Glide;
using Microsoft.SPOT;
using PJE.GlideEx.UI;
using Timer = Gadgeteer.Timer;
using Window = GHI.Glide.Display.Window;

namespace AnimatedImageTest
{
	public partial class Program
	{
		private Window _window;
		private AnimatedImage _aniimg1;
		private Timer _timer;

		private void ProgramStarted()
		{
			Debug.Print("Program Started");

			_timer = new Timer(25);
			_timer.Tick += _timer_Tick;
			_window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window));
			var bitmap = new Bitmap(Resources.GetBytes(Resources.BinaryResources.ImageSequence1), Bitmap.BitmapImageType.Jpeg);
			_aniimg1 = new AnimatedImage("aniimg1", 255, 30, 31, 64, 64);
			_aniimg1.Bitmap = bitmap;
			bitmap = new Bitmap(Resources.GetBytes(Resources.BinaryResources.ImageSequence2), Bitmap.BitmapImageType.Jpeg);
			_window.AddChild(_aniimg1);
			Glide.MainWindow = _window;
			_timer.Start();
		}

		void _timer_Tick(Timer timer)
		{
			_aniimg1.NextFrame();
			_aniimg1.Invalidate();
		}
	}
}
Example image to animate
ImageSequence1.jpg
In the above image one frame is 64x64px.

Properties

Property Description
Name
Alpha
X
Y
Width Width also defines frame width.
Height
Bitmap The image sequence to loop thru.


Events

Event Description
OnTouchDown
OnTouchUp


Methods

Method Description
NextFrame Proceeds to next image in the image sequence.
Reset Sets the counter to zero to render the first image in the sequence.

Last edited Jun 25, 2014 at 3:43 PM by BlackDogSpark, version 5