本文整理汇总了C#中NGraphics.Rect.ToRectangleF方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.ToRectangleF方法的具体用法?C# Rect.ToRectangleF怎么用?C# Rect.ToRectangleF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGraphics.Rect
的用法示例。
在下文中一共展示了Rect.ToRectangleF方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawImage
public void DrawImage(IImage image, Rect frame, double alpha = 1.0)
{
var i = GetImage (image);
renderTarget.DrawBitmap (i, frame.ToRectangleF (), (float)alpha, D2D1.BitmapInterpolationMode.Linear);
}
示例2: DrawRectangle
public void DrawRectangle(Rect frame, Pen pen = null, Brush brush = null)
{
var p = GetBrush (pen);
var b = GetBrush (frame, brush);
if (b != null) {
renderTarget.FillRectangle (frame.ToRectangleF (), b);
}
if (p != null) {
renderTarget.DrawRectangle (frame.ToRectangleF (), p, (float)pen.Width, GetStrokeStyle (pen));
}
}
示例3: DrawRectangle
public void DrawRectangle (Rect frame, Size corner, Pen pen = null, Brush brush = null)
{
var p = GetBrush (pen);
var b = GetBrush (frame, brush);
if (b != null) {
if (corner.Width > 0 || corner.Height > 0) {
var rr = new D2D1.RoundedRectangle ();
rr.Rect = frame.ToRectangleF ();
rr.RadiusX = (float)corner.Width;
rr.RadiusY = (float)corner.Height;
renderTarget.FillRoundedRectangle (ref rr, b);
}
else {
renderTarget.FillRectangle (frame.ToRectangleF (), b);
}
}
if (p != null) {
if (corner.Width > 0 || corner.Height > 0) {
var rr = new D2D1.RoundedRectangle ();
rr.Rect = frame.ToRectangleF ();
rr.RadiusX = (float)corner.Width;
rr.RadiusY = (float)corner.Height;
renderTarget.DrawRoundedRectangle (ref rr, p, (float)pen.Width, GetStrokeStyle (pen));
}
else {
renderTarget.DrawRectangle (frame.ToRectangleF (), p, (float)pen.Width, GetStrokeStyle (pen));
}
}
}