There is an example on this page: http://www.boltbait.com/pdn/codelab/hel ... ments.html
// Author: Ego Eram Reputo
#region UICode
FontFamily Amount1 = new FontFamily("Arial"); // Font
#endregion
void Render(Surface dst, Surface src, Rectangle rect)
{
Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
ColorBgra PC = (ColorBgra)EnvironmentParameters.PrimaryColor;
// Reset the destination canvas
for (int y = rect.Top; y {
for (int x = rect.Left; x {
dst[x,y] = src[x,y];
}
}
// Create a brush and graphics surface to write on
SolidBrush Brush1=new SolidBrush(
Color.FromArgb(PC.A,PC.R,PC.G,PC.);
Graphics g = new RenderArgs(dst).Graphics;
g.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.Clip = new Region(rect);
// Create a font from user selection
Font SelectedFont=new Font(Amount1.Name, 16);
// Write our text to the canvas
g.DrawString("Paint.NET Rocks!", SelectedFont,
Brush1, selection.Left, selection.Top);
}