/// <summary>Renders the watermark.</summary> /// <param name="graphics">The specified graphics to draw on.</param> /// <param name="rectangle">The rectangle bounds.</param> /// <param name="stringFormat">The string format.</param> /// <param name="watermark">The watermark settings.</param> public static void RenderWatermark(Graphics graphics, Rectangle rectangle, StringFormat stringFormat, Watermark watermark) { if (watermark.Visible) { VisualTextRenderer.RenderText(graphics, rectangle, watermark.Text, watermark.Font, watermark.Brush.Color, stringFormat); } }
/// <summary>Render the tile.</summary> /// <param name="graphics">The specified graphics to draw on.</param> /// <param name="type">The type to draw.</param> /// <param name="clientRectangle">The client rectangle.</param> /// <param name="image">The image to draw.</param> /// <param name="text">The text to draw.</param> /// <param name="font">The font to draw.</param> /// <param name="enabled">The enabled.</param> /// <param name="mouseState">The mouse State.</param> /// <param name="textStyle">The text Style.</param> /// <param name="offset">The location offset.</param> public static void RenderTile(Graphics graphics, VisualTile.TileType type, Rectangle clientRectangle, Image image, string text, Font font, bool enabled, MouseStates mouseState, TextStyle textStyle, Point offset = new Point()) { switch (type) { case VisualTile.TileType.Image: { VisualImageRenderer.RenderImageCentered(graphics, clientRectangle, image, offset); break; } case VisualTile.TileType.Text: { VisualTextRenderer.RenderText(graphics, clientRectangle, text, font, enabled, mouseState, textStyle); break; } default: { throw new ArgumentOutOfRangeException(nameof(type), type, null); } } }