-
Notifications
You must be signed in to change notification settings - Fork 3
BrushFactory
Back to home | Back to Reference | View raw text
A class that creates various brushes conveniently.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi
SolidShineUi.BrushFactory[[BrushFactory]]
end
Returns | Name |
---|---|
SolidColorBrush |
Create (... )Create a brush based upon a single color. |
DrawingBrush |
CreateCheckerboardBrush (... )Create a brush with a checkerboard pattern, where the size and colors of the squares are customizable. |
ImageBrush |
CreateFromImage (... )Create a brush based upon an image. |
A class that creates various brushes conveniently.
public static SolidColorBrush Create(Color color)
Type | Name | Description |
---|---|---|
Color |
color | The color to use. |
Create a brush based upon a single color.
A SolidColorBrush that includes the color.
public static SolidColorBrush Create(string hex)
Type | Name | Description |
---|---|---|
string |
hex | The hex value of the color to use. |
Create a brush based upon a single color.
A SolidColorBrush that includes the color.
public static LinearGradientBrush Create(Color col1, Color col2, double angle)
Type | Name | Description |
---|---|---|
Color |
col1 | The first color. |
Color |
col2 | The second color. |
double |
angle | The angle of the gradient to be made. |
Create a brush based upon two colors, made into a linear gradient.
A LinearGradientBrush that includes the two colors.
public static ImageBrush CreateFromImage(ImageSource image)
Type | Name | Description |
---|---|---|
ImageSource |
image | The image to use. |
Create a brush based upon an image.
An ImageBrush containing this image.
public static ImageBrush CreateFromImage(Uri location)
Type | Name | Description |
---|---|---|
Uri |
location | The location, such as a web address or file location, of the image to use. |
Create a brush based upon an image.
An ImageBrush containing this image.
public static ImageBrush CreateFromImage(ImageSource image, TileMode tile)
Type | Name | Description |
---|---|---|
ImageSource |
image | The image to use. |
TileMode |
tile | The tiling mode to use for tiling this image. |
Create a brush based upon an image, with tiling.
An ImageBrush containing this image.
public static ImageBrush CreateFromImage(Uri location, TileMode tile)
Type | Name | Description |
---|---|---|
Uri |
location | The location, such as a web address or file location, of the image to use. |
TileMode |
tile | The tiling mode to use for tiling this image. |
Create a brush based upon an image, with tiling.
An ImageBrush containing this image.
public static DrawingBrush CreateCheckerboardBrush(double squareSize, Color color1, Color color2)
Type | Name | Description |
---|---|---|
double |
squareSize | The size of each square in the pattern. A size of 4 will create a pattern of 4x4 squares, each of alternating colors. |
Color |
color1 | The color to use for the first set of squares. |
Color |
color2 | The color to use for the second, alternating set of squares. |
Create a brush with a checkerboard pattern, where the size and colors of the squares are customizable.
public static DrawingBrush CreateCheckerboardBrush(double squareSize, Brush brush1, Brush brush2)
Type | Name | Description |
---|---|---|
double |
squareSize | The size of each square in the pattern. A size of 4 will create a pattern of 4x4 squares, each of alternating colors. |
Brush |
brush1 | The brush to use for the first set of squares. |
Brush |
brush2 | The brush to use for the second, alternating set of squares. |
Create a brush with a checkerboard pattern, where the size and colors of the squares are customizable.
Generated with ModularDoc