C# Класс LayoutFarm.HtmlBoxes.BackgroundImagePaintHelper

Contains all the paint code to paint different background images.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DrawBackgroundImage ( Canvas g, CssBox box, ImageBinder imageBinder, RectangleF rectangle ) : void

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

Приватные методы

Метод Описание
DrawRepeat ( Canvas g, Image img, RectangleF rectangle, Rectangle srcRect, Rectangle destRect, Size imgSize ) : void

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 ( Canvas g, Image img, RectangleF rectangle, Rectangle srcRect, Rectangle destRect, Size imgSize ) : void

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 ( Canvas g, Image img, RectangleF rectangle, Rectangle srcRect, Rectangle destRect, Size imgSize ) : void

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 ( CssLength posX, CssLength posY, RectangleF rectangle, Size imgSize ) : Point

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

Описание методов

DrawBackgroundImage() публичный статический Метод

Draw the background image of the given box in the given rectangle.
Handle background-repeat and background-position values.
public static DrawBackgroundImage ( Canvas g, CssBox box, ImageBinder imageBinder, RectangleF rectangle ) : void
g PixelFarm.Drawing.Canvas the device to draw into
box CssBox the box to draw its background image
imageBinder ImageBinder
rectangle PixelFarm.Drawing.RectangleF the rectangle to draw image in
Результат void