|
You are able to customize brush to write borders with PhotoController,
and the procedure is very simple.
How to write borders is not a secret.
In Borders structure, you can see, BorderStyle is used to
specify the border style, actually, this flag is used to specify the Brush
style. Like we defines all HatchStyle inside.
For example, if you specify PhotoBorderStyle is HorizontalBrick,
like below:
[Visual Basic]
Dim borders As New Borders(PhotoBorderStyle.HorizontalBrick)
borders.Length = 10
' You do not specify a Brush , we will automatically specify it as
New HatchBrush(HacthStyle.HorizontalBrick ,Colors[0],Colors[1]);
[C#]
Borders borders = new Borders(PhotoBorderStyle.HorizontalBrick);
broders.Length =10;
' You do not specify a Brush , we will automatically specify it as
new HatchBrush(HacthStyle.HorizontalBrick ,Colors[0],Colors[1]);
We will look Colors[0] as the ForeColor of HatchBrush and Colors[1]
as the BackColor
Then, what is CenterColor ?
It is what PathGradientBrush needs. Besides HatchBrush,
we use PathGradientBrush to draw other borders style. Colors
will look as SurroundColors of PathGradientBrush. You can
find the direction in MSDN.
Now, lets begin a simplest customized border below
[Visual Basic]
borders.PhotoBorderStyle = PhotoBorderStyle.Customize
borders.Brush = New SolidBrush(Color.Black)
border.Length = 10
[C#]
borders.PhotoBorderStyle = PhotoBorderStyle.Customize;
borders.Brush = new SolidBrush(Color.Black);
borders.Length = 10;
After writing this customized border, it will look like below
 |
 |
| Original photo |
The photo with customized borders |
|