SharpCapture out of nowhere

Today I needed to take a lot of screenshots and I wanted something better than Alt+Print Screen and quicker than The GIMP. So I ask our system administrator and he says: “What the hell you want?”, and after a while: “Sure we have a very nice tool”. “Cool, can you install it on my laptop?”. He smiles at me and says: “I’m sorry but we ran out of licenses”. And here ends the part of the conversation I can safely write about.

So I start looking for free alternatives on the web, even if “someone” told me not to install unauthorized software. But wait, I’m a programmer right? So I start looking how hard would it be creating such a tool. And once again C# comes to the rescue. After 5 minutes and a couple of lines of code sharpcapture is born. And also makes sysadmin happy.

You can get binary/source package from: [download#2]

XNA Tutorial 1: Hello world

Start XNA Game studio and create a new Windows game project.

Right click Content folder and choose Add, New Item.
Select Sprite Font and rename it to some font you like, such as “Arial”.

You can now open the file and modify some of the options such as Size or Style.

Locate the following code:

protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.CornflowerBlue);
 
    // TODO: Add your drawing code here
 
    base.Draw(gameTime);
}

[ad]

And finally add the code to draw a string:

spriteBatch.Begin();
 
spriteBatch.DrawString(Content.Load<SpriteFont>("Arial"), "Hello world", new Vector2(100, 100), Color.Black);
 
spriteBatch.End();

[ad]

Easy, isn’t it?