Preza8
Preza8

Reputation: 399

Bitmap - wrong coordinates

When I take the mouse coordinates relative to the top left corner and set that pixel to a colour, that pixel is not at the mouse's position and it even differs from bitmap to bitmap. At one bitmap the coordinates seemed to be multiplied by 0.8 but the second one I tried was like *0.2. I tried using PageUnit = GraphicsUnit.Pixel;, that also didn't work. I think the bitmaps might be set to use different pixel size but even if that's the case, I don't know how to handle that.

Upvotes: 0

Views: 128

Answers (1)

TaW
TaW

Reputation: 54433

Looks like your bitmaps have varying dpi settings.

You may need to correct them to be the same as the Graphics object has:

Bmp.SetResolution(g.DpiX, g.DpiY);
g.DrawImage(Bmp, 0, 0); 

Upvotes: 1

Related Questions