// --------------------------------------------------------------------------- /** * Draws a row of stars and circles. * @param canvas the canvas to which the shapes have to be drawn * @param x X coordinate to position the row * @param y Y coordinate to position the row * @param radius the radius of the circles * @param gutter the space between the shapes */ public static void CreateStarsAndCircles(PdfContentByte canvas, float x, float y, float radius, float gutter) { canvas.SaveState(); canvas.SetColorStroke(new GrayColor(0.2f)); canvas.SetColorFill(new GrayColor(0.9f)); CreateStar(canvas, x, y); CreateCircle(canvas, x + radius, y - 70, radius, true); CreateCircle(canvas, x + radius, y - 70, radius / 2, true); canvas.Fill(); x += 2 * radius + gutter; CreateStar(canvas, x, y); CreateCircle(canvas, x + radius, y - 70, radius, true); CreateCircle(canvas, x + radius, y - 70, radius / 2, true); canvas.EoFill(); x += 2 * radius + gutter; CreateStar(canvas, x, y); canvas.NewPath(); CreateCircle(canvas, x + radius, y - 70, radius, true); CreateCircle(canvas, x + radius, y - 70, radius / 2, true); x += 2 * radius + gutter; CreateStar(canvas, x, y); CreateCircle(canvas, x + radius, y - 70, radius, true); CreateCircle(canvas, x + radius, y - 70, radius / 2, false); canvas.FillStroke(); x += 2 * radius + gutter; CreateStar(canvas, x, y); CreateCircle(canvas, x + radius, y - 70, radius, true); CreateCircle(canvas, x + radius, y - 70, radius / 2, true); canvas.EoFillStroke(); canvas.RestoreState(); }
public void StrokeAndFill(){ MetaPen pen = state.CurrentPen; MetaBrush brush = state.CurrentBrush; int penStyle = pen.Style; int brushStyle = brush.Style; if (penStyle == MetaPen.PS_NULL) { cb.ClosePath(); if (state.PolyFillMode == MetaState.ALTERNATE) { cb.EoFill(); } else { cb.Fill(); } } else { bool isBrush = (brushStyle == MetaBrush.BS_SOLID || (brushStyle == MetaBrush.BS_HATCHED && state.BackgroundMode == MetaState.OPAQUE)); if (isBrush) { if (state.PolyFillMode == MetaState.ALTERNATE) cb.ClosePathEoFillStroke(); else cb.ClosePathFillStroke(); } else { cb.ClosePathStroke(); } } }
public void Strip(PdfContentByte content, Rectangle rect) { content.Rectangle( rect.Left - 1, rect.Bottom - 5f, rect.Width, rect.Height + 8 ); content.Rectangle( rect.Left, rect.Bottom - 2, rect.Width - 2, rect.Height + 2 ); float y1 = rect.Top + 0.5f; float y2 = rect.Bottom - 4; for (float f = rect.Left; f < rect.Right - 4; f += 5) { content.Rectangle(f, y1, 4f, 1.5f); content.Rectangle(f, y2, 4f, 1.5f); } content.EoFill(); }
public void StrokeAndFill() { var pen = _state.CurrentPen; var brush = _state.CurrentBrush; var penStyle = pen.Style; var brushStyle = brush.Style; if (penStyle == MetaPen.PS_NULL) { Cb.ClosePath(); if (_state.PolyFillMode == MetaState.Alternate) { Cb.EoFill(); } else { Cb.Fill(); } } else { var isBrush = (brushStyle == MetaBrush.BS_SOLID || (brushStyle == MetaBrush.BS_HATCHED && _state.BackgroundMode == MetaState.Opaque)); if (isBrush) { if (_state.PolyFillMode == MetaState.Alternate) { Cb.ClosePathEoFillStroke(); } else { Cb.ClosePathFillStroke(); } } else { Cb.ClosePathStroke(); } } }