In Portsmouth, the county seat, at least a quarter of the school district’s nearly 650 junior high and high school students have a close relative who uses drugs. At least 140 — more than 20 percent — do not live with their parents, including 41 who are considered homeless, said Beth Burke, a guidance counselor at Portsmouth High School. Family addiction has affected more than half the members of the school’s softball team, the coach said.

During her 17 years of teaching, April Deacon, Hannah’s art teacher, has witnessed a pattern of relatives stepping in to care for children whose parents are struggling with addiction. An increasing number of children are floating from house to house, living with friends or others.

Sensitive to that reality, Ms. Deacon said she always begins her family portrait lesson by explaining that family is whatever her pupils determine it to be. “I can’t think of any student painting a two-parent family right now,” she said.

Jocelyn Cooper, 15, went to live with her aunt and uncle two years ago after a school administrator grew concerned about her failing grades. Jocelyn recalled urinating in a bottle as a child so her mother, a longtime heroin addict, would pass her drug tests while on probation. She said her mother never looked at her grades or put her to bed.

At 9, Jocelyn was picked up by the school bus at a rehab center where she and her mother briefly lived.

Since moving in with her aunt’s family, Jocelyn has experienced the home life she always craved. She now has prescription eyeglasses and a closet’s worth of clothes that are strewn about her bedroom. She gets lots of hugs. The entire family went on a Caribbean cruise this year.