Disclosure of Invention
In view of this, an embodiment of the present invention provides a method and an apparatus for implementing media display, so as to implement functions of displaying media materials in a large-screen product and zooming, rotating, and moving the media materials.
Based on the above purpose, the media display implementation method provided by the embodiment of the present invention includes:
selecting a media object;
adding the media object to an editing area of a media editing control;
executing gesture operation on the media object in the editing area, detecting a gesture operation mode, and calculating gesture operation parameters corresponding to the gesture operation mode according to the gesture operation mode;
and performing corresponding operation and display on the media object according to the gesture operation mode and the gesture operation parameters.
Optionally, the detecting the gesture operation mode includes:
detecting the number of touch points, if the number of the touch points is one, detecting the displacement of a single-finger touch point, if the displacement is larger than zero, the gesture operation mode is a moving mode, and if the displacement is equal to zero, the gesture operation mode is a clicking mode;
if the number of the touch points is two, detecting the distance variation between the two finger touch points, and if the distance variation is larger than zero, the gesture operation mode is a zooming mode;
if the number of the touch points is two, detecting the angle variation between the two finger touch points, and if the angle variation is larger than zero, the gesture operation mode is a rotation mode.
Optionally, the calculating the gesture operation parameter corresponding to the gesture operation mode according to the gesture operation mode includes:
detecting the gesture operation mode of the media object, if the gesture operation mode is a moving mode, storing the position information of a single-finger touch point, and calculating the displacement value of the media object according to the detected displacement of the single-finger touch point;
if the gesture operation mode is a zooming mode, calculating the zooming proportion of the media object according to the detected distance variation between the two finger touch points;
if the gesture operation mode is a rotation mode, calculating the rotation angle of the media object according to the detected angle variation between the two finger touch points.
Optionally, the performing, according to the gesture operation mode and the gesture operation parameter, corresponding operation and display on the media object includes:
detecting the gesture operation mode of the media object, and if the gesture operation mode is a moving mode, moving the media object to a new position and displaying the media object according to the stored single-finger touch point position information and the calculated displacement value of the media object;
if the gesture operation mode is a zooming mode, zooming and displaying the media object according to the zoom ratio of the media object obtained through calculation;
and if the gesture operation mode is a rotation mode, rotating and displaying the media object according to the rotation angle of the media object obtained through calculation.
Optionally, the calculating a rotation angle of the media object according to the detected angle variation between the two finger touch points includes:
calculating an initial angle of the double-finger touch point relative to the horizontal direction according to a calculation method provided by an android mathematical function library;
calculating the end angle of the double-finger touch point relative to the horizontal direction after rotation according to a calculation method provided by the android mathematical function library;
and subtracting the initial angle from the ending angle to obtain the rotation angle of the media object.
Optionally, the media editing control is divided into an editing area and a non-editing area, and the editing area is used for performing gesture operation editing on the added media object and executing the edited gesture operation when the media is displayed.
In another aspect, the present invention further provides a media display implementing apparatus, including:
a selection module for selecting a media object;
the adding module is used for adding the media object to an editing area of a media editing control;
the setting module is used for executing gesture operation on the media object in the editing area, detecting a gesture operation mode and calculating gesture operation parameters corresponding to the gesture operation mode according to the gesture operation mode;
and the display module is used for carrying out corresponding operation and display on the media object according to the gesture operation mode and the gesture operation parameters.
Optionally, the setting module includes:
the touch control device comprises a touch control point detection module and an operation mode detection module;
the touch point detection module is specifically configured to:
detecting the number of touch points;
if the number of the touch points is one, detecting the displacement of a single-finger touch point, if the displacement is larger than zero, the gesture operation mode is a moving mode, and if the displacement is equal to zero, the gesture operation mode is a clicking mode;
if the number of the touch points is two, detecting the distance variation between the two finger touch points, and if the distance variation is larger than zero, the gesture operation mode is a zooming mode;
if the number of the touch points is two, detecting the angle variation between the two finger touch points, and if the angle variation is larger than zero, the gesture operation mode is a rotation mode;
the operation mode detection module is specifically configured to:
detecting the gesture operation mode of the media object;
if the gesture operation mode is a moving mode, storing the position information of the single-finger touch point, and calculating the displacement value of the media object according to the detected displacement amount of the single-finger touch point;
if the gesture operation mode is a zooming mode, calculating the zooming proportion of the media object according to the detected distance variation between the two finger touch points;
if the gesture operation mode is a rotation mode, calculating the rotation angle of the media object according to the detected angle variation between the two finger touch points.
Optionally, the operation mode detection module is further configured to:
detecting the gesture operation mode of the media object;
if the gesture operation mode is a moving mode, moving the media object to a new position and displaying according to the stored single-finger touch point position information and the calculated displacement value of the media object;
if the gesture operation mode is a zooming mode, zooming and displaying the media object according to the zoom ratio of the media object obtained through calculation;
and if the gesture operation mode is a rotation mode, rotating and displaying the media object according to the rotation angle of the media object obtained through calculation.
Optionally, the calculating a rotation angle of the media object according to the detected angle variation between the two finger touch points includes:
calculating an initial angle of the double-finger touch point relative to the horizontal direction according to a calculation method provided by an android mathematical function library;
calculating the end angle of the double-finger touch point relative to the horizontal direction after rotation according to a calculation method provided by the android mathematical function library;
and subtracting the initial angle from the ending angle to obtain the rotation angle of the media object.
As can be seen from the above, the method and the device for implementing media display provided by the embodiment of the invention add a plurality of media editing controls on large-screen software, and add different media objects in the media editing controls, so as to implement common display of a plurality of media materials on a large screen; the media object is set by gesture operation, so that the functions of moving, zooming and rotating the media object by using a touch mode are realized, the traditional process of operating by using a mouse or a keyboard is simplified, the use requirements of multi-scene users are met, and the user experience effect is greatly improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
The present invention is further described with reference to the accompanying drawings, as shown in fig. 1, which is a schematic flow chart of an embodiment of a media display implementation method provided by the present invention, including:
step 101: selecting a media object;
step 102: adding the media object to an editing area of a media editing control; the media editing control is divided into an editing area and a non-editing area, and the editing area is used for performing gesture operation editing on the added media object and executing the edited gesture operation when the media is displayed.
Step 103: executing gesture operation on the media object in the editing area, detecting a gesture operation mode, and calculating gesture operation parameters corresponding to the gesture operation mode according to the gesture operation mode;
optionally, the detecting the gesture operation mode includes:
detecting the number of touch points, if the number of the touch points is one, detecting the displacement of a single-finger touch point, if the displacement is larger than zero, the gesture operation mode is a moving mode, and if the displacement is equal to zero, the gesture operation mode is a clicking mode;
if the number of the touch points is two, detecting the distance variation between the two finger touch points, and if the distance variation is larger than zero, the gesture operation mode is a zooming mode;
if the number of the touch points is two, detecting the angle variation between the two finger touch points, and if the angle variation is larger than zero, the gesture operation mode is a rotation mode.
Optionally, the calculating the gesture operation parameter corresponding to the gesture operation mode according to the gesture operation mode includes:
detecting the gesture operation mode of the media object, if the gesture operation mode is a moving mode, storing the position information of a single-finger touch point, and calculating the displacement value of the media object according to the detected displacement of the single-finger touch point;
if the gesture operation mode is a zooming mode, calculating the zooming proportion of the media object according to the detected distance variation between the two finger touch points;
if the gesture operation mode is a rotation mode, calculating a rotation angle of the media object according to the detected angle variation between the two finger touch points, wherein the range of the rotation angle is 0-360 degrees.
Optionally, the calculating a rotation angle of the media object according to the detected angle variation between the two finger touch points includes:
calculating an initial angle of the double-finger touch point relative to the horizontal direction according to a calculation method provided by an android mathematical function library;
calculating the end angle of the double-finger touch point relative to the horizontal direction after rotation according to a calculation method provided by the android mathematical function library;
and subtracting the initial angle from the ending angle to obtain the rotation angle of the media object.
Step 104: according to the gesture operation mode and the gesture operation parameters, performing corresponding operation and display on the media object;
optionally, the performing, according to the gesture operation mode and the gesture operation parameter, corresponding operation and display on the media object includes:
detecting the gesture operation mode of the media object, and if the gesture operation mode is a moving mode, moving the media object to a new position and displaying the media object according to the stored single-finger touch point position information and the calculated displacement value of the media object;
if the gesture operation mode is a zooming mode, zooming and displaying the media object according to the zoom ratio of the media object obtained through calculation;
and if the gesture operation mode is a rotation mode, rotating and displaying the media object according to the rotation angle of the media object obtained through calculation.
As can be seen from the above, the media display implementation method provided in the embodiment of the present invention adopts the method of adding a plurality of media editing controls to the large-screen software, and adding different media objects to the media editing controls, so as to implement common display of a plurality of media materials on the large screen; the media object is set by gesture operation, so that the functions of moving, zooming and rotating the media object by using a touch mode are realized, the traditional process of operating by using a mouse or a keyboard is simplified, the use requirements of multi-scene users are met, and the user experience effect is greatly improved.
Based on the above object, the present invention further provides a hardware structure diagram of an embodiment of a media display implementation apparatus, as shown in fig. 2, including:
aselection module 201 for selecting a media object;
an addingmodule 202, configured to add the media object to an editing area of a media editing control;
thesetting module 203 is configured to perform a gesture operation on the media object in the editing region, detect a gesture operation mode, and calculate a gesture operation parameter corresponding to the gesture operation mode according to the gesture operation mode;
optionally, thesetting module 203 includes:
a touchpoint detection module 2031 and an operationmode detection module 2032;
the touchpoint detection module 2031 is specifically configured to:
detecting the number of touch points;
if the number of the touch points is one, detecting the displacement of a single-finger touch point, if the displacement is larger than zero, the gesture operation mode is a moving mode, and if the displacement is equal to zero, the gesture operation mode is a clicking mode;
if the number of the touch points is two, detecting the distance variation between the two finger touch points, and if the distance variation is larger than zero, the gesture operation mode is a zooming mode;
if the number of the touch points is two, detecting the angle variation between the two finger touch points, and if the angle variation is larger than zero, the gesture operation mode is a rotation mode;
the operationmode detection module 2032 is specifically configured to:
detecting the gesture operation mode of the media object;
if the gesture operation mode is a moving mode, storing the position information of the single-finger touch point, and calculating the displacement value of the media object according to the detected displacement amount of the single-finger touch point;
if the gesture operation mode is a zooming mode, calculating the zooming proportion of the media object according to the detected distance variation between the two finger touch points;
if the gesture operation mode is a rotation mode, calculating a rotation angle of the media object according to the detected angle variation between the two finger touch points, wherein the range of the rotation angle is 0-360 degrees; the calculating the rotation angle of the media object according to the detected angle variation between the two finger touch points includes:
calculating an initial angle of the double-finger touch point relative to the horizontal direction according to a calculation method provided by an android mathematical function library; calculating the end angle of the double-finger touch point relative to the horizontal direction after rotation according to a calculation method provided by the android mathematical function library; and subtracting the initial angle from the ending angle to obtain the rotation angle of the media object.
Thedisplay module 204 is configured to perform corresponding operation and display on the media object according to the gesture operation mode and the gesture operation parameter;
optionally, the operationmode detecting module 2032 is further configured to:
detecting the gesture operation mode of the media object;
if the gesture operation mode is a moving mode, moving the media object to a new position and displaying according to the stored single-finger touch point position information and the calculated displacement value of the media object;
if the gesture operation mode is a zooming mode, zooming and displaying the media object according to the zoom ratio of the media object obtained through calculation;
and if the gesture operation mode is a rotation mode, rotating and displaying the media object according to the rotation angle of the media object obtained through calculation.
As can be seen from the above, the media display implementation apparatus provided in the embodiment of the present invention adopts the method of adding a plurality of media editing controls to the large-screen software, and adding different media objects to the media editing controls, so as to implement common display of a plurality of media materials on the large screen; the media object is set by gesture operation, so that the functions of moving, zooming and rotating the media object by using a touch mode are realized, the traditional process of operating by using a mouse or a keyboard is simplified, the use requirements of multi-scene users are met, and the user experience effect is greatly improved.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the invention, also features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
In addition, well known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures for simplicity of illustration and discussion, and so as not to obscure the invention. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the invention, and also in view of the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the present invention is to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the invention, it should be apparent to one skilled in the art that the invention can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
The embodiments of the invention are intended to embrace all such alternatives, modifications and variances that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit and principles of the invention are intended to be included within the scope of the invention.