If I understand correctly, you know the position of the upper-left corner of the bitmap relative to the drawing area. Given the mouse position relative to the drawing area, the position of the mouse coordinates relative to the bitmap are:
mx = mouseX - bitmap_upr_left.x
my = mouseY - bitmap_upr_left.y
You don't mention what OS you're using, but make sure you have both bitmap position and mouse position relative to the same area. You mentioned screen mouse coordinates - be sure to convert that position to the drawing area. In Windows, for instance, if the drawing area is the client area of the window, use ScreenToClient( hwnd, &mousePt) before you do the calcs.
FYI: "panning" is more commonly understood to be a change in position of the viewpoint, not the position of what's being viewed.
Edited by Buckeye, 15 April 2014 - 10:31 AM.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.