• Advertisement
Sign in to follow this  

GDI Image is the wrong size

This topic is 4249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've just started working with c# and GDI, and I'm trying to write a map editor for a tile engine. I have a tile map with 32x32px tiles, and i can pick out individual tiles and they are the right size. But when I attempt to draw the entire image, it draws each tile larger than 32x32. How do I make it draw the image with the correct dimensions?
g.DrawImage(i, new Rectangle(0, 0, 32, 32),
               new Rectangle(32, 32, 32, 32),
               GraphicsUnit.Pixel);
           //Succesfully picks out a 32x32 tile from the grid and draws it

g.DrawImage(tileMap, 0, 0);
           //Draws the entire image, but larger than it should be



Share this post


Link to post
Share on other sites
Advertisement
I made it work by passing drawImage rectangles in the same way I did for the individual tile, but making them the size of the image... Which works, but does anyone know... a more proper way I guess?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement