Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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? 
       }

Posted
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.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...