本文整理汇总了C#中SharpDX.DrawText方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.DrawText方法的具体用法?C# SharpDX.DrawText怎么用?C# SharpDX.DrawText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX
的用法示例。
在下文中一共展示了SharpDX.DrawText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _drawDesktopOutline
private void _drawDesktopOutline( SharpDX.Direct2D1.DeviceContext d2dContext)
{
//BORDER
d2dContext.Transform = Matrix.Translation(_globalTranslation) * Matrix.Scaling(_globalScale);
d2dContext.DrawRectangle(
_layoutDeviceScreenSize,
_generalLightGrayColor,
3
);
//WIDTH
d2dContext.Transform = Matrix.Translation(_globalTranslation) * Matrix.Scaling(_globalScale);
d2dContext.FillRectangle(
new RectangleF(0, -30, 100, 30),
_generalLightGrayColor
);
d2dContext.Transform = Matrix.Translation(10, 0, 0) * Matrix.Translation(_globalTranslation) * Matrix.Scaling(_globalScale);
d2dContext.DrawText(_layoutDetail.Width.ToString(), _generalTextFormat, new RectangleF(0, -30, 100, 30), _generalLightWhiteColor);
////HEIGHT
double angleRadians = 90 * Math.PI / 180; //90 degrees
d2dContext.Transform = Matrix.RotationZ((float)angleRadians) * Matrix.Identity * Matrix.Translation(_globalTranslation) * Matrix.Scaling(_globalScale);
d2dContext.FillRectangle(
new RectangleF(0, 0, 100, 30),
_generalLightGrayColor
);
d2dContext.Transform = Matrix.RotationZ((float)angleRadians) * Matrix.Translation(0, 10, 0) * Matrix.Translation(_globalTranslation) * Matrix.Scaling(_globalScale);
d2dContext.DrawText(_layoutDetail.Height.ToString(), _generalTextFormat, new RectangleF(0, 0, 100, 30), _generalLightWhiteColor);
}
示例2: DrawText
private void DrawText(SharpDX.Direct3D10.Font font, Vector2 pos, string text, Color4 color)
{
font.DrawText(null, text, new Rectangle((int)pos.X, (int)pos.Y, 0, 0), SharpDX.Direct3D10.FontDrawFlags.NoClip, color);
}
示例3: _drawDebuggingInfo
private void _drawDebuggingInfo(SharpDX.Direct2D1.DeviceContext d2dContext)
{
if (_gt != null)
{
d2dContext.Transform = Matrix.Identity;
d2dContext.DrawText("TotalGameTime (s) : " + _gt.TotalGameTime.TotalSeconds.ToString(), _debugTextFormat, _debugLine1, _generalRedColor);
d2dContext.DrawText("FrameCount : " + _gt.FrameCount.ToString(), _debugTextFormat, _debugLine2, _generalRedColor);
d2dContext.DrawText("ElapsedGameTime (s) : " + _gt.ElapsedGameTime.TotalSeconds.ToString(), _debugTextFormat, _debugLine3, _generalRedColor);
d2dContext.DrawText("IsRunningSlowly : " + _gt.IsRunningSlowly.ToString(), _debugTextFormat, _debugLine4, _generalRedColor);
d2dContext.DrawText("FPS : " + (_gt.FrameCount / _gt.TotalGameTime.TotalSeconds).ToString(), _debugTextFormat, _debugLine5, _generalRedColor);
}
}