public override void Render(RenderArgs args) { var url = args.Prototype.Parameter.ContainsKey("Url") ? args.Prototype.Parameter["Url"].Value as string : null; var bitmap = url == null ? null : Ressources.GetBitmap(url); if (bitmap != null) { args.Context.DrawBitmap(bitmap, args.Bounds, 1.0f, BitmapInterpolationMode.Linear); } }
public override void Render(RenderArgs args) { var url = args.Prototype.Parameter.ContainsKey("Url") ? args.Prototype.Parameter["Url"].Value as string : null; var frametime = args.Prototype.Parameter.ContainsKey("FrameTime") ? (double)args.Prototype.Parameter["FrameTime"].Value : 40; var files = Ressources.GetAnimBitmapFiles(url); if (files.Length == 0) { return; } var frame = (int)((Environment.TickCount / frametime) % files.Length); var bitmap = Ressources.GetBitmap(files[frame]); if (bitmap != null) { args.Context.DrawBitmap(bitmap, args.Bounds, 1.0f, BitmapInterpolationMode.Linear); } }