Is the word "stroke" used in the same way in the following two sentences?

The pregnancy was a stroke of bad luck.

She applied the paint in careful strokes.
different meanings