petes1234
January 28th, 2007, 11:16 AM
fubar
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace foo5
{
public partial class Form6 : Form
{
#region constants
const float LineThicknessRatio = 0.05f;
// thickness / (1/3 of line segment)
// 1.0 obliterates it
const int TTTPictBoxSize = 450;
const float TTTGridMarginRatio = 0.05f;
// if 0.5 then it takes up whole picturebox
private const float lineLength = TTTPictBoxSize * (1 - 2 * TTTGridMarginRatio);
private const float XOCharSize = 0.8f* (lineLength * (1 - LineThicknessRatio)) / 3;
#endregion
enum CellState { Empty, X, O };
#region Private Variables
private Bitmap TicTacToeBitMap;
private Form6c myForm6c;
private GridCell[,] myGrid = new GridCell[3, 3];
#endregion
#region Public Methods
public Form6()
{
InitializeComponent();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
float myXLoc = (TTTPictBoxSize - lineLength) / 3.0f +
// the margin
//(lineLength / 6) +
(i * lineLength / 3);
float myYLoc = (TTTPictBoxSize - lineLength) / 3.0f +
//(lineLength / 6) +
(j * lineLength / 3);
myGrid[i, j] = new GridCell(new PointF(myXLoc, myYLoc), this);
}
}
}
public void ClearGrid()
{
foreach (GridCell myGC in myGrid)
{
myGC.myCellState = CellState.Empty;
}
}
public void PlaceX(Point XLocation)
{
myGrid[XLocation.X, XLocation.Y].myCellState = CellState.X;
}
public void PlaceO(Point OLocation)
{
myGrid[OLocation.X, OLocation.Y].myCellState = CellState.O;
}
#endregion
private class GridCell
{
private CellState _myCellState;
public CellState myCellState
{
get { return _myCellState; }
set
{
_myCellState = value;
PlaceCharInCell();
}
}
private void PlaceCharInCell()
{
string myStr = string.Empty;
if (myCellState != CellState.Empty)
{
if (myCellState == CellState.O)
{
myStr = "O";
}
else
{
myStr = "X";
}
ParentForm.myDrawChar(myStr, Color.Red, XOCharSize, myLocation);
}
}
private PointF _myLocation;
public PointF myLocation
{
get { return _myLocation; }
set { _myLocation = value; }
}
private float _XSize;
public float XSize
{
get { return _XSize; }
set { _XSize = value; }
}
private float _YSize;
public float YSize
{
get { return _YSize; }
set { _YSize = value; }
}
public Form6 ParentForm;
//!!!!!!!!!!!!!! may cause bug if form name changed!
public GridCell(PointF GridCellLoc, Form6 PForm)
{
myLocation = GridCellLoc;
XSize = XOCharSize;
ParentForm = PForm;
}
}
#region Form Events
private void Form6_Load(object sender, EventArgs e)
{
TTTPicBox.Size = new Size(TTTPictBoxSize, TTTPictBoxSize);
TicTacToeBitMap = new Bitmap(
TTTPicBox.Width,
TTTPicBox.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
InitializeMyBitmap();
CreateTTTGrid();
myGrid[0, 0].myCellState = CellState.X;
myGrid[1, 1].myCellState = CellState.X;
myGrid[2, 2].myCellState = CellState.X;
myGrid[0, 2].myCellState = CellState.O;
myGrid[1, 2].myCellState = CellState.O;
myGrid[2, 0].myCellState = CellState.O;
}
private void TTTPicBox_Paint(object sender, PaintEventArgs e)
{
Graphics oGraphics = e.Graphics;
oGraphics.DrawImage(TicTacToeBitMap, 0, 0);
}
private void TTTPicBox_Click(object sender, EventArgs e)
{
}
private void Form6_FormClosed(object sender, FormClosedEventArgs e)
{
TicTacToeBitMap.Dispose();
myForm6c.Close();
}
#endregion
#region Private Non-Graphic Methods
private void CreateTTTGrid()
{
CreateColumns(lineLength);
CreateRows(lineLength);
}
private void CreateColumns(float lineLength)
{
float YStart = (TTTPictBoxSize - lineLength) / 2.0f;
float YEnd = TTTPictBoxSize - YStart;
float XStart = YStart;
float LineThickness = lineLength * LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart + i * lineLength / 3, YStart,
XStart + i * lineLength / 3, YEnd);
}
}
private void CreateRows(float lineLength)
{
float XStart = (TTTPictBoxSize - lineLength) / 2.0f;
float XEnd = TTTPictBoxSize - XStart;
float YStart = XStart;
float LineThickness = lineLength*LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart, YStart + i * lineLength / 3,
XEnd, YStart + i * lineLength / 3);
}
}
public void setForm6c(Form6c myF6c)
{
myForm6c = myF6c;
}
#endregion
#region Private Graphic Methods
private void InitializeMyBitmap()
{
Graphics oGraphics = Graphics.FromImage(TicTacToeBitMap);
Pen myPen = new Pen(Color.AliceBlue);
for (int i = 0; i < TTTPicBox.Width; i++)
{
oGraphics.DrawLine(
myPen,
i, 0,
i, TTTPicBox.Height);
}
myPen.Dispose();
oGraphics.Dispose();
TTTPicBox.Invalidate();
}
private void myDrawLine(Color color, float LineThickness, float f1, float f2, float f3, float f4)
{
Pen myPen = new Pen(color);
myPen.Width = LineThickness;
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
myGraphics.DrawLine(myPen, f1, f2, f3, f4);
myGraphics.Dispose();
myPen.Dispose();
}
internal void myDrawChar(string myStr, Color myColor, float charSize, PointF StrLoc)
{
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
Font myFont = new Font("Arial", charSize);
SolidBrush myBrush = new SolidBrush(myColor);
myGraphics.DrawString(myStr, myFont, myBrush, StrLoc);
myFont.Dispose();
myBrush.Dispose();
myGraphics.Dispose();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace foo5
{
public partial class Form6 : Form
{
#region constants
const float LineThicknessRatio = 0.05f;
// thickness / (1/3 of line segment)
// 1.0 obliterates it
const int TTTPictBoxSize = 450;
const float TTTGridMarginRatio = 0.05f;
// if 0.5 then it takes up whole picturebox
private const float lineLength = TTTPictBoxSize * (1 - 2 * TTTGridMarginRatio);
private const float XOCharSize = 0.8f* (lineLength * (1 - LineThicknessRatio)) / 3;
#endregion
enum CellState { Empty, X, O };
#region Private Variables
private Bitmap TicTacToeBitMap;
private Form6c myForm6c;
private GridCell[,] myGrid = new GridCell[3, 3];
#endregion
#region Public Methods
public Form6()
{
InitializeComponent();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
float myXLoc = (TTTPictBoxSize - lineLength) / 3.0f +
// the margin
//(lineLength / 6) +
(i * lineLength / 3);
float myYLoc = (TTTPictBoxSize - lineLength) / 3.0f +
//(lineLength / 6) +
(j * lineLength / 3);
myGrid[i, j] = new GridCell(new PointF(myXLoc, myYLoc), this);
}
}
}
public void ClearGrid()
{
foreach (GridCell myGC in myGrid)
{
myGC.myCellState = CellState.Empty;
}
}
public void PlaceX(Point XLocation)
{
myGrid[XLocation.X, XLocation.Y].myCellState = CellState.X;
}
public void PlaceO(Point OLocation)
{
myGrid[OLocation.X, OLocation.Y].myCellState = CellState.O;
}
#endregion
private class GridCell
{
private CellState _myCellState;
public CellState myCellState
{
get { return _myCellState; }
set
{
_myCellState = value;
PlaceCharInCell();
}
}
private void PlaceCharInCell()
{
string myStr = string.Empty;
if (myCellState != CellState.Empty)
{
if (myCellState == CellState.O)
{
myStr = "O";
}
else
{
myStr = "X";
}
ParentForm.myDrawChar(myStr, Color.Red, XOCharSize, myLocation);
}
}
private PointF _myLocation;
public PointF myLocation
{
get { return _myLocation; }
set { _myLocation = value; }
}
private float _XSize;
public float XSize
{
get { return _XSize; }
set { _XSize = value; }
}
private float _YSize;
public float YSize
{
get { return _YSize; }
set { _YSize = value; }
}
public Form6 ParentForm;
//!!!!!!!!!!!!!! may cause bug if form name changed!
public GridCell(PointF GridCellLoc, Form6 PForm)
{
myLocation = GridCellLoc;
XSize = XOCharSize;
ParentForm = PForm;
}
}
#region Form Events
private void Form6_Load(object sender, EventArgs e)
{
TTTPicBox.Size = new Size(TTTPictBoxSize, TTTPictBoxSize);
TicTacToeBitMap = new Bitmap(
TTTPicBox.Width,
TTTPicBox.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
InitializeMyBitmap();
CreateTTTGrid();
myGrid[0, 0].myCellState = CellState.X;
myGrid[1, 1].myCellState = CellState.X;
myGrid[2, 2].myCellState = CellState.X;
myGrid[0, 2].myCellState = CellState.O;
myGrid[1, 2].myCellState = CellState.O;
myGrid[2, 0].myCellState = CellState.O;
}
private void TTTPicBox_Paint(object sender, PaintEventArgs e)
{
Graphics oGraphics = e.Graphics;
oGraphics.DrawImage(TicTacToeBitMap, 0, 0);
}
private void TTTPicBox_Click(object sender, EventArgs e)
{
}
private void Form6_FormClosed(object sender, FormClosedEventArgs e)
{
TicTacToeBitMap.Dispose();
myForm6c.Close();
}
#endregion
#region Private Non-Graphic Methods
private void CreateTTTGrid()
{
CreateColumns(lineLength);
CreateRows(lineLength);
}
private void CreateColumns(float lineLength)
{
float YStart = (TTTPictBoxSize - lineLength) / 2.0f;
float YEnd = TTTPictBoxSize - YStart;
float XStart = YStart;
float LineThickness = lineLength * LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart + i * lineLength / 3, YStart,
XStart + i * lineLength / 3, YEnd);
}
}
private void CreateRows(float lineLength)
{
float XStart = (TTTPictBoxSize - lineLength) / 2.0f;
float XEnd = TTTPictBoxSize - XStart;
float YStart = XStart;
float LineThickness = lineLength*LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart, YStart + i * lineLength / 3,
XEnd, YStart + i * lineLength / 3);
}
}
public void setForm6c(Form6c myF6c)
{
myForm6c = myF6c;
}
#endregion
#region Private Graphic Methods
private void InitializeMyBitmap()
{
Graphics oGraphics = Graphics.FromImage(TicTacToeBitMap);
Pen myPen = new Pen(Color.AliceBlue);
for (int i = 0; i < TTTPicBox.Width; i++)
{
oGraphics.DrawLine(
myPen,
i, 0,
i, TTTPicBox.Height);
}
myPen.Dispose();
oGraphics.Dispose();
TTTPicBox.Invalidate();
}
private void myDrawLine(Color color, float LineThickness, float f1, float f2, float f3, float f4)
{
Pen myPen = new Pen(color);
myPen.Width = LineThickness;
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
myGraphics.DrawLine(myPen, f1, f2, f3, f4);
myGraphics.Dispose();
myPen.Dispose();
}
internal void myDrawChar(string myStr, Color myColor, float charSize, PointF StrLoc)
{
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
Font myFont = new Font("Arial", charSize);
SolidBrush myBrush = new SolidBrush(myColor);
myGraphics.DrawString(myStr, myFont, myBrush, StrLoc);
myFont.Dispose();
myBrush.Dispose();
myGraphics.Dispose();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace foo5
{
public partial class Form6 : Form
{
#region constants
const float LineThicknessRatio = 0.05f;
// thickness / (1/3 of line segment)
// 1.0 obliterates it
const int TTTPictBoxSize = 450;
const float TTTGridMarginRatio = 0.05f;
// if 0.5 then it takes up whole picturebox
private const float lineLength = TTTPictBoxSize * (1 - 2 * TTTGridMarginRatio);
private const float XOCharSize = 0.8f* (lineLength * (1 - LineThicknessRatio)) / 3;
#endregion
enum CellState { Empty, X, O };
#region Private Variables
private Bitmap TicTacToeBitMap;
private Form6c myForm6c;
private GridCell[,] myGrid = new GridCell[3, 3];
#endregion
#region Public Methods
public Form6()
{
InitializeComponent();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
float myXLoc = (TTTPictBoxSize - lineLength) / 3.0f +
// the margin
//(lineLength / 6) +
(i * lineLength / 3);
float myYLoc = (TTTPictBoxSize - lineLength) / 3.0f +
//(lineLength / 6) +
(j * lineLength / 3);
myGrid[i, j] = new GridCell(new PointF(myXLoc, myYLoc), this);
}
}
}
public void ClearGrid()
{
foreach (GridCell myGC in myGrid)
{
myGC.myCellState = CellState.Empty;
}
}
public void PlaceX(Point XLocation)
{
myGrid[XLocation.X, XLocation.Y].myCellState = CellState.X;
}
public void PlaceO(Point OLocation)
{
myGrid[OLocation.X, OLocation.Y].myCellState = CellState.O;
}
#endregion
private class GridCell
{
private CellState _myCellState;
public CellState myCellState
{
get { return _myCellState; }
set
{
_myCellState = value;
PlaceCharInCell();
}
}
private void PlaceCharInCell()
{
string myStr = string.Empty;
if (myCellState != CellState.Empty)
{
if (myCellState == CellState.O)
{
myStr = "O";
}
else
{
myStr = "X";
}
ParentForm.myDrawChar(myStr, Color.Red, XOCharSize, myLocation);
}
}
private PointF _myLocation;
public PointF myLocation
{
get { return _myLocation; }
set { _myLocation = value; }
}
private float _XSize;
public float XSize
{
get { return _XSize; }
set { _XSize = value; }
}
private float _YSize;
public float YSize
{
get { return _YSize; }
set { _YSize = value; }
}
public Form6 ParentForm;
//!!!!!!!!!!!!!! may cause bug if form name changed!
public GridCell(PointF GridCellLoc, Form6 PForm)
{
myLocation = GridCellLoc;
XSize = XOCharSize;
ParentForm = PForm;
}
}
#region Form Events
private void Form6_Load(object sender, EventArgs e)
{
TTTPicBox.Size = new Size(TTTPictBoxSize, TTTPictBoxSize);
TicTacToeBitMap = new Bitmap(
TTTPicBox.Width,
TTTPicBox.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
InitializeMyBitmap();
CreateTTTGrid();
myGrid[0, 0].myCellState = CellState.X;
myGrid[1, 1].myCellState = CellState.X;
myGrid[2, 2].myCellState = CellState.X;
myGrid[0, 2].myCellState = CellState.O;
myGrid[1, 2].myCellState = CellState.O;
myGrid[2, 0].myCellState = CellState.O;
}
private void TTTPicBox_Paint(object sender, PaintEventArgs e)
{
Graphics oGraphics = e.Graphics;
oGraphics.DrawImage(TicTacToeBitMap, 0, 0);
}
private void TTTPicBox_Click(object sender, EventArgs e)
{
}
private void Form6_FormClosed(object sender, FormClosedEventArgs e)
{
TicTacToeBitMap.Dispose();
myForm6c.Close();
}
#endregion
#region Private Non-Graphic Methods
private void CreateTTTGrid()
{
CreateColumns(lineLength);
CreateRows(lineLength);
}
private void CreateColumns(float lineLength)
{
float YStart = (TTTPictBoxSize - lineLength) / 2.0f;
float YEnd = TTTPictBoxSize - YStart;
float XStart = YStart;
float LineThickness = lineLength * LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart + i * lineLength / 3, YStart,
XStart + i * lineLength / 3, YEnd);
}
}
private void CreateRows(float lineLength)
{
float XStart = (TTTPictBoxSize - lineLength) / 2.0f;
float XEnd = TTTPictBoxSize - XStart;
float YStart = XStart;
float LineThickness = lineLength*LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart, YStart + i * lineLength / 3,
XEnd, YStart + i * lineLength / 3);
}
}
public void setForm6c(Form6c myF6c)
{
myForm6c = myF6c;
}
#endregion
#region Private Graphic Methods
private void InitializeMyBitmap()
{
Graphics oGraphics = Graphics.FromImage(TicTacToeBitMap);
Pen myPen = new Pen(Color.AliceBlue);
for (int i = 0; i < TTTPicBox.Width; i++)
{
oGraphics.DrawLine(
myPen,
i, 0,
i, TTTPicBox.Height);
}
myPen.Dispose();
oGraphics.Dispose();
TTTPicBox.Invalidate();
}
private void myDrawLine(Color color, float LineThickness, float f1, float f2, float f3, float f4)
{
Pen myPen = new Pen(color);
myPen.Width = LineThickness;
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
myGraphics.DrawLine(myPen, f1, f2, f3, f4);
myGraphics.Dispose();
myPen.Dispose();
}
internal void myDrawChar(string myStr, Color myColor, float charSize, PointF StrLoc)
{
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
Font myFont = new Font("Arial", charSize);
SolidBrush myBrush = new SolidBrush(myColor);
myGraphics.DrawString(myStr, myFont, myBrush, StrLoc);
myFont.Dispose();
myBrush.Dispose();
myGraphics.Dispose();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace foo5
{
public partial class Form6 : Form
{
#region constants
const float LineThicknessRatio = 0.05f;
// thickness / (1/3 of line segment)
// 1.0 obliterates it
const int TTTPictBoxSize = 450;
const float TTTGridMarginRatio = 0.05f;
// if 0.5 then it takes up whole picturebox
private const float lineLength = TTTPictBoxSize * (1 - 2 * TTTGridMarginRatio);
private const float XOCharSize = 0.8f* (lineLength * (1 - LineThicknessRatio)) / 3;
#endregion
enum CellState { Empty, X, O };
#region Private Variables
private Bitmap TicTacToeBitMap;
private Form6c myForm6c;
private GridCell[,] myGrid = new GridCell[3, 3];
#endregion
#region Public Methods
public Form6()
{
InitializeComponent();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
float myXLoc = (TTTPictBoxSize - lineLength) / 3.0f +
// the margin
//(lineLength / 6) +
(i * lineLength / 3);
float myYLoc = (TTTPictBoxSize - lineLength) / 3.0f +
//(lineLength / 6) +
(j * lineLength / 3);
myGrid[i, j] = new GridCell(new PointF(myXLoc, myYLoc), this);
}
}
}
public void ClearGrid()
{
foreach (GridCell myGC in myGrid)
{
myGC.myCellState = CellState.Empty;
}
}
public void PlaceX(Point XLocation)
{
myGrid[XLocation.X, XLocation.Y].myCellState = CellState.X;
}
public void PlaceO(Point OLocation)
{
myGrid[OLocation.X, OLocation.Y].myCellState = CellState.O;
}
#endregion
private class GridCell
{
private CellState _myCellState;
public CellState myCellState
{
get { return _myCellState; }
set
{
_myCellState = value;
PlaceCharInCell();
}
}
private void PlaceCharInCell()
{
string myStr = string.Empty;
if (myCellState != CellState.Empty)
{
if (myCellState == CellState.O)
{
myStr = "O";
}
else
{
myStr = "X";
}
ParentForm.myDrawChar(myStr, Color.Red, XOCharSize, myLocation);
}
}
private PointF _myLocation;
public PointF myLocation
{
get { return _myLocation; }
set { _myLocation = value; }
}
private float _XSize;
public float XSize
{
get { return _XSize; }
set { _XSize = value; }
}
private float _YSize;
public float YSize
{
get { return _YSize; }
set { _YSize = value; }
}
public Form6 ParentForm;
//!!!!!!!!!!!!!! may cause bug if form name changed!
public GridCell(PointF GridCellLoc, Form6 PForm)
{
myLocation = GridCellLoc;
XSize = XOCharSize;
ParentForm = PForm;
}
}
#region Form Events
private void Form6_Load(object sender, EventArgs e)
{
TTTPicBox.Size = new Size(TTTPictBoxSize, TTTPictBoxSize);
TicTacToeBitMap = new Bitmap(
TTTPicBox.Width,
TTTPicBox.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
InitializeMyBitmap();
CreateTTTGrid();
myGrid[0, 0].myCellState = CellState.X;
myGrid[1, 1].myCellState = CellState.X;
myGrid[2, 2].myCellState = CellState.X;
myGrid[0, 2].myCellState = CellState.O;
myGrid[1, 2].myCellState = CellState.O;
myGrid[2, 0].myCellState = CellState.O;
}
private void TTTPicBox_Paint(object sender, PaintEventArgs e)
{
Graphics oGraphics = e.Graphics;
oGraphics.DrawImage(TicTacToeBitMap, 0, 0);
}
private void TTTPicBox_Click(object sender, EventArgs e)
{
}
private void Form6_FormClosed(object sender, FormClosedEventArgs e)
{
TicTacToeBitMap.Dispose();
myForm6c.Close();
}
#endregion
#region Private Non-Graphic Methods
private void CreateTTTGrid()
{
CreateColumns(lineLength);
CreateRows(lineLength);
}
private void CreateColumns(float lineLength)
{
float YStart = (TTTPictBoxSize - lineLength) / 2.0f;
float YEnd = TTTPictBoxSize - YStart;
float XStart = YStart;
float LineThickness = lineLength * LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart + i * lineLength / 3, YStart,
XStart + i * lineLength / 3, YEnd);
}
}
private void CreateRows(float lineLength)
{
float XStart = (TTTPictBoxSize - lineLength) / 2.0f;
float XEnd = TTTPictBoxSize - XStart;
float YStart = XStart;
float LineThickness = lineLength*LineThicknessRatio/3;
for (int i = 1; i < 3; i++)
{
myDrawLine(
Color.Blue,
LineThickness,
XStart, YStart + i * lineLength / 3,
XEnd, YStart + i * lineLength / 3);
}
}
public void setForm6c(Form6c myF6c)
{
myForm6c = myF6c;
}
#endregion
#region Private Graphic Methods
private void InitializeMyBitmap()
{
Graphics oGraphics = Graphics.FromImage(TicTacToeBitMap);
Pen myPen = new Pen(Color.AliceBlue);
for (int i = 0; i < TTTPicBox.Width; i++)
{
oGraphics.DrawLine(
myPen,
i, 0,
i, TTTPicBox.Height);
}
myPen.Dispose();
oGraphics.Dispose();
TTTPicBox.Invalidate();
}
private void myDrawLine(Color color, float LineThickness, float f1, float f2, float f3, float f4)
{
Pen myPen = new Pen(color);
myPen.Width = LineThickness;
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
myGraphics.DrawLine(myPen, f1, f2, f3, f4);
myGraphics.Dispose();
myPen.Dispose();
}
internal void myDrawChar(string myStr, Color myColor, float charSize, PointF StrLoc)
{
Graphics myGraphics = Graphics.FromImage(TicTacToeBitMap);
Font myFont = new Font("Arial", charSize);
SolidBrush myBrush = new SolidBrush(myColor);
myGraphics.DrawString(myStr, myFont, myBrush, StrLoc);
myFont.Dispose();
myBrush.Dispose();
myGraphics.Dispose();
}
#endregion
}
}