Scaling ofImage from anchorpoint

I’m having a little hard time wrapping my head around scaling an image from a defined point within it. I know it has something to do with translating the image to 0,0 but I’m a little foggy on the math of the new corner position. It seems like this problem has been done many times before.

Can someone point me to where the clues are?

SetAnchorPct on ofTexture or OfImage is really useful. You can translate to the position you want to draw the image and then scale locally.
This should scale a texture by 50% from the bottom middle of the texture in the middle of the screen.
Texture.setAnchorPercent(0.5,1);
ofPushMatrix();
ofTranslate( ofGetWith()*0.5, ofGetHeight()*0.5 );
ofScale(0.5, 0.5);
Texture.draw(0,0);
ofPopMatrix();

oh great. Thanks a lot. It seemed like a fairly simple problem. I had started playing around with setanchorpoint, but for some reason I thought I still needed to translate to (0,0) in order to do it.