本文整理汇总了C#中Bitmap.DrawText方法的典型用法代码示例。如果您正苦于以下问题:C# Bitmap.DrawText方法的具体用法?C# Bitmap.DrawText怎么用?C# Bitmap.DrawText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitmap
的用法示例。
在下文中一共展示了Bitmap.DrawText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DamageDrawSprite
/// <summary>
/// Damage Draw Sprite
/// </summary>
/// <param Name="damage_string">damage string</param>
/// <param Name="critical">critical flag</param>
/// <param Name="bitmap">damage bitmap</param>
void DamageDrawSprite(string damage_string, bool critical, Bitmap bitmap)
{
bitmap.DrawText(0, 12, 160, 36, damage_string, 1);
if (critical)
{
bitmap.Font.Size = GeexEdit.DefaultFontSize;
bitmap.Font.Color = new Color(0, 0, 0);
bitmap.DrawText(-1, -1, 160, 20, "CRITICAL", 1);
bitmap.DrawText(+1, -1, 160, 20, "CRITICAL", 1);
bitmap.DrawText(-1, +1, 160, 20, "CRITICAL", 1);
bitmap.DrawText(+1, +1, 160, 20, "CRITICAL", 1);
bitmap.Font.Color = new Color(255, 255, 255);
bitmap.DrawText(0, 0, 160, 20, "CRITICAL", 1);
}
damageSprite = new Geex.Run.Sprite(this.Viewport);
damageSprite.Bitmap = bitmap;
damageSprite.Ox = 80;
damageSprite.Oy = 20;
damageSprite.X = this.X;
damageSprite.Y = (int)(this.Y - this.Oy / 2);
damageSprite.Z = 3000;
damageDuration = 40;
}
示例2: DamageDrawBitmap
/// <summary>
/// Draw Damage Bitmap
/// </summary>
/// <param Name="damage_string">damage string</param>
/// <returns>damage bitmap</returns>
Bitmap DamageDrawBitmap(string damage_string)
{
Bitmap bitmap = new Bitmap(160, 48);
bitmap.Font.Name = GeexEdit.DefaultFont;
bitmap.Font.Size = GeexEdit.DefaultFontSize + 10;
bitmap.Font.Color = new Color(0, 0, 0);
bitmap.DrawText(-1, 12 - 1, 160, 36, damage_string, 1);
bitmap.DrawText(+1, 12 - 1, 160, 36, damage_string, 1);
bitmap.DrawText(-1, 12 + 1, 160, 36, damage_string, 1);
bitmap.DrawText(+1, 12 + 1, 160, 36, damage_string, 1);
return bitmap;
}