I’m developing Windows phone apps and I’m new to it,I’m using below code to add PNG image to application bar at runtime
this.ApplicationBar = new ApplicationBar();
this.ApplicationBar.Opacity = 1;
this.ApplicationBar.Mode = ApplicationBarMode.Minimized;
ApplicationBarIconButton btn = new ApplicationBarIconButton();
btn .IconUri = new Uri("/Resources/car.png", UriKind.Relative);
btn .Text = "Car";
this.ApplicationBar.Buttons.Add(btn);

But image is not loading it shows ‘X’ inside application bar circle, i tried also in design using below code
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Resources/car.png" Text="Car" IsEnabled="False" />
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="About" />
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
but did not work, My image size is 48 x 48 pixels, white foreground graphic for the button in 26 x 26. Did i miss something,Please help me.
Check the properties of the image file in the project: you should have
Build Actionset toContentin order to the file go with the final .XAP file