Example #1
0
        /// <summary>
        /// Draws the rectangle.
        /// </summary>
        /// <param name="rect">The rectangle.</param>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness.</param>
        public override void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness)
        {
            if (fill.IsVisible())
            {
                this.g.Save();
                this.g.Rectangle(rect.ToRect(false));
                this.g.SetSourceColor(fill);
                this.g.Fill();
                this.g.Restore();
            }

            if (stroke.IsVisible() && thickness > 0)
            {
                this.g.Save();
                this.g.SetSourceColor(stroke);
                this.g.LineWidth = thickness;
                this.g.Rectangle(rect.ToRect(false));
                this.g.Stroke();
                this.g.Restore();
            }
        }
Example #2
0
        /// <summary>
        /// Draws the rectangle.
        /// </summary>
        /// <param name="rect">The rectangle.</param>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness.</param>
        /// <param name="renderingMode">The edge rendering mode.</param>
        public override void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness, EdgeRenderingMode renderingMode)
        {
            bool aliased = !ShouldUseAntiAliasingForRect(renderingMode);

            if (fill.IsVisible())
            {
                this.g.Save();
                this.g.Rectangle(rect.ToRect(aliased));
                this.g.SetSourceColor(fill);
                this.g.Fill();
                this.g.Restore();
            }

            if (stroke.IsVisible() && thickness > 0)
            {
                this.g.Save();
                this.g.SetSourceColor(stroke);
                this.g.LineWidth = thickness;
                this.g.Rectangle(rect.ToRect(aliased));
                this.g.Stroke();
                this.g.Restore();
            }
        }
 /// <summary>
 /// Sets the clip rectangle.
 /// </summary>
 /// <param name="rect">The clip rectangle.</param>
 /// <returns>True if the clip rectangle was set.</returns>
 public override bool SetClip(OxyRect rect)
 {
     this.g.SetClip(rect.ToRect(false));
     return(true);
 }
 /// <summary>
 /// Sets the clip rectangle.
 /// </summary>
 /// <param name="clippingRect">The clipping rectangle.</param>
 /// <returns>True if the clip rectangle was set.</returns>
 public bool SetClip(OxyRect clippingRect)
 {
     this.clip = clippingRect.ToRect(false);
     return true;
 }
Example #5
0
 /// <summary>
 /// Sets the clipping rectangle.
 /// </summary>
 /// <param name="clippingRect">The clipping rectangle.</param>
 /// <returns>True if the clipping rectangle was set.</returns>
 public bool SetClip(OxyRect clippingRect)
 {
     this.clipRect = clippingRect.ToRect(false);
     this.clip     = true;
     return(true);
 }
        /// <summary>
        /// Draws the rectangle.
        /// </summary>
        /// <param name="rect">The rectangle.</param>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness.</param>
        public override void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness)
        {
            if (fill.IsVisible())
            {
                this.g.Save();
                this.g.Rectangle(rect.ToRect(false));
                this.g.SetSourceColor(fill);
                this.g.Fill();
                this.g.Restore();
            }

            if (stroke.IsVisible() && thickness > 0)
            {
                this.g.Save();
                this.g.SetSourceColor(stroke);
                this.g.LineWidth = thickness;
                this.g.Rectangle(rect.ToRect(false));
                this.g.Stroke();
                this.g.Restore();
            }
        }
 /// <summary>
 /// Sets the clip.
 /// </summary>
 /// <param name="clippingRect">The clipping rect.</param>
 /// <returns></returns>
 public bool SetClip(OxyRect clippingRect)
 {
     clip = clippingRect.ToRect(false);
     return(true);
 }