Can't load image to CCsprite on windows phone 8

Topics: Windows Phone 8
Apr 5, 2014 at 4:31 AM
I am a beginner in COCOS2D-XNA (under windows phone 8)
When i load image for CCspriter :
public IntroLayer()
        {
           // var Backgroundimage = new CCSprite("Icon.png");
           
            Backgroundimage.Position = CCDirector.SharedDirector.WinSize.Center;
         
            //AddChild(Backgroundimage,1);

        }
Content Folder in project have file Icon.png
but the image is not loaded in the emulator , same thing with Label it ok
Coordinator
Apr 5, 2014 at 10:23 PM
var Backgroundimage = new CCSprite("pathToIcon/Icon.png")

Watch the log output and see what the texture cache says is causing an error.

Make sure the "Icon.png" file, that exists under the Content folder, is marked as Content and is marked as "CopyIfNewer" or "Copyalways".
Apr 6, 2014 at 4:57 AM
Image

It still can't load
Coordinator
Apr 8, 2014 at 5:57 AM
What does the log output have in it???
Apr 9, 2014 at 3:34 AM
>WARNING: Async debugging features are unavailable for this debug session because ETW event collection could not be enabled.
'TaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\Myfirtgame.DLL'. Symbols loaded.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\WinMetadata\Windows.winmd'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\MonoGame.Framework.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\SharpDX.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\SharpDX.Direct3D11.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\SharpDX.XAudio2.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\SharpDX.WP8.winmd'. Module was built without symbols.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\cocos2d-xna.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.InteropServices.WindowsRuntime.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{F13744CE-A3B0-426B-8A4A-CF6F482B80CD}\Install\SharpDX.DXGI.DLL'. Cannot find or open the PDB file.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Devices.Sensors.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.WindowsRuntime.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Xna.Framework.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Apr 9, 2014 at 3:35 AM
what i have do ? please
Coordinator
Apr 9, 2014 at 7:51 PM
Nothing else in the log output when the sprite is loaded?? No CCLog output ?? Typically the texture cache outputs the name of the texture when it is loading. Make sure you have the debug symbol enabled for your debug build.
Apr 10, 2014 at 3:16 AM
can you give me a sample project ?
Coordinator
Apr 22, 2014 at 6:36 AM
this should be working now. Get the current version from GitHub and our monogame fork. The WP8 texture loading from a stream is working again.
Apr 22, 2014 at 10:21 AM
what i have do ?
Coordinator
Apr 23, 2014 at 6:42 AM
If you are building from the GitHub source, then just pull the repository and then update the submodule. Just make sure you are on the develop branch of the submodule.

If you are using nuget, then you should be able to update the extension and it will pull down the nightly update. The nuget builds are update every night with a current monogame fork.
May 1, 2014 at 6:43 PM
Edited May 2, 2014 at 3:53 PM
I installed cocos2dxna via NuGet on 1-May-2014, but I am also facing this issue.

Update

Turns out, i cannot render plain png files. Had to convert them into xnb, then it worked fine.
Coordinator
May 2, 2014 at 10:42 PM
The nuget likely pulled in the bad MonoGame regression that removed the PNG file loading. The source tree from GitHub has it fixed.