22
33namespace Pixie
44{
5+ /// <summary>
6+ /// Generates empty grid pattern bitmap
7+ /// </summary>
58 internal class PatternGenerator
69 {
710 private PixelSettings _settings ;
811 private Color _delimeterColor ;
912 private static readonly Color BackGround = Color . Gray ;
13+
1014 public PatternGenerator ( PixelSettings settings )
1115 {
1216 _settings = settings ;
1317 _delimeterColor = ColorTranslator . FromHtml ( _settings . DelimeterColor ) ;
1418 }
15-
19+
20+ /// <summary>
21+ /// Fills bitmap with solid color and draws a grid on it
22+ /// </summary>
23+ /// <param name="patternWidthCount">width of grid in symbols (cells)</param>
24+ /// <param name="patternHeightCount">height of grid in symbols (cells)</param>
25+ /// <returns>production ready bitmap</returns>
1626 public Bitmap GeneratePattern ( int patternWidthCount , int patternHeightCount )
1727 {
1828 var pattentWidth = patternWidthCount * _settings . SymbolWidth +
@@ -28,6 +38,10 @@ public Bitmap GeneratePattern(int patternWidthCount, int patternHeightCount)
2838 return pattern ;
2939 }
3040
41+ /// <summary>
42+ /// Fills background with a solid color
43+ /// </summary>
44+ /// <param name="pattern">bitmap to fill</param>
3145 private void FillBackground ( Bitmap pattern )
3246 {
3347 for ( int j = 0 ; j < pattern . Height ; j ++ )
@@ -39,6 +53,10 @@ private void FillBackground(Bitmap pattern)
3953 }
4054 }
4155
56+ /// <summary>
57+ /// Draws horizontal lines, wich will devide grid cells
58+ /// </summary>
59+ /// <param name="pattern">bitmap to draw in</param>
4260 private void DrawHorizontalLines ( Bitmap pattern )
4361 {
4462 for ( int i = 0 ; i < pattern . Width ; i ++ )
@@ -56,6 +74,10 @@ private void DrawHorizontalLines(Bitmap pattern)
5674 }
5775 }
5876
77+ /// <summary>
78+ /// Draws vertical lines, wich will devide grid cells
79+ /// </summary>
80+ /// <param name="pattern">bitmap to draw in</param>
5981 private void DrawVerticalLines ( Bitmap pattern )
6082 {
6183 for ( int j = 0 ; j < pattern . Height ; j ++ )
0 commit comments