maintains position in any rotation
Normalise your stored points, such that the x, y positions are relative to a surface of size 0..1, 0..1 (divide the x, y by the width and height of the current surface). Then, whenever you want to change the size of the underlying surface, multiply each point by this new surface's width and height. All points will now appear in the same relative positions regardless of the surface dimensions.
Note the above will scale (going from portrait to landscape, the Y will be compressed and the X expanded). If you don't want to do this, you will need to take physical dimensions of the surface on-screen into account too. That is, normalise your points to some physical dimension instead.
Note: I have no idea what system, language, package, library, etc. you are using as you don't state in your question!
精彩评论