V1tzl1
Lt. Junior Grade
- Registriert
- Sep. 2004
- Beiträge
- 384
Hi leutz, stehe leider gerade etwas auf dem Schlauch.
Mein Compiler gibt mir bei folgendem Code einen Fehler.
Ich hoffe ihr könnt mir helfen.
Mein Compiler gibt mir bei folgendem Code einen Fehler.
Code:
void draw(int x, int y, int art)
{
int x1, x2, y1, y2;
x1 = (x )*FAKTOR+PADDING;
x2 = (x+1)*FAKTOR+PADDING;
y1 = (y )*FAKTOR+PADDING;
y2 = (y+1)*FAKTOR+PADDING;
switch(art)
{
case 0:
HPEN pen = CreatePen(PS_SOLID,1,RGB(255,0,0));
HBRUSH brush = CreateSolidBrush(RGB(255,0,0));
SelectObject(hdc, pen);
SelectObject(hdc, brush);
Rectangle(hdc, x1, y1, x2, y2);
break;
case 1: // Hier bleibt der Compiler stehen
HPEN pen = CreatePen(PS_SOLID,1,RGB(0,255,0));
HBRUSH brush = CreateSolidBrush(RGB(0,255,0));
SelectObject(hdc, pen);
SelectObject(hdc, brush);
Rectangle(hdc, x1, y1, x2, y2);
break;
case 2:
HPEN pen = CreatePen(PS_SOLID,1,RGB(0,0,255));
HBRUSH brush = CreateSolidBrush(RGB(0,0,255));
SelectObject(hdc, pen);
SelectObject(hdc, brush);
Rectangle(hdc, x1, y1, x2, y2);
break;
case 3:
HPEN pen = CreatePen(PS_SOLID,1,RGB(0,0,255));
HBRUSH brush = CreateSolidBrush(RGB(0,0,255));
SelectObject(hdc, pen);
SelectObject(hdc, brush);
Rectangle(hdc, x1, y1, x2, y2);
pen = CreatePen(PS_SOLID,1,RGB(255,255,0));
brush = CreateSolidBrush(RGB(255,255,0));
SelectObject(hdc, pen);
SelectObject(hdc, brush);
Ellipse(hdc, x1+2, y1+2, x2-2, y2-2);
break;
}
}