The correct answer is C. was painting.
The sentence "When I saw him he was painting a portrait" is in the past progressive tense. The past progressive tense is used to describe an action that was in progress at a specific time in the past. In this case, the action is "painting a portrait" and the specific time is when the speaker saw the person.
The other options are not correct because they do not describe an action that was in progress at a specific time in the past.
- A. is painting is in the present progressive tense. The present progressive tense is used to describe an action that is happening now.
- B. painted is in the simple past tense. The simple past tense is used to describe an action that happened at a specific time in the past.
- D. had painting is in the past perfect tense. The past perfect tense is used to describe an action that happened before another action in the past.
I hope this explanation is helpful!