How can PaintContext be used as function parameter in OnPaint?