Generally the drawing offset of a coordinate is at the topleft corner if one were to draw a square around a tile. For single tile objects like infantry, it's relatively easy to get draw them on the correct position. Like this, the top left corner of the gray square is the 'starting point' when drawing in all my cases.

For buildings, this is a bit more complex. In the screenshot below, I simply have the base image without animation stuff.
The offset calculations I took are:
- offset starts at topleft corner of the square of a tile
- x and y of the SHP frame are added to the offset
- half width and half height of the frame are subtracted from the offset
As you can see, nothing is positioned correctly on the red tile.
Anyone around who can help me move forward?