Home

Windows Store Development Tips and Tricks -4 : Taking ScreenShots using Simulator

You wish to take a screenshot of your application.You can do PrintScreen & Paste it in Paint then save the file.

But theres another easy way inside Simulator!

Look at the Tool with white rectangle around it:

 

 

 

 

 

 

 

 

 

This tool helps you instantly take screenshot.Thats it!

Just click once and your image file created in your destination folder(by default its "My Pictures")

You can display your files using "View saved screenshots"


 

 

 

 

 

 

 

 

 


When you click on it,Windows Explorer will get to the destination folder.

You can change the destination folder by using "Choose save location..." it will request from you a new location.

So lets take a look at our screenshot.The screenshots are created using this format :  "screenshot_MonthDateYear_HourMinuteSecond"


 

 

 

 

 

 

 

 

 

 

Windows Store Development Tips and Tricks -3 : Device Settings

While working on a Design Environment,you'll need to set settings of the Windows 8 Device

So how easily can we do it? By using DockPanel to the left in Visual Studio 2012!


Just head over to the DockPanel to the Left as seen below:
 



 

 

 

 

 

 

 

 

 

 

 

 

You can change any setting of Device here,such as Orientation,Display Resolution and Border(chrome)

Its nice to see accessing these settings easily

By the way there are some resolutions settings in Windows 8 Device Settings Panel.Using these,you can change and test your application if it will display exactly the same with other resolutions. For this purpose its useful.

Then again if you're planning to ship an application for a specified resolution you're free to do it!



Here are the resolutions given in Display List:

 

 

 

 

 

 

 

 

 

 

Windows Store Development Tips and Tricks -2 : Changing VS2012 Theme

If you'd like to change VS 2012 IDE's Environment Theme you need to click Tools Menu and choose Options:
 







 

 

 

 

 

 

 

 

 


Then a new Dialog Window will appear.There inside General->Environment you can set theme of the VS 2012 IDE.



















Personally,i dont like Dark Theme,but its up to you ;) 

Developing XNA Apps in Visual Studio 2012(without XNA GS)

 

Have been trying to find a way since there is no official release for XNA GS in Visual Studio 2012 even its Release Candidate.


But i've found something not a good idea but works anyway.

If we dont want to use XNA's Content Pipeline then what worse things can come out of it: 

Well, much more lines of code!


Download the Project!  



Now,Create a new Class Library Project in .NET Framework 4.5(later we'll transform it to Windows Application)



Add reference from a .NET Framework 4.5 project as its displayed there you cant see XNA .dlls as a reference but as an extension!


ss1.png
So we've added the .NET 4.0 extensions for XNA Framework

Now its better we write a Program.cs file and set it as a Startup Project


Program.cs:
using System;

namespace XNAProject2
{
   static class Program
   {
    
      static void Main(string[] args)
      {

         using (Game1 game = new Game1())
         {
            game.Run();
         } 
      }
   }
}

 


Later we set it as Startup Object from Project-> [YourProjectName]Properties

Now lets create a new Game class and add codes for it:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace XNAProject2
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;       
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);            
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);            
}
}
}
Here we are!

Now lets run it if it will run or not:


ss2.png


Ok.That was a nice punch to the face.i admit!

Why this problem occurs because of lack of 64-bit support for previous .net framework references which we call extensions.

Now head over here:

ss3.png


and change as it seems:

s4.png



After you change it to x86 it must have worked nicely

ss5.png

 
An empty screen drawn with CornFlowerBlue Color works as it should be while working with XNA GS.

Now why dont we just fill it?


Lets add a sample sprite it render it inside XNA project:

Lets add a picture inside  your project.i added a performer png file,you can your own.


Add these variables for x,y corrdinates,width and height of the sprite and the object that we will create sprite from "Texture2D"
int x=10;
int y=10;
int width=256;
int height=256;       
Texture2D pic_texture;
Inside LoadContent add these codes:
pic_texture = Texture2D.FromStream(GraphicsDevice, TitleContainer.OpenStream(@"performer.png"));
Here we set up our texture2d object to load an external image file through a path - which is in the same place as code files -

Then in Draw add these codes:
spriteBatch.Begin();
spriteBatch.Draw(pic_texture, new Rectangle(x, y, width, height), Color.White);
spriteBatch.End();
Here we render our sprite with given texture file,x&y coordinates,width and height of the sprite shall be.

Lets run it!

And display our sprite:

ss6.png


 
Thats good!



Even though XNA GS wasnt installed,you've succeeded on developing for XNA platform(Windows only) in Visual Studio 2012.

I do hope that it works in Windows 8 as well even though i was doing this work in Windows 7 system.

Hope this article helps you on your studies

Feel free to drop a comment if you disagree with me the way i suggest here.


Have a nice day!

Metro Application Samples in Windows 8

Here are some samples for Metro Style applications from Microsoft.



Get them :)

 

WP 7.5 Developer tools for Visual Studio 2012

Dont try it on a real device guys,besides wait for an official support or use it on a Windows7+VS2010 environment :)

error.png



Türkiye'nin en doğru, dolu dolu ve hatasız anlatımları ile teknik yazılarına, makalelerine, video'larına, 
seminerlerine, forum sayfasına ve sektörün önde gelenlerine ulaşabileceğiniz teknik topluluğu, MSHOWTO