It's not clear what you mean by "panning" a bitmap. Can you provide a more complete description of what you're doing?
Are you trying to determine the pixel's position on the screen, or the position within the bitmap?
The latter: Position within the bitmap using the screen mouse coordinates.
In the editor, the origins is at the top left corner of the drawing area. In the drawing area, there exists a bitmap (a white Canvas, similar to what you will see when you run MS Paint the first time) that is smaller than the drawing area. I can pan (or move) the bitmap around with a Hands tool (similar to Adobe Photoshop's Hand tool, where it moves the entire Canvas to where you wanted to move to). But even when you are panning/moving the bitmap, the origins is still at the top left corner of the drawing area. In other words, the drawing area's X and Y coordinates are not affected by how much you pan/move the bitmap around inside.
Now, I wanted to calculate the position of a pixel within the bitmap, not the position of a pixel on the screen. Now, how do I obtain the position of an arbitrary pixel within the bitmap after the bitmap has been panned/moved around in the drawing area?
Hope this is clear enough.