Carmelo Anthony Scores, and Loses, at the Garden. Sound Familiar?

Before Wednesday night’s game at Madison Square Garden, Carmelo Anthony found himself glancing up at the rafters. He was wondering whether his No. 7 would be up there someday. The Knicks will ultimately make that decision, he said. But he was hoping to nudge the process along.

“They say in life you have to envision,” he said, “so I was envisioning.”

Anthony was back at the Garden for the first time in 25 months, this time as a member of the Portland Trail Blazers. He is playing again and scoring again after resuscitating his career at age 35. Against the Knicks, he dusted off his familiar wares: the midrange jumpers, the low-post turnarounds, the skyscraping 3-pointers.

In fact, Anthony was terrific. He finished with 26 points and 7 rebounds while shooting 11 of 17 from the field. But while one game does not define much of anything, it did seem symbolic of Anthony’s complicated legacy: so much production and potential with so little to show for it.

Portland left with its fifth straight loss after getting clobbered by the Knicks, 117-93, who won their third straight game under Mike Miller, their interim coach. Afterward, Anthony expressed mixed emotions. The Trail Blazers have big problems, which the Knicks exposed. But he also sounded nostalgic and grateful.

Again: It was complicated.

“The love was definitely felt tonight,” he said. “Just being back, I think that feeling is hard to explain.”

During player introductions, the crowd greeted Anthony with a warm ovation — and even cheered when he touched the ball early in the first quarter. It was an offensive set that would have looked familiar to anyone who remembered Anthony from his Knicks days: isolated against his defender near the 3-point line. Iso Melo: Back again! Sure enough, as Anthony weighed his options, scattered murmurs grew into a roar. When Anthony finally passed to a teammate, the crowd groaned.

Team officials did not assemble a video tribute for Anthony as they did when he first returned with the Oklahoma City Thunder in 2017, but the atmosphere was no less charged. Even when Anthony went to the bench late in the fourth quarter, a chant surfaced: “We want Melo!”

“I think being in the city makes you a specific type of person,” Anthony said. “And for me to embrace that and want that and take that challenge on, I think that’s why I got the love that I got tonight. And I will continue to get that from this city.”

The energy could not have been more different when Kristaps Porzingis made his return to the Garden with the Dallas Mavericks in November. During that game, Porzingis was booed throughout. The general perception among fans, fair or not, was that Porzingis had forced his way out of New York last season, that he had fled the dysfunction rather than fight through it and try to be a part of the solution.

But unlike Porzingis, Anthony stuck around, even when things soured and even when it was clear that he had become a part of the problem. In the dystopian world of Knicks basketball, there is honor in the simple act of sticking around. If fans are stuck with this team, perhaps the players should be, too.

Of course, if the Knicks were in a better place instead of languishing (again) toward the bottom of the standings, then maybe Anthony’s occasional returns would not be such spectacles. But he was the face of the Knicks the last time the franchise was decent, a reminder of better days — or at least more interesting days.

In his six-plus years with the Knicks, Anthony was a perennial All-Star. He once led the league in scoring and propelled the team to three trips to the playoffs. (Remember the playoffs? No? Never mind.) In any case, Anthony was charismatic and more than proficient most nights and a bona fide presence in a city that celebrates people who have presence.

But only once during his tenure did the Knicks advance past the first round of the playoffs. And over his final four seasons, they were 117-211, setting various records for futility. There was the season he insisted on playing in an All-Star game even though he needed knee surgery. The summer he went on a protracted free agency tour before re-signing for more than $120 million. The quarrels with Phil Jackson, the squabbles with hecklers and the struggles with injuries.

As the Knicks sought to rebuild ahead of the 2017-18 season, they traded Anthony to the Thunder. But when the Houston Rockets released him less than a month into last season, it appeared as if his career might be finished. No one else picked him up. He watched the rest of the season unfold without him.

“I don’t think people understand how difficult that was, how hard that was,” Anthony said.

It is a credit to him that he stayed in shape during his hiatus. The Blazers signed him in November. In 20 games, Anthony is averaging 16.2 points and 6.2 rebounds while shooting a respectable 40.3 percent from 3-point range. Before Wednesday’s loss, Coach Terry Stotts lauded Anthony’s “professionalism.”

“We’ve relied on him probably more than we thought we would when we got him,” Stotts said. “He’s playing big minutes for us. I think the experience he brings, the time he’s had in the league, his leadership — he’s been a very positive influence in the locker room. So, we couldn’t be more pleased that we were able to get him.”

But the Blazers, who are 14-21, are beginning to fray at the seams. When Anthony was asked about his team’s problems after Wednesday’s game, he might as well have been transported straight back to 2013 when the Knicks were mired in one of their losing streaks. He used the same script.

“We just have to go through it,” he said. “That’s all I got to say. We have to go through it. We have to figure it out. Nobody’s going to figure it out for us. We have to figure it out for ourselves. And times like this, when you’re going through it, you have to continue going through it.”

Anthony would know. On throwback night at the Garden, he was speaking from experience.