TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
s00014405
NA
24
0
Flickering drawing on image / slight trail also..
Nov 18 2004 6:10 AM
Am a newbie using GDI+ and am trying to do an Air Hockey game. I want to draw on a PictureBox control - the following code does so... but the puck and paddle i draw keep flickering, and also there is a slight trail when i move around the paddle with the mouse. Any suggestions on how to resolve this? private void frmTable_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { gameDraw(); } private void gameDraw() { Graphics g = picTable.CreateGraphics(); SolidBrush redBrush = new SolidBrush(Color.FromArgb(255,50,50)); Pen bluePen = new Pen( Color.Blue, 2 ); Pen blackPen = new Pen( Color.Black, 2 ); g.FillEllipse( redBrush, paddle_x, paddle_y, 32, 32 ); g.DrawEllipse( bluePen, paddle_x, paddle_y, 32, 32 ); g.FillEllipse( redBrush, puck_x, puck_y, 32, 32 ); g.DrawEllipse( blackPen, puck_x, puck_y, 32, 32 ); redBrush.Dispose(); bluePen.Dispose(); blackPen.Dispose(); }
Reply
Answers (
4
)
PictureBox.Image assignment at runtime not working
DirectDraw --> GetPalette().GetEntries() help?