It’s been a while!
Well I was really busy actually - finding a job, moving countries, dealing with movers, insurance claims, doctors, flat hunting and all that on top of a really challenging new job (no worries, I am surviving!).
So here I am, finally tackling something new! Blame the bookshop Foyles, where I found this Visual C# programming book by Jonathan S. Harbour and immediately started playing with WindowsForms. It took me a while, as the book clearly forgets to tell you how to actually open new projects (good thing author has a forum!!)
Anyway, the first project is familiarizing yourself with drawing shapes and bitmaps with GDI+. The structure of the code is fairly easy once you’ve understood it, even if you have never looked at C# before.
The code is divided in easily identified categories.
At the top you have your global statements, where you create your main objects.
This is followed by the Form1_Load section, which allows you to define the settings of your Form. In this case, the author uses the PictureBox control to blend with the Form1 frame and define the canvas. It is in the section as well that the settings for the Bitmap surface and the graphics device, as well as the random generator.
Think of the Bitmap as a polaroid taken after each change. It is independent from the PictureBox and can be saved. The graphics device is defined as the tool that will impact on the bitmap surface.
After the Form1_Load, it is time to work on the graphics device function, which gets its own section. This first project proposes to draw lines in random colours and widths. The colour of the line is defined by randomly assigning values to each segment the ARGB scale. A Pen object is used to gather the coordinates defining the beginning and end of the line.
A Timer object is also used in this particular instance. It defines the interval at which a new line is drawn. This object is also part of the Form1_Load section.
And finally, the code closes with a “free memory” object. This object basically throws away the data stored regarding the graphics device, the surface and the timer and is good practice when running code that uses a lot of memory.
I’m not pasting the whole code here but I thought the section on creating the graphics device was the most interesting:

So, for you not to feel stalked in your every move… meet Arnold. My personal spybot. Tracking you, stalking you… it KNOWS you and what you are doing here….
I have to work on this but I thought I’d lay down the theory before playing around with the technical side. So theorically, we want all cards to belong to one deck (52 cards). The goal is therefore to create the deck using nested arrays. Each card should get a unique value between 0 and 51 and the function deal() will therefore only need to use one Math.random on 52 values instead of two on suits and numbers respectively.
Well ok, I can understand that the perks I got in the fashion industry were much more interesting to her. Which woman in their right mind doesn’t know how to take advantage of half price designer shoes and handbags? But funnily enough, the processes behind creativity is what interested me in fashion and it is also what interests me in video games. 


