C# Class LayoutFarm.HtmlBoxes.BorderPaintHelper

Contains all the complex paint code to paint different style borders.
Mostrar archivo Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
DrawBorder ( Color color, CssSide border, PointF borderPts, Canvas g, CssBox box, RectangleF rectangle ) : void

Draw simple border.

DrawBorder ( CssSide border, PointF borderPts, Canvas g, CssBox box, Color solidColor, RectangleF rectangle ) : void
DrawBoxBorders ( PaintVisitor p, CssBox box, RectangleF rect, bool isFirst, bool isLast ) : void

Draws all the border of the box with respect to style, width, etc.

Private Methods

Method Description
Darken ( Color c ) : Color

Makes the specified color darker for inset/outset borders.

DrawBorder ( CssSide borderSide, CssBox box, PaintVisitor p, RectangleF rect, bool isLineStart, bool isLineEnd ) : void

Draw specific border (top/bottom/left/right) with the box data (style/width/rounded).

GetBorderBorderDrawingInfo ( CssBox box, CssSide borderSide, CssBorderStyle &borderStyle, Color &borderColor, float &actualBorderWidth ) : void
GetPen ( GraphicsPlatform platform, CssBorderStyle style, Color color, float width ) : Pen

Get pen to be used for border draw respecting its style.

GetRoundedBorderPath ( PaintVisitor p, CssSide border, CssBox b, RectangleF r ) : GraphicsPath

Makes a border path for rounded borders.
To support rounded dotted/dashed borders we need to use arc in the border path.
Return null if the border is not rounded.

SetInOutsetRectanglePoints ( CssSide border, CssBox b, RectangleF r, bool isLineStart, bool isLineEnd, PointF _borderPts ) : void

Set rectangle for inset/outset border as it need diagonal connection to other borders.

Method Details

DrawBorder() public static method

Draw simple border.
public static DrawBorder ( Color color, CssSide border, PointF borderPts, Canvas g, CssBox box, RectangleF rectangle ) : void
color Color
border CssSide Desired border
borderPts PixelFarm.Drawing.PointF
g PixelFarm.Drawing.Canvas the device to draw to
box CssBox Box which the border corresponds
rectangle PixelFarm.Drawing.RectangleF the bounding rectangle to draw in
return void

DrawBorder() public static method

public static DrawBorder ( CssSide border, PointF borderPts, Canvas g, CssBox box, Color solidColor, RectangleF rectangle ) : void
border CssSide
borderPts PixelFarm.Drawing.PointF
g PixelFarm.Drawing.Canvas
box CssBox
solidColor Color
rectangle PixelFarm.Drawing.RectangleF
return void

DrawBoxBorders() public static method

Draws all the border of the box with respect to style, width, etc.
public static DrawBoxBorders ( PaintVisitor p, CssBox box, RectangleF rect, bool isFirst, bool isLast ) : void
p PaintVisitor
box CssBox the box to draw borders for
rect PixelFarm.Drawing.RectangleF the bounding rectangle to draw in
isFirst bool is it the first rectangle of the element
isLast bool is it the last rectangle of the element
return void