lundi 13 avril 2015

creating interface for pacman and trying to draw the ghosts. The code is running but the ghost isnt appearing


private void startButton_Click(object sender, EventArgs e)
{
try
{
Bitmap ghost32 = (Bitmap)Image.FromFile(@"..\\..\\ghost32.PNG", true);

TextureBrush texture = new TextureBrush(ghost32);
texture.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
Graphics formGraphics = this.CreateGraphics();
formGraphics.FillEllipse(texture,
new RectangleF(90.0F, 110.0F, 100, 100));
formGraphics.Dispose();

}
catch (System.IO.FileNotFoundException)
{
MessageBox.Show("There was an error opening the bitmap." +
"Please check the path.");
}
}

Aucun commentaire:

Enregistrer un commentaire