Ejemplo n.º 1
0
        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));
            }
        }
        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));
                }
            }
        }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
 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);
 }
        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);
        }
Ejemplo n.º 6
0
		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));
				}
			}
		}