[As feature code tutorial 14] Fish Eye Magnifier

Source: Internet
Author: User

This section adds an asterisk, borrow black feather words: "The content of this section is somewhat difficult, if do not understand, can temporarily do not look, wait for later encounter similar problem, come to consult again"

Let's use the graphic method to explain the example below.

Ideas:

1. The Fish Eye Magnifier is composed of several tapering circles;

2. So that each circle to mask a larger picture to achieve, inside the small round mask larger than the picture, outside the large circle mask smaller picture;

3. There is also a final important step is "focus", because the picture is growing, so the mouse is a point of the small image may be the head, and for the larger picture may be out of the field, then show the effect is wrong. Use "focus" to let the mouse point to the small image is the head, the larger picture also if the head, so that gives you an impression, please see the diagram below.

Graphic:

1. First put two film clips on the stage, one of which is the picture, the instance name "Pic", the registration point on the left (0,0), the other is the circle, the size: 200*200, the instance name "Ball", the registration point in the center;

2. Fish Eye magnifying Glass is a number of gradually small circle composition, so that these circles as lenses, overlapping together, while imaging, the number of circles (lenses), the more detailed imaging effect, the figure of 3

The code is as follows:

var Count:Number = 3;
//复制圆(镜片)的数量
for (var i = 0; i
< Count; i++) {

 var b = ball.duplicateMovieClip("B"+i, i*2+1);
 //复制圆
 b._xscale = b._yscale=(1-i/Count)*100;
 //圆的缩放= (1-第i个圆/圆的数量)*100,例:100~90~80~70
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.