示例#1
0
        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);
            }
        }
示例#2
0
        public override void Render(RenderArgs args)
        {
            var prot    = args.Prototype;
            var context = args.Context;
            var bounds  = args.Bounds;
            var x2      = prot.Parameter.ContainsKey("X2") ? (ScreenPos)prot.Parameter["X2"].Value : new ScreenPos();
            var y2      = prot.Parameter.ContainsKey("Y2") ? (ScreenPos)prot.Parameter["Y2"].Value : new ScreenPos();
            var fg      = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value);

            if (fg != null)
            {
                context.DrawLine(bounds.TopLeft, new Vector2(args.Transform(x2, false), args.Transform(y2, true)), fg);
            }
        }
示例#3
0
        public override void Render(RenderArgs args)
        {
            var prot    = args.Prototype;
            var context = args.Context;
            var bounds  = args.Bounds;
            var text    = prot.Parameter["Text"].Value as String;
            var align   = prot.Parameter.ContainsKey("Align") ? (Align)prot.Parameter["Align"].Value : Align.Left;
            var valign  = prot.Parameter.ContainsKey("Valign") ? (Valign)prot.Parameter["Valign"].Value : Valign.Top;
            var size    = prot.Parameter.ContainsKey("FontSize") ? (ScreenPos)prot.Parameter["FontSize"].Value : new ScreenPos();
            var fg      = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value);
            //var bg = Ressources.GetBrush((string)prot.Parameter["BackColor"].Value);
            var format = Ressources.GetFormat(args.Transform(size, true), align, valign);

            if (fg != null && text != null)
            {
                context.DrawText(text, format, bounds, fg);
            }
        }
示例#4
0
        public override void Render(RenderArgs args)
        {
            var prot    = args.Prototype;
            var context = args.Context;
            var bounds  = args.Bounds;
            var fg      = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value);
            var bg      = Ressources.GetBrush((Color)prot.Parameter["BackColor"].Value);
            var bw      = (double)prot.Parameter["LineWidth"].Value;

            if (bg != null)
            {
                context.FillRectangle(bounds, bg);
            }
            if (fg != null)
            {
                context.DrawRectangle(bounds, fg, (float)bw);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
 public abstract void Render(RenderArgs args);