1. Technical Field
The present disclosure relates to image zooming technology and, particularly, to an electronic device and a method capable of zooming images.
2. Description of the Related Art
Nowadays, more and more electronic devices employ touch panel as an input device, people can directly slide fingers on the touch panel to execute to zoom in and zoom out an displayed image on the display screen. However, it is easy to damage the touch panel to directly slide fingers on.
Therefore, it is beneficial to provide an electronic device to overcome the limitations described.
The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of an electronic device capable of zooming images and a method thereof. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
Referring to
In the embodiment, if two touch points 110 are simultaneously touched, the electronic device 1 uses the coordinates of the touched touch points 110 to calculate and store a distance between the two touched touch points 110 as D1. After determining two touch points 110 have been simultaneously touched, the electronic device 1 further determines whether two more touch points 110 are simultaneously touched within a preset time interval. The preset time is employed for preventing accidental touches or touches for other purposes being mistaken for zooming commands. If two more touch points 110 are simultaneously touched within the preset time interval, the electronic device 1 further calculates and stores a distance between the two more touch points 110 as D2. The electronic device 1 then compares D1 with D2 to determine whether to zoom an image displayed on the display screen in or out. In the embodiment, if D1<D2, the electronic device 1 zooms out the displayed image, otherwise, the electronic device 1 zooms in the displayed image. Put simply, if a user wants to zoom in on an image, they should touch the touch panel 11 a first time in two places at the same time, then touch the touch panel 11 again immediately after on two places further apart or vice versa to zoom out. Obviously in other embodiments other responses to touches on the touch panel 11 could be employed with the device 1. It should be noted that in the embodiment if two more touch points 110 are not simultaneously touched within the preset time interval after an initial two touch points 110 are touched, the electronic device 1 erases the distance value D1. If two more touch points 110 are simultaneously touched within the preset time interval, the electronic device 1 erases both the distance values D1 and D2 after executing the zooming function.
Referring also to
The touch determining module 120 is configured to determine whether two touch points 110 are simultaneously touched. In the embodiment, if the touch determining module 120 determines two coordinates of two touch points 110 are simultaneously received, the touch determining module 120 determines that the two touch points 110 are simultaneously touched. After determining two touch points have been simultaneously touched, the touch determining module 120 further determines whether two more touch points 110 are simultaneously touched within the preset time interval.
The calculating module 121 is configured to calculate the distance between any two touch points 110 being simultaneously touched according to their coordinates, and store the calculated distance in the storage unit 13.
The comparing module 122 is configured to compare the distance D1 with the distance value D2, and generate a comparison result.
The zooming module 123 is configured to zoom in and zoom out the displayed image according to the comparison result of D1 and D2. If the comparing module 122 determines the distance value D1<D2, the zooming module 123 zooms out the displayed image. Otherwise, the zooming module 123 zooms in the displayed image.
The erasing module 124 is configured to erase the distance values stored in the storage unit 13. In the embodiment, if the distance value D1 is stored in the storage unit 13, and the touch determining module 120 determines there are not two more touch points 110 being simultaneously touched within the preset time interval, the erasing module 124 erases the distance value D1. If the touch determining module 120 determines two more touch points 110 are simultaneously touched within the preset time interval, the erasing module 124 waits until after executing the zooming function then erases D1 and D2.
Referring to
In step S30, the electronic device 1 displays an image on the display screen 10.
In step S31, the touch determining module 120 determines whether two touch points 110 are simultaneously touched. If the touch determining module 120 determines two touch points are simultaneously touched, the procedure goes to step S32, otherwise, the procedure returns to step S31.
In step S32, the calculating module 121 calculates the distance value D1 between the two touched touch points 110 according to their coordinates, and stores D1 in the storage unit 13.
In step 33, the touch determining module 120 further determines whether two more touch points 110 are also simultaneously touched within a preset time interval. If the touch determining module 120 determines two more touch points 110 are simultaneously touched within the preset time interval, the procedure goes to step S35, otherwise, the procedure goes to step S34.
In step 34, the erasing module 124 erases D1 from the storage unit 13.
In step 35, the calculating module 121 calculates the distance value D2 between the two more touched touch points 110 according to their coordinates, and stores D2 in the storage unit 13.
In step 36, the comparing module 122 compares D1 with D2. If D1<D2, the procedure goes to step S37, otherwise, the procedure goes to S38.
In step 37, the zooming module 123 zooms out the displayed image.
In step 38, the zooming module 123 zooms in the displayed image.
In step 39, the erasing module 124 erases D1 and D2 from the storage unit 13.
It is understood that the present disclosure may be embodied in other forms without departing from the spirit thereof. Thus, the present examples and embodiments are to be considered in all respects as illustrative and not restrictive, and the disclosure is not to be limited to the details given herein.
Number | Date | Country | Kind |
---|---|---|---|
200910311482.1 | Dec 2009 | CN | national |