BackgroundImageDrawHandler

TheArtOfDev.HtmlRenderer.Core.Handlers

Contains all the paint code to paint different background images.

方法

DrawBackgroundImage(RGraphics, CssBox, ImageLoadHandler, RRect)

Draw the background image of the given box in the given rectangle. Handle background-repeat and background-position values.

g
the device to draw into
box
the box to draw its background image
imageLoadHandler
the handler that loads image to draw
rectangle
the rectangle to draw image in
DrawRepeat(RGraphics, ImageLoadHandler, RRect, RRect, RRect, RSize)

Draw the background image at the required location repeating it over the X and Y axis. Adjust location to left-top if starting location doesn't include all the range (adjusted to center or bottom/right).

DrawRepeatX(RGraphics, ImageLoadHandler, RRect, RRect, RRect, RSize)

Draw the background image at the required location repeating it over the X axis. Adjust location to left if starting location doesn't include all the range (adjusted to center or right).

DrawRepeatY(RGraphics, ImageLoadHandler, RRect, RRect, RRect, RSize)

Draw the background image at the required location repeating it over the Y axis. Adjust location to top if starting location doesn't include all the range (adjusted to center or bottom).

GetLocation(string, RRect, RSize) : RPoint

Get top-left location to start drawing the image at depending on background-position value.

backgroundPosition
the background-position value
rectangle
the rectangle to position image in
imgSize
the size of the image

返回值: the top-left location