Why this code:
Procedure TForm1.FormPaint(Sender: TObject);
Begin
Brush.Color := clRed;
Canvas.Rectangle(0, 0, Width div 2, Height);
Brush.Color := clGreen;
Canvas.Rectangle(Width div 2, 0, Width, Height);
end;
Do not draw window with left half Red and right half Green?
After refresh it draws just one vertical green line at the Form middle.
And if I change the last row (for example)
from
Canvas.Rectangle(Width div 2, 0, Width, Height);
to
Canvas.Rectangle(Width div 2, 0, Width div 2, Height);
The right half become Green, but, the left is White, no Red at all. And this is not what the Rectangle procedure must do!
Generally, Help, please!