question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[DX] Texture appears scaled in MonoGameControl, but not in MonoGame project

See original GitHub issue

So I have a texture which I’m drawing in a MonoGameControl. The texture is 48x48 pixels, but when I open the form it is drawn in a 59x59 size, and is noticeably blurry. You can download and zoom these images for reference:

Normal Scaled

This happens with any texture I draw. I have a MonoGame (latest develop branch) project. I draw the same texture and it is drawn correctly.

What I’ve tried:

-Setting Editor.graphics’s backbuffer width and height to the size of the control on the form -Setting the zoom of Camera to 1.0f -Form.AutoScaleMode =AutoScaleMode. None; -Form.DoubleBuffered = false;

My Environment: C# 7.3 Visual Studio 2019 .NET Framework 4.8

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BlizzCraftercommented, Aug 15, 2019

If I remove the manifest, a 100x100 texture will be drawn as a > 125x125 texture (1.25 scale). In fact the whole window would be scaled, not just the texture.

This is not comming from the library. This is the regular Windows DPI scaling system.

Is there any way to fix that from within the library?

In this case adding a manifest file to the project is the right solution and you should go with that.

you should add it as a warning in the README.md for future users

Good idea. I added the specific information in the “Tips&Tricks-section” of the readme.md file.

Thank you for your suggestion and i’m glad I could help you with your problem.

Have a nice day!

0reactions
energyusercommented, Aug 14, 2019

@sqrMin1 Sorry for the late reply.

Yes! Adding that manifest really fixed it. If I remove the manifest, a 100x100 texture will be drawn as a 125x125 texture (1.25 scale). In fact the whole window would be scaled, not just the texture.

Is there any way to fix that from within the library? If not, you should add it as a warning in the README.md for future users…

Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Texture is not displayed with MonoGame OK with Xna
I am using Visual Studio 2012 and I create a MonoGame project using a Microsoft x file. No texture appear (its all black)....
Read more >
Monogame resolution problem (without scaling sprites)
So I'm working on a project and started working on a scaling system for different resolutions. I know if you change the monogame...
Read more >
MonoGame.Forms!
Forms library by creating a simple control to render stuff! (it's assumed that you already have created a new Windows Forms project with...
Read more >
MonoGame.Forms.DX 3.1.0
It will cause flickering and slow downs. If you experience scaling issues with your drawn content, then you might want to set the...
Read more >
Texture rendering issue when scaling with a matrix
I am working on a game (in XNA/MonoGame) in which I have large world consisting of many individual tiles with different textures.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found