How to create video files in C# (from single images)

create videos in csharpToday there is again a bit of C# code. I’m writing about how you can create video files in C # from individual images or bitmaps. Using the AForge library, which I have used in the already in the C# webcam tutorial, this is going to be relatively simple.
Preparations
For the following tutorial you need the AForge.Video.FFMPEG.dll library and its FFMPEG libraries. Both can be found by clicking the below link. On the downloadpage you have to select that .zip-file, which contains “(libs only)” in it’s filename.

AForge Libs Download

Now open your Visual Studio or an alternative program, that you want to use to write your program. (For the following tutorial I’m using Visual Studio.)
Create a project
Next you create a new project, I decided on a WinForms project, and wait until the […]

Performance test: rotate images in C# – Bitmap.RotateFlip vs.Graphics-Object

During my search for a function to rotate images in C#, I came across the following post on dotnet-snippets.de: rotate images with C #.
Besides the method presented in the article there were 2 other approaches presented in the comments and so the question was: which method is the fastest of them.
Since this also awakened my interest, I wrote a small test application which checks every of those functions for their performance.
After a few test runs, it became clear that the original solution from the above mentioned post was not suitable because it created a new bitmap every run, what eats tons of memory. Thus, the following function has been excluded from the tests.

public Bitmap rotateImage(Bitmap bitmap, float angle)
{
Bitmap returnBitmap = new Bitmap(bitmap.Width, bitmap.Height);
Graphics graphics = Graphics.FromImage(returnBitmap);
graphics.TranslateTransform((float)bitmap.Width / 2, (float)bitmap.Height / 2);
[…]

“A regular crossword” – a crossword puzzle for coders

How about a crossword puzzle for programmers? One in which the searched words are not described by reference words, but by regular expressions. That’s what I call a crossword. And so I got immediately enthusiastic about the regular expression crossword from this years MIT Mystery Hunt when a friend pointed it to me. (The Mystery Hunt is a competition that is arranged for more than 30 years, held every year at MIT and in which it comes to solve a whole bunch of puzzles.)
One part of this year’s MIT Mystery Hunt is the just mentioned crossword which is titled “A regular Crossword”. Contrary to classical crosswords there are three descriptive directions. The horizontal and two diagonal. Each direction is described by a regular expression.
And now to the puzzle. You can download it as PDF file on the MIT Coinheist page. Alternatively, I’ve saved a copy on my server.

Mastering OpenSSH – Part 1: Installing the OpenSSH server

When it comes to secure connections between two computers, SSH (SSH = Secure Shell) is the drug of choice. Thus for example you can remotely control your home- or web-server by an encrypted connection via SSH. How to install the OpenSSH server (software) on Linux (Ubuntu) and establish and secure the connections, is what I want to show to you in the following series of articles.
As an example scenario, we assume that we have a Linux machine which acts as a server and two computers, one with Ubuntu Linux and one running Windows 8, which represent our clients.
OpenSSH server installation
The first step is to download the server software. The SSH client (for connecting the server with another PC/server for example) can be installed as well if needed.

sudo apt-get update
sudo apt-get install openssh-server openssh-client

After the installation of the OpenSSH server you may need to start the service manually. This can be […]