public void DrawPoint(Graphics AGraphics, Point APoint, byte ABrick)
{
if (ImageList == null) return;
if (ImageList.Images.Count <= 0) return;
if (APoint.X < 0 || APoint.X >= colCount) return;
if (APoint.Y < 0 || APoint.Y >= rowCount) return;
Rectangle vRectangle = new Rectangle(
APoint.X * brickWidth, APoint.Y * brickHeight,
brickWidth, brickHeight);
AGraphics.FillRectangle(new SolidBrush(BackColor), vRectangle);
if (ABrick <= 0) return;
ABrick = (byte)((ABrick - 1) % ImageList.Images.Count);
Image vImage = ImageList.Images[ABrick];
AGraphics.DrawImage(vImage, vRectangle.Location);
} |