G
Guest
What I want to do is a stretch to even call it animation. I'm just trying to
display moving a piece on a board game. Basically, erase the old position of
the piece, and re-draw it a few spaces over.
I've bean searching through and reading various MSDN articles, like 'Gaming
with the .NET Compact Framework' and it's way beyond what I need to do. I
have a form with a bitmap for the board and a couple other buttons and
labels, and I simply want to draw the player's pieces on top and then move
them. From what I've read in these articles, I'm not sure if I need to
override the onPaint() method (which I've tried and it didn't work), or do
some drawing independently in my own methods (which I've also tried and it
didn't work).
Here's what I've tried, this is a method that is called from the Constructor
of my form, after the InitializeComponent() :
private void drawPieces()
{
Graphics g = this.CreateGraphics();
Pen pen = new Pen(System.Drawing.Color.Crimson);
g.DrawEllipse(pen, 50, 50, 15, 15);
}
And nothing appears. I've tried basically the same code in the overrided
OnPaint method, but using the Graphic object from the PaintEventArgs.
Neither one of these drew the circle.
What am I doing wrong? Any help would be much appreciated. Thanks.
display moving a piece on a board game. Basically, erase the old position of
the piece, and re-draw it a few spaces over.
I've bean searching through and reading various MSDN articles, like 'Gaming
with the .NET Compact Framework' and it's way beyond what I need to do. I
have a form with a bitmap for the board and a couple other buttons and
labels, and I simply want to draw the player's pieces on top and then move
them. From what I've read in these articles, I'm not sure if I need to
override the onPaint() method (which I've tried and it didn't work), or do
some drawing independently in my own methods (which I've also tried and it
didn't work).
Here's what I've tried, this is a method that is called from the Constructor
of my form, after the InitializeComponent() :
private void drawPieces()
{
Graphics g = this.CreateGraphics();
Pen pen = new Pen(System.Drawing.Color.Crimson);
g.DrawEllipse(pen, 50, 50, 15, 15);
}
And nothing appears. I've tried basically the same code in the overrided
OnPaint method, but using the Graphic object from the PaintEventArgs.
Neither one of these drew the circle.
What am I doing wrong? Any help would be much appreciated. Thanks.