當前位置: 首頁>>代碼示例>>C#>>正文


C# Rectangle.ToRectangleF方法代碼示例

本文整理匯總了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);
 }
開發者ID:mono,項目名稱:sysdrawing-coregraphics,代碼行數:4,代碼來源:Graphics.cs

示例2: DrawPie

 public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
 {
     DrawPie(pen, rect.ToRectangleF(), startAngle, sweepAngle);
 }
開發者ID:filipkunc,項目名稱:GLGraphics,代碼行數:4,代碼來源:GraphicsBase.cs

示例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 ();
 }
開發者ID:garuma,項目名稱:xwt,代碼行數:12,代碼來源:ContextBackendHandler.cs

示例4: DrawImage

 public void DrawImage(Image image, Rectangle rect)
 {
     DrawImage(image, rect.ToRectangleF());
 }
開發者ID:filipkunc,項目名稱:GLGraphics,代碼行數:4,代碼來源:GraphicsBase.cs

示例5: DrawEllipse

 public void DrawEllipse(Pen pen, Rectangle rect)
 {
     DrawEllipse(pen, rect.ToRectangleF());
 }
開發者ID:filipkunc,項目名稱:GLGraphics,代碼行數:4,代碼來源:GraphicsBase.cs

示例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 ();
 }
開發者ID:praveen9947,項目名稱:xwt,代碼行數:9,代碼來源:ContextBackendHandler.cs

示例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);
            });
        }
開發者ID:filipkunc,項目名稱:GLGraphics,代碼行數:14,代碼來源:GLGraphics.cs

示例8: FillRectangle

 public override void FillRectangle(Brush brush, Rectangle rect)
 {
     FillRectangle(brush, rect.ToRectangleF());
 }
開發者ID:filipkunc,項目名稱:GLGraphics,代碼行數:4,代碼來源:D2DGraphics.cs


注:本文中的System.Drawing.Rectangle.ToRectangleF方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。