dxfoo Posted September 16, 2005 Posted September 16, 2005 I guess the question says it all. Thanks in advanced. private void pnl_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; int[,] map = PC.currentMap; // Draw map. for (int y = 0; y < 8; y++) { for (int x = 0; x < 10; x++) { g.DrawImage(Images.imgGrass_1, x * 50, y * 50); } } // Draw player. g.DrawImage(Images.imgC1_Stand, PC.X, PC.Y); Refresh(); // or should i use invalidate? } Quote
Nate Bross Posted September 18, 2005 Posted September 18, 2005 I am not sure that this is the correct thread; however, check out this thread http://www.xtremedotnettalk.com/showthread.php?t=93136. There is the use of a manual double buffer. ie drawing to a single bitmap and then drawing that to the screen. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Diesel Posted September 18, 2005 Posted September 18, 2005 Yeh, check out the link. Also, you shouldn't have to refresh or invalidate at the end of your paint function...that would most likely erase all that you've drawn. You need to add your function to the paint eventhandler of the control. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.