forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicsExtensions.cs
More file actions
23 lines (22 loc) · 888 Bytes
/
GraphicsExtensions.cs
File metadata and controls
23 lines (22 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Drawing;
using System.Windows.Forms;
namespace ReClassNET.Extensions
{
public static class GraphicsExtension
{
/// <summary>
/// Use GDI to render normal text because GDI+ doesn't work nicely with long texts and the custom width calculation.
/// But GDI is simple, there is no custom rendering (rotation, scale, ...). So the BitFieldNode uses GDI+ for rendering.
/// </summary>
/// <param name="g">The graphics context.</param>
/// <param name="text">The text to render.</param>
/// <param name="font">The font to use.</param>
/// <param name="color">The color to use.</param>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
public static void DrawStringEx(this Graphics g, string text, Font font, Color color, int x, int y)
{
TextRenderer.DrawText(g, text, font, new Point(x, y), color);
}
}
}