コード例 #1
0
 public PixelFarm.Drawing.RectangleF GetBounds()
 {
     if (_cacheBoundEval)
     {
         return(_cacheBounds);
     }
     if (_figures != null)
     {
         PixelFarm.Drawing.RectangleF bounds = new Drawing.RectangleF();
         if (_figures.FigureCount > 0)
         {
             bounds = _figures[0].GetBounds(); //start
             for (int i = 1; i < _figures.FigureCount; ++i)
             {
                 bounds = PixelFarm.Drawing.RectangleF.Union(bounds, _figures[i].GetBounds());
             }
         }
         _cacheBoundEval = true;
         return(_cacheBounds = bounds);
     }
     else
     {
         //single figure
         _cacheBoundEval = true;
         return(_cacheBounds = _figure.GetBounds());
     }
 }
コード例 #2
0
ファイル: CanvasGL2d.cs プロジェクト: lingliy/HtmlRenderer
 public void DrawImage(GLBitmap bmp,
                       Drawing.RectangleF srcRect,
                       float x, float y, float w, float h)
 {
     if (bmp.IsBigEndianPixel)
     {
         glesTextureShader.Render(bmp, x, y, w, h);
     }
     else
     {
         gdiImgTextureShader.Render(bmp, x, y, w, h);
     }
 }
コード例 #3
0
        public override void DrawRow(int row, Drawing.RectangleF clipRect)
        {
            bool shouldDraw = true;

            using (var graphics = Graphics.FromHwnd(this.Handle))
            {
                var events = new DrawItemEventArgs(graphics, this.Font.ToFont(), Rectangle.Round(clipRect), row, getState(row));
                if (Host is ListBox)
                {
                    ((ListBox)Host).DrawItemInternal(events);
                }
                shouldDraw = !events.Handled;
            }
            if (shouldDraw)
            {
                base.DrawRow(row, clipRect);
            }
        }
コード例 #4
0
 public static RectangleF AsRectangleF(this Drawing.RectangleF target)
 {
     return(new RectangleF(target.Left, target.Top, Math.Abs(target.Width), Math.Abs(target.Height)));
 }
コード例 #5
0
 public NativeGraphicsView(Drawing.RectangleF frame, IDrawable drawable = null, IGraphicsRenderer renderer = null) : base(frame)
 {
     Drawable        = drawable;
     Renderer        = renderer;
     BackgroundColor = UIColor.White;
 }
コード例 #6
0
 public Metafile(System.IO.Stream stream, System.IntPtr ptr, Drawing.RectangleF rect, MetafileFrameUnit unit)
 {
     throw new NotImplementedException();
 }