GDI+ stretch my images

So I'm attempting to create a small platform game just for fun, and I bumped into a problem I cannot solve.

I use GDI+ to draw my main character image, but it stretch my image to about 110x100 when they are supposed to be 80x80. Before i added animation it was not a problem because I used the DrawImage method that stretch my image to whatever I want. But after I added animation I had to use this method and it stretch my image. :(

1
2
Image character(L"Character.png", NULL);
graphics.DrawImage(&character, pCharacter->GetXPos(), pCharacter->GetYPos(), pCharacter->GetImageIndex() * 80, 0, 80, 80, UnitPixel);


Character.png is 640x80 and is 8 images next to each other that make the animation.


Any ideas why it might stretch?
If I found the right member function (http://msdn.microsoft.com/en-us/library/aa327536(VS.71).aspx <- with 8 arguments) then it looks like you have the source width set to zero. It may not like this and want to reset that to a default size. Try changing that 0 to a valid width.
Last edited on
Oh thanks!
I managed to get it to work now.
Topic archived. No new replies allowed.