0

Hi I am trying to convert PNG file to XNB to use in the example program, Breakernoid project. I have used XNA Formatter to convert .png to .xnb but 72kb file has created 2Mb .xnb file. That itself is a red flag to me.

Basically I just want to create my own image file and use in the project. Thought the documentation says that MonoGame development accepts .png files in the content folder, it just does not work.

Any help is greatly appriciated, thx

Anyway I tried to use it, but my app crashed with an exception

Microsoft.Xna.Framework.Content.ContentLoadException was unhandled
  HResult=-2146233088
  Message=Could not load board2 asset as a non-content file!
  Source=MonoGame.Framework
  StackTrace:
       at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject)
       at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
       at MMCreate.Game1.LoadContent() in C:\Shri\CSProjects\GameProjects\MMCreate\Game1.cs:line 103
       at Microsoft.Xna.Framework.Game.Initialize()
       at MMCreate.Game1.Initialize() in C:\Shri\CSProjects\GameProjects\MMCreate\Game1.cs:line 89
       at Microsoft.Xna.Framework.Game.DoInitialize()
       at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
       at Microsoft.Xna.Framework.Game.Run()
       at MMCreate.Program.Main() in C:\Shri\CSProjects\GameProjects\MMCreate\Program.cs:line 22
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
       HResult=-2146233088
       Message=The content file was not found.
       Source=MonoGame.Framework
       StackTrace:
            at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName)
            at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject)
       InnerException: 
            FileName=C:\Shri\CSProjects\GameProjects\MMCreate\bin\Windows\Debug\Content\board2.xnb
            HResult=-2147024894
            Message=Could not find file 'C:\Shri\CSProjects\GameProjects\MMCreate\bin\Windows\Debug\Content\board2.xnb'.
            Source=mscorlib
            StackTrace:
                 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
                 at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
                 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
                 at Microsoft.Xna.Framework.TitleContainer.OpenStream(String name)
                 at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName)
            InnerException: 
Falgantil
  • 1,290
  • 12
  • 27
Up-In-Air
  • 111
  • 4

0 Answers0