The black and white photograph pops up on the television screen as a voice somberly says: "This is Herb Bateman. He has a hard time figuring out why he's in Congress."

Bateman, the first-term Republican from Virginia's 1st Congressional District, is shown sitting at a conference table, head in his hand. He appears to be asleep.

The 30-second spot by Democrat John McGlennon of Williamsburg was called today a "cheap shot" and "New York-style" politics offensive to Virginians by Bateman.

"I have no idea where the photograph was taken," he said. "It's not the norm for me to be asleep in public. I can't say I have never been drowsy at some dull, lousy meeting."

The hard-hitting ad is just the latest salvo in a steady attack that has kept the 56-year-old Republican lawyer on the defensive against McGlennon, a 35-year-old professor of government at The College of William and Mary who is making his second bid for the House.

The Tidewater district, which has been in Republican hands since 1976, is rated a tossup by many Virginia politicians who say Bateman has failed to capitalize on his incumbency because of his low key, often serious style.

Bateman, who served 15 years in the state legislature first as a Democrat, then as a Republican, has established a clear edge in raising funds, but McGlennon has sought to turn this against the incumbent, charging that Bateman made too many promises as he sought campaign money.

Last week, after an attack by McGlennon, Bateman apologized for one of his fund-raising letters. McGlennon said the letter had suggested political action committees could win improper influence by giving to the incumbent.

In the letter, which Bateman said an adviser drafted, the member of Congress said:

"I am requesting a generous contribution from your PAC and would appreciate any assistance . . . . I will remember your generosity and assure you that it will be put to good use."

Bateman said that the letter, which charged that liberal and labor organizations "smell blood" with his defeat, could be misinterpreted. "To the extent the language could be distorted, it would have been best to have been written another way," he said.

McGlennon, a former state director of the Democratic Party, is running other negative ads about Bateman, including charges that the congressman opposed additional federal funding to clean up toxic-waste sites. There are 31 in the district.

"The congressman's eyes have been closed to the concerns of the district for two years . . . . " McGlennon said.

Bateman counters that he supports the Superfund but that it has more money that it can spend in the near future.

The 1st District stretches from the adjoining cities of Newport News and Hampton, where about 65 percent of the district's residents live, to more rural and isolated areas of the Eastern Shore and Northern Neck along the Potomac River and Chesapeake Bay.

It is a defense-minded and heavily industrialized district, home to several military installations and Newport News Shipbuilding and Dry Dock Co., the state's largest private employer.

The district is about 31 percent black and the black vote could be crucial in the Nov. 6 election, according to Democrats.

They regularly point out that Bateman voted against a federal holiday to honor the late Martin Luther King Jr., a measure that was supported by Virginia's two Republican senators, John W. Warner and Paul S. Trible.

The Democrats also noted that the size of the black vote in the district will be a test of increased registration spurred by the presidential bid of Jesse L. Jackson.

He is credited with encouraging thousands of blacks to register in several Tidewater communities.

Democrats say a sampling of key precincts in Newport News showed that black registration had increased by 14 percent while white registration had risen only 2 percent.

Trible represented the district for six years until his Senate election in 1982.

He was the first Republican in modern times to serve in what was long regarded as a solidly Democratic district, and as one editorial writer says, "A lot of people still think Trible is their congressman."

That comment is a reflection on both Trible's continued popularity and the problems Bateman has had in becoming known.

After serving almost 18 months in Congress, Bateman this summer began running television ads that were designed to combat what his aides say was his poor name recognition.

Bateman and McGlennon, who has been criticized for sometimes appearing too professorial and stiff in public appearances, have sparred over aid for the elderly, the U.S. budget deficits and defense waste.

Bateman contends his experience makes him a better "legislative craftsman" and said he has worked "without fanfare" to protect the shipping and employment interests of the district.

"There's little I can say about Professor McGlennon," Bateman said. "He has shown signs of desperation . . . . "

Bateman, a lawyer, has raised about $314,000, according to a campaign report filed today. Aides said about 44 percent of that came from PACs, many of them oil, gas and business groups along with the Fund for a Conservative Majority.

He reported $58,797 on hand as of Oct. 17.

McGlennon, who reported about $21,000 on hand for the same time, has raised about $172,000, about half of which has come from labor, environmental and Democratic groups such as Democrats for the '80s, a PAC run by Pamela Harriman and other prominent Democrats in Washington.

The McGlennon campaign has drawn the active support of the state's leading Democrats, including Gov. Charles S. Robb.

Bateman has been boosted by Warner, Trible and former president Gerald Ford, who is scheduled to make a day-long campaign swing through the state on Friday.