C# Class OpenBveApi.Textures.TextOverlay

Provides functions for dyamically overlaying text onto a texture
显示文件 Open project: leezer3/OpenBVE

Public Methods

Method Description
AddTextToBitmap ( Bitmap bitmap, string txt, string fontname, int fontsize, Color bgcolor, Color fcolor, Vector2 Padding ) : Bitmap

Adds a textual string to a bitmap image

FontAvailable ( string fontName ) : bool

Checks whether the specified font name is present on the system

Method Details

AddTextToBitmap() public static method

Adds a textual string to a bitmap image
public static AddTextToBitmap ( Bitmap bitmap, string txt, string fontname, int fontsize, Color bgcolor, Color fcolor, Vector2 Padding ) : Bitmap
bitmap System.Drawing.Bitmap The bitmap image to add the text to, or a null reference if a new image is to be created
txt string The text to overlay
fontname string The name of the font to use
fontsize int The size in points of the font
bgcolor Color The background color to use (Only relevant if creating a new image)
fcolor Color The font color to use
Padding Vector2 The padding to use, or alternatively the X,Y inset if overlaying text
return System.Drawing.Bitmap

FontAvailable() public static method

Checks whether the specified font name is present on the system
public static FontAvailable ( string fontName ) : bool
fontName string The font name to check
return bool