void IGlyphPainter.PaintPath(Graphics g, System.Drawing.Drawing2D.GraphicsPath path)
        {
            RectangleF bounds = path.GetBounds();
            LinearGradientBrush brush = new LinearGradientBrush(bounds, color1, color2, mode);
            g.FillPath(brush, path);
            brush.Dispose();

            if(numericUpDown1.Value != 0)
            {
                Pen pen = new Pen(colorBorder, (float)numericUpDown1.Value);
                g.DrawPath(pen, path);
                pen.Dispose();
            }
        }
		//UPGRADE_TODO: Interface 'java.awt.Shape' was converted to 'System.Drawing.Drawing2D.GraphicsPath' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
		public ShapeWithStyleBuilder(System.Drawing.Drawing2D.GraphicsPath shape, GraphicContext graphicContext, bool outline, bool fill)
		{
			Point origin = new Point((double) graphicContext.getPen().X, (double) graphicContext.getPen().Y);
			System.Drawing.Brush paint = graphicContext.Paint;
			System.Drawing.Pen stroke = graphicContext.Stroke;
			
			FillStyle fs = null;
			LineStyle ls = null;
			
			if (fill && paint != null)
			{
				System.Drawing.RectangleF tempAux = shape.GetBounds();
				//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
				fs = FillStyleBuilder.build(paint, ref tempAux, graphicContext.Transform);
			}
			
			if (outline && stroke != null)
				ls = LineStyleBuilder.build(paint, stroke);
			
			init(shape, origin, fs, ls, fill);
		}
Esempio n. 3
0
		/// <summary>
		/// Resets the height of the ellipse path contained in the specified GraphicsPath object.
		/// </summary>
		/// <param name="ellipsePath">The GraphicsPath object that will be set.</param>
		/// <param name="height">The new height.</param>
		public static void SetHeight(System.Drawing.Drawing2D.GraphicsPath ellipsePath, float height)
		{
			System.Drawing.RectangleF rectangle = ellipsePath.GetBounds();
			rectangle.Height = height;
			ellipsePath.Reset();
			ellipsePath.AddEllipse(rectangle);
		}
Esempio n. 4
0
		/// <summary>
		/// Resets the width of the ellipse path contained in the specified GraphicsPath object.
		/// </summary>
		/// <param name="ellipsePath">The GraphicsPath object that will be set.</param>
		/// <param name="width">The new width.</param>
		public static void SetWidth(System.Drawing.Drawing2D.GraphicsPath ellipsePath, float width)
		{
			System.Drawing.RectangleF rectangle = ellipsePath.GetBounds();
			rectangle.Width = width;
			ellipsePath.Reset();
			ellipsePath.AddEllipse(rectangle);
		}
Esempio n. 5
0
		/// <summary>
		/// Resets the y-coordinate of the ellipse path contained in the specified GraphicsPath object.
		/// </summary>
		/// <param name="ellipsePath">The GraphicsPath object that will be set.</param>
		/// <param name="y">The new y-coordinate.</param>
		public static void SetY(System.Drawing.Drawing2D.GraphicsPath ellipsePath, float y)
		{
			System.Drawing.RectangleF rectangle = ellipsePath.GetBounds();
			rectangle.Y = y;
			ellipsePath.Reset();
			ellipsePath.AddEllipse(rectangle);
		}
Esempio n. 6
0
 public RectangleF SelectedRectangle(System.Drawing.Region r)
 {
     Graphics g=drawArea1.tempGraphics;
     return r.GetBounds(g);
 }
Esempio n. 7
0
		public void Invalidate(System.Drawing.Region region, bool invalidateChildren) {
			RectangleF bounds = region.GetBounds (CreateGraphics ());
			Invalidate (new Rectangle ((int) bounds.X, (int) bounds.Y, (int) bounds.Width, (int) bounds.Height),
					invalidateChildren);
		}