Placing an image over a shape

I am trying to place an ofImage over a shape to sort of apply a texture to it. I am currently using ofDrawCircle and other similar functions but I cant get anything but a basic color to overlay the shape. How would I get the shape to display an image instead of a color. I have also tried using a mesh converted from an ofPolyline for this purposes but no matter how I try to load the texture I always just get one color on the mesh.

ofPolyline line;
float i = 0;
while (i < TWO_PI) { // make a heart
	float r = (2 - 2 * sin(i) + sin(i)*sqrt(abs(cos(i))) / (sin(i) + 1.4)) * -80;
	float x = ofGetWidth() / 2 + cos(i) * r;
	float y = ofGetHeight() / 2 + sin(i) * r;
	line.addVertex(ofVec3f(x, y, 0));
	i += 0.005*HALF_PI*0.5;
ofMesh theMesh;
ofTessellator tess;
ofTexture texture;
texture.allocate(bike.getWidth(), bike.getHeight(), GL_RGB);
tess.tessellateToMesh(line, ofPolyWindingMode::OF_POLY_WINDING_ODD, theMesh, true);

Hi, your approach with the mesh is correct but it is missing the texCoords.
you can use an ofPrimitive that should handle this for you take a look at