Skip to content

Commit 005c92c

Browse files
committed
draw word
1 parent 6d2d7bb commit 005c92c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

c#/pic/ExampleMain.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ static void DrawYellowBox(int bx, int by, Graphics g)
3131
g.DrawRectangle(borderPen, bx + 3, by + 3, 23, 23);
3232
}
3333

34+
static void DrawWord(int bx, int by, Graphics g, String str)
35+
{
36+
Font f = new Font("ËÎÌå", 28);
37+
Brush b = new SolidBrush(Color.DarkOrange);
38+
g.DrawString(str, f, b, bx, by);
39+
}
3440
static int CalcCoordX(int width, int word, int idx)
3541
{
3642
return idx % width * word;
@@ -50,6 +56,7 @@ static void GenImages(String str, String imageFile, List<Image> images)
5056
x = CalcCoordX(6, 40, i);
5157
y = CalcCoordY(6, 40, i);
5258
DrawYellowBox(x, y, g);
59+
DrawWord(x, y, g, str.Substring(i, 1));
5360
images.Add((Image)img.Clone());
5461
g = Graphics.FromImage(img);
5562
}

0 commit comments

Comments
 (0)