Monogame does not save alpha channel

I try this two images and you will understand me.
I convert atlas.png to xnb using microsoft tool and target profile (HiDef/Reach) does not matter. Monogame application I run in LinuxMint. Version monogame 3.4 (I don’t think that it has the meaning). VGA is NVIDIA GF119 [GeForce GT 610].
I want to know why it happens and does exist ways to resolve problem? Thanks for attention

Just in that one corner? And the alpha is fine everywhere else in the image (which it looks to be)? That tells me there is something not right with the source data. We would have to get a copy of the exact source data to see what is going on.

I can give you source data. Yes, just one corner is black, three other are good. Write me email I will send you source.png

Send it to slygamer@gmail.com

I’ve just sent email

I draw so:

Commons.GraphicDevice.Clear(Color.White);

        Commons.SpriteBatch.Begin();

SpriteBatch.Draw(LoaderTextureFont.Atlas, _rect, _rectGlassSource, Color.White);

SpriteBatch.End();

Game constructor has such view:

graphics = new GraphicsDeviceManager(this);

        this.Window.AllowUserResizing = false;

        //this.Window.IsBorderless = true;

        this.Window.Title = "PaymentSoft";

        graphics.SynchronizeWithVerticalRetrace = true;

        graphics.IsFullScreen = true;

        graphics.PreferredBackBufferHeight = 1024;

        graphics.PreferredBackBufferWidth = 1280;

        IsMouseVisible = true;

        IsFixedTimeStep = false;

Just tried it in a DirectX and OpenGL build, with the texture both as compressed and uncompressed. I thought it may have been some compression artifact, but I could not get the same issue you are seeing. Even tried it in XNA and got the same results.

Top row: MonoGame (DirectX 11)
Middle row: MonoGame (OpenGL)
Bottom row: XNA (DirectX 9)
Left column: Color (32-bit BGRA)
Right column: DXT5 compressed

Is it in Linux or Windows OS? In windows OS it is good at me also.
How do you set parameters on left and right columns?

I had three projects (DX, GL, XNA). Added the PNG to the content project, left it at default Texture Processor properties. Ran the application, copied the window to a paint application. Edited the Texture Processor properties in the Content project to set the Texture Format property to DxtCompressed. Ran the project again and copied the window to a paint application. Did that for DX, GL and XNA. Arranged the windows in the grid seen above.

The XNB file on Windows works fine, then copied to the Linux machine that same XNB file exhibits the issue you showed above? I didn’t try it on Linux. The content loading and rendering code for the Windows GL project is exactly the same as that which runs on Linux (and Mac). The only real difference being the OpenGL driver on each system.

I can use only XNA. I cat not create content project on Linux and I think that DxtCompression is created only for Windows OS

Yes DxtCompressed xnb file does not open on Linux.

I try to open by such way:

_loader.LoadContent<Texture2D>(_file));

but I got error:

System.ArgumentException: start_index + length > array length
Parameter name: length
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_to_unmanaged (System.Array,int,intptr,int)
at System.Runtime.InteropServices.Marshal.Copy (System.Byte[] source, System.Int32 startIndex, System.IntPtr destination, System.Int32 length) [0x00000] in /tmp/buildd/mono-5.0.1.1/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:123
at Microsoft.Xna.Framework.Content.Texture2DReader.Read (Microsoft.Xna.Framework.Content.ContentReader reader, Microsoft.Xna.Framework.Graphics.Texture2D existingInstance) [0x0006e] in :0
at Microsoft.Xna.Framework.Content.ContentTypeReader1[T].Read (Microsoft.Xna.Framework.Content.ContentReader input, System.Object existingInstance) [0x0000d] in <aee48928f2a4432fa60c9859269567ba>:0 at Microsoft.Xna.Framework.Content.ContentReader.ReadObject[T] (Microsoft.Xna.Framework.Content.ContentTypeReader typeReader) [0x00001] in <aee48928f2a4432fa60c9859269567ba>:0 at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T] () [0x0008a] in <aee48928f2a4432fa60c9859269567ba>:0 at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T] (System.String assetName, System.Action1[T] recordDisposableObject) [0x00469] in :0
at Microsoft.Xna.Framework.Content.ContentManager.Load[T] (System.String assetName) [0x00066] in :0
at XNA.Controls.OldVersion.LoadContent[T] (System.String fileName) [0x00017] in /media/destructor/Documents/Projects/Terminal_Crossplatform/GUI/Standard/Rombersoft.Standard.Controls/XnaFrameworkDifference/OldVersion.cs:21
at XNA.Controls.LoaderTextureFont.LoadResource (Microsoft.Xna.Framework.Graphics.GraphicsDevice device, System.String[] images) [0x00214] in /media/destructor/Documents/Projects/Terminal_Crossplatform/GUI/Standard/Rombersoft.Standard.Controls/LoaderTextureFont.cs:64

We have a Pipeline Tool for content projects. Works similar to the Content Projects in XNA, but is a separate tool. It is a GUI wrapper around MGCB, the command-line content build tool.

DXT compression is used on all desktop platforms.

That shouldn’t happen. That indicates something wrong in the file. Send me the XNB file?

I’ve created XNB file using Visual Studio 2010 - XNA Project. Do you really need this file?

I copied the Atlas1.xnb file (DXT compressed) produced by my XNA project into my MonoGame OpenGL project and it loaded fine.

Hello friend. I’m sorry but it’s my mistake. Because I’ve set height of source rectangle in method draw smaller on 1 pixel than real size. Therefore corner is black. I’m sorry. I’m guilty. When I experimented yesterday I installed monogame 3.6 but I couldn’t add references to Monogame.Linux.dll, because library list did not contain this dll. I was forced use monogame 3.4 What could be a reason for this problem, do you know? I have lubuntu 16.04 & monodevelop 5.10

Glad you found the reason for the graphic glitch.

I don’t have much experience with using MonoGame installed. I use it from source all the time, and Windows/Visual Studio is my environment of choice.