David Saunders, 33, is said to have gone to Sarah Bramley’s Durham home in a “jealous rage” and lay in wait to attack Michael Lawson as he left.
Ms Bramley, 38, was seeing both Saunders and Mr Lawson, 34. Saunders became jealous and started to send her abusive and threatening text messages.
She is said to have “responded in kind” and the text row escalated until the sex act image was sent.
Saunders then texted: “You sket. I’m coming over, I’m coming to knock f*** out of him, watch.”
In another message he wrote: “You’ll see angry. Keep him there.”
Prosecutor Nick Dry told the court: “Within a short time the defendant ordered a taxi and travelled to her address, which is a five-minute car journey. The prosecution case is that at that time he was armed with a knife.”
Saunders has pleaded guilty to murder.
But he disputes the claim he took the knife to the scene in Darlington, Co Durham, in July.
He says Mr Lawson was carrying the blade which he grabbed during a struggle in the street.
The victim died at the scene from a single stab wound.
Saunders is facing a trial of issue in front of a judge.
Mr Dry added: “It is the Crown’s case the defendant travelled down armed and in a jealous rage to make good the threats he had issued.”
Saunders told Teesside crown court of his anger after he was sent the X-rated text.