本文整理匯總了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));
}
}
}