public override void SetContext(SignRender c) { int height = c.Configuration.Height - 3; SizeF sz = c.MeasureText(height, Text); Width = (int)sz.Width; }
public void Render(SignRender r) { r.PrepareBitmapBackground(ref Bmp); g = Graphics.FromImage(Bmp); Render(); r.DrawBackground(Bmp); }
void SetIdentify(bool enable) { ResponseObject.UseConfigureDisplay = enable; if (enable) { // Generate configuration image; SignRender r = new SignRender(); r.SetConfiguration(ResponseObject.Target.CurrentConfiguration()); r.Clear(); lock (Elements) { int index = 1; foreach (EditElement e in Elements) { string text = index.ToString(); SizeF sz = r.MeasureText(12, text); r.DrawTextAbsolute(12, text, Color.White, e.Location.X + (e.Location.Width - sz.Width) / 2, e.Location.Y + (e.Location.Height - sz.Height) / 2); index++; } } UpdateFrameInternal(r.SignOutput); ResponseObject.Target.SendImage(r.SignOutput); } }
public void SetConfiguration(SignConfiguration c) { lock (this) { if (Render == null) { Render = new SignRender(); } Render.SetConfiguration(c); } }
public SignAnimate() { Render = null; FrameTimer = new Timer(FrameTick); SetAnimationRate(30); }
public override void Render(SignRender r) { int height = r.Configuration.Height - 3; r.DrawText(height, Text, TextColor); }
public virtual void Render(SignRender r) { }
public virtual void SetContext(SignRender r) { }