本文整理匯總了C#中System.Drawing.Rectangle.ToRectangleF方法的典型用法代碼示例。如果您正苦於以下問題:C# Rectangle.ToRectangleF方法的具體用法?C# Rectangle.ToRectangleF怎麽用?C# Rectangle.ToRectangleF使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Rectangle
的用法示例。
在下文中一共展示了Rectangle.ToRectangleF方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetClip
public void SetClip(Rectangle rect, CombineMode combineMode)
{
SetClip (rect.ToRectangleF (), combineMode);
}
示例2: DrawPie
public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
{
DrawPie(pen, rect.ToRectangleF(), startAngle, sweepAngle);
}
示例3: DrawImage
public override void DrawImage(object backend, object img, Rectangle srcRect, Rectangle destRect, double alpha)
{
CGContext ctx = ((CGContextBackend)backend).Context;
NSImage image = (NSImage) img;
var rect = new RectangleF (0, 0, (float)destRect.Width, (float)destRect.Height);
ctx.SaveState ();
ctx.SetAlpha ((float)alpha);
ctx.TranslateCTM ((float)destRect.X, (float)destRect.Y + rect.Height);
ctx.ScaleCTM (1f, -1f);
ctx.DrawImage (rect, image.AsCGImage (RectangleF.Empty, null, null).WithImageInRect (srcRect.ToRectangleF ()));
ctx.RestoreState ();
}
示例4: DrawImage
public void DrawImage(Image image, Rectangle rect)
{
DrawImage(image, rect.ToRectangleF());
}
示例5: DrawEllipse
public void DrawEllipse(Pen pen, Rectangle rect)
{
DrawEllipse(pen, rect.ToRectangleF());
}
示例6: DrawImage
public void DrawImage(object backend, object img, Rectangle srcRect, Rectangle destRect, double alpha)
{
CGContext ctx = ((CGContextBackend)backend).Context;
NSImage image = (NSImage) img;
ctx.SaveState ();
ctx.SetAlpha ((float)alpha);
ctx.DrawImage (destRect.ToRectangleF (), image.AsCGImage (RectangleF.Empty, null, null).WithImageInRect (srcRect.ToRectangleF ()));
ctx.RestoreState ();
}
示例7: DrawImage
public override void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
{
if (srcUnit != GraphicsUnit.Pixel)
throw new NotImplementedException();
Bitmap bitmap = _imageAttributesCache.GetOrCreateBitmapFromImageAndAttributes(image, imageAttr);
DrawTexture(bitmap, texture =>
{
RectangleF dstRect = destRect.ToRectangleF();
RectangleF srcRect = new RectangleF(0, 0, texture.OriginalWidth, texture.OriginalHeight);
texture.Draw(dstRect, srcRect);
});
}
示例8: FillRectangle
public override void FillRectangle(Brush brush, Rectangle rect)
{
FillRectangle(brush, rect.ToRectangleF());
}