开发者

Scaling and repositioning circles based on Resolution

We are building an application in Flex where we have to scale and reposition the circles based on the changed screen resolutions.

Example:

Current resolution: (800, 600) I draw a circle at position (410,290) with radius 10

Now If i change the resolution of screen to (1440, 960) then the cir开发者_如何学Pythoncle should be drawn at the same place on the screen with respect to the new resolution with relative increase in the radius.


You could just scale the whole application to match the new resolution by using scaleX and scaleY of some high-level container. You just define your layout on some specific resolution and then calculate the scaleX and scaleY by 1440/800 and 960/600, respectively. The aspect ratios of your resolutions are different, hence the circle will become an ellipse if linearly scaled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜