GDI+ Problem

time to read 1 min | 153 words

I'm trying to draw a PNG image whose size is 16x16, using Graphics.DrawImage ( System.Drawing.Image image , System.Int32 x , System.Int32 y ), but for some reason it draws it at ~21x21, which ruins everything. If I convert the image to ICO, then it draws it properly.

I changed the code to use the Graphics. DrawImage ( System.Drawing.Image image , System.Int32 x , System.Int32 y , System.Int32 width , System.Int32 height ) overload, and it works, but I can't think of a reason that this would require this. After all, the image already contains the width / height information!

You can see the problem now if you take a look at NQA's repository and change GraphControl.cs Paint method (lines 78 & 80) to use the overload without the width & height information.

[Listening to: It's My Life - Dr. Alban - Fetenhits Eurodance Classics(03:59)]