public override void RenderElement(IRenderable renderable, Graphics graphics, Render render) { Solid solid = renderable as Solid; GraphicsPath path = solid.GetPath(); if (path == null) { return; } //Fill the solid RenderSolid(solid, graphics, render); //Set clipping for this shape Region current = null; //Add local clipping if (solid.Clip) { Region region = new Region(path); current = graphics.Clip; graphics.SetClip(region, CombineMode.Intersect); } if (!render.Summary) { //Render image if (solid.Image != null) { IFormsRenderer renderer = render.GetRenderer(solid.Image); renderer.RenderElement(solid.Image, graphics, render); } //Render label if (solid.Label != null) { LabelRender renderer = render.GetRenderer(solid.Label) as LabelRender; if (solid.Label.Wrap) { renderer.RenderElement(solid.Label, graphics, render, solid.InternalRectangle); } else { renderer.RenderElement(solid.Label, graphics, render); } } } //Restore clipping if (solid.Clip) { graphics.Clip = current; } //Call the base implementation of render to draw border if (solid.DrawBorder) { base.RenderElement(renderable, graphics, render); } }
public override void RenderAction(IRenderable renderable, Graphics graphics, ControlRender render) { Solid solid = renderable as Solid; GraphicsPath path = solid.GetPath(); if (solid.DrawBackground) { if (render.ActionStyle == ActionStyle.Default) { RenderSolid(solid, graphics, render); //Add local clipping Region current = null; if (solid.Clip) { Region region = new Region(path); current = graphics.Clip; graphics.SetClip(region, CombineMode.Intersect); } //Render annotation and image if (solid.Label != null) { LabelRender renderer = render.GetRenderer(solid.Label) as LabelRender; renderer.RenderAction(solid.Label, graphics, render, solid.InternalRectangle); } //Restore clipping if (solid.Clip) { graphics.Clip = current; } } else { if (path == null) { return; } graphics.FillPath(Singleton.Instance.ActionBrush, path); } } if (solid.DrawBorder) { base.RenderAction(renderable, graphics, render); } }