Simple Graphics

I am just playing with some simple graphics on Visual Studio 2008. I am trying to make boundries for a simple game board that I have created.

Here is my code: (I forget the tags to make it appear as code in forum)


HPEN pen = CreatePen(PS_SOLID, 3, RGB(600,250,350));
HGDIOBJ penOld;

penOld = SelectObject(hdc, pen);

Rectangle(hdc, 0, 0,100, 900);
Rectangle(hdc, 100, 0,1400, 100);
Rectangle(hdc, 1400, 0,1500, 900);
Rectangle(hdc, 100, 800,1400, 900);

// put back the old objects
SelectObject(hdc, penOld);
DeleteObject(pen);

My Problem: I was under the impression that using the Rectangle function would fill in the rectangle with the pen I am using. However, when I draw it, it is only the borders, and the middle stays white. im hoping this is a simple fix. Thanks!
To fill the rectangles create an HBRUSH

I forget the tags to make it appear as code in forum
they are the [code][/code] tags or the # button
Topic archived. No new replies allowed.