CN106960460B - Animation processing method, device and equipment - Google Patents

Animation processing method, device and equipment Download PDF

Info

Publication number
CN106960460B
CN106960460B CN201610811737.0A CN201610811737A CN106960460B CN 106960460 B CN106960460 B CN 106960460B CN 201610811737 A CN201610811737 A CN 201610811737A CN 106960460 B CN106960460 B CN 106960460B
Authority
CN
China
Prior art keywords
attribute
value
dotted line
initial value
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610811737.0A
Other languages
Chinese (zh)
Other versions
CN106960460A (en
Inventor
黄通
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610811737.0A priority Critical patent/CN106960460B/en
Publication of CN106960460A publication Critical patent/CN106960460A/en
Application granted granted Critical
Publication of CN106960460B publication Critical patent/CN106960460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Abstract

The application relates to an animation processing method, device and equipment, wherein the method comprises the following steps: determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments; according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy; and after each adjustment, redrawing the object according to the adjusted dotted line attribute value. The animation effect can be realized only by adjusting the attribute value of the dotted line, and the method is easy to realize.

Description

Animation processing method, device and equipment
Technical Field
The present application relates to the field of graphics processing technologies, and in particular, to a method, an apparatus, and a device for processing animation.
Background
In order to improve the aesthetic property and the interest of the graph, the graph can be processed in an animation mode, and the graph has an animation effect. In the conventional art, a mask may be used to create animation effects. When the mask is used for realizing the animation effect, a rectangle can be drawn in a newly-built layer, a completely white mask is built, and the mask is moved, so that the graph in the layer under the mask is gradually displayed, and the animation effect of the graph is realized. Therefore, in the related art, the steps are complex in the process of realizing graphic animation processing.
Disclosure of Invention
The application provides an animation processing method, device and equipment, and aims to solve the problem that animation processing in the prior art is complex.
According to a first aspect of embodiments of the present application, there is provided an animation processing method, the method including:
determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments;
according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy;
and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
According to a second aspect of embodiments of the present application, there is provided an animation processing apparatus, the apparatus including:
the device comprises an initial value determining module, a judging module and a judging module, wherein the initial value determining module is used for determining an initial value of a dotted line attribute of an object, the object is a graph formed by at least one line, and the dotted line attribute comprises a real line segment length attribute and an interval length attribute between two solid line segments;
the animation processing module is used for carrying out successive adjustment on the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy; and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
According to a third aspect of embodiments of the present application, there is provided a client device, including:
a processor; a memory for storing the processor-executable instructions;
wherein the processor is configured to:
determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments;
according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy;
and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
When the animation processing method, the device and the equipment are applied, after the initial value of the dotted line attribute of the object is determined, the dotted line attribute value of the object is adjusted successively according to the determined initial value of the dotted line attribute and a preset adjustment strategy, after each adjustment, the object is redrawn according to the adjusted dotted line attribute value, and the drawn objects gradually have differences, so that the animation effect can be realized only by adjusting the dotted line attribute value, and the realization is easy.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1A is a flowchart of an embodiment of an animation processing method according to the present application.
Fig. 1B is a schematic diagram of an object shown in the present application.
Fig. 1C is a schematic diagram of an application example of the animation processing method shown in the present application.
Fig. 2 is a hardware structure diagram of an electronic device in which the animation processing apparatus of the present application is located.
FIG. 3 is a block diagram of an embodiment of an animation processing apparatus according to the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to avoid the defect that the method for realizing the animation effect in the related technology is complex, the method for processing the animation is provided, after the initial value of the dotted line attribute of the object is determined, the dotted line attribute value of the object is adjusted successively according to the determined initial value of the dotted line attribute and a preset adjustment strategy, after each adjustment, the object is redrawn according to the adjusted dotted line attribute value, and because the objects drawn each time have differences gradually, the animation effect can be realized, so that the animation effect can be realized only by adjusting the dotted line attribute value, and the realization is easy.
As shown in fig. 1A, fig. 1A is a flowchart of an embodiment of an animation processing method of the present application, including the following steps:
in step 101, an initial value of a dashed line attribute of an object is determined, where the object is a graph composed of at least one line, and the dashed line attribute includes a real line segment length attribute and a space length attribute between two solid line segments.
In step 102, the dashed line attribute value of the object is adjusted successively according to the determined dashed line attribute initial value and a preset adjustment strategy, and after each adjustment, the object is redrawn according to the adjusted dashed line attribute value.
The application can be applied to electronic equipment with drawing tools. The electronic device may be a handheld electronic device or other electronic device. For example, it may be a mobile phone, or a slightly smaller portable device such as a wristwatch device, pendant device, or other wearable or miniaturized device, but also a tablet computer, notebook computer, desktop computer, television, computer integrated into a computer display, or other electronic equipment. In the present application, the drawing tool is a drawing tool supporting setting of a dotted line style.
In step 101, the object may be an object drawn in real time by a drawing tool or may be a previously drawn object. For example, the object may be rendered before determining the initial value of the dashed attribute of the object. For another example, a rendered object may be obtained before determining the initial value of the dashed attribute of the object.
The object is a graph formed by at least one line, namely the object is formed by the lines, and at least one line is arranged in the lines forming the graph. The lines constituting the pattern may be either solid lines or broken lines. As shown in fig. 1B, fig. 1B is a schematic diagram of an object shown in the present application. In the schematic diagram, the object may be a graph composed of one solid line, a graph composed of a plurality of broken lines, or a graph composed of a plurality of solid lines.
The dashed lines are broken lines drawn as short lines. The dashed line has a dashed line attribute that includes a solid line end length attribute and a space length attribute between two solid line segments. The space length attribute between two solid line segments may also be referred to as a null line length attribute. In the dashed lines, the different dashed lines are distinguished by the attribute values in the dashed line attributes. In an example, the real-line-segment length attribute value in the dotted-line attribute may be the number of pixels in the real line segment, and the interval-length attribute value in the dotted-line attribute may be the number of interval pixels between two solid-line segments.
The method comprises the steps of firstly determining an initial value of a dotted line attribute of an object. There are many ways to determine the initial value of the dashed attribute of the object, and the present disclosure illustrates several of these ways.
In an alternative implementation, the current dotted-line attribute value of the object is directly determined as the initial value of the dotted-line attribute of the object.
In the case that the line composing the object is a dotted line, the object has a dotted line attribute value, and the dotted line attribute value is directly determined as the initial value of the dotted line attribute of the object, that is, the current state of the object is directly used as the initial state of the adjustment.
In another optional implementation manner, the initial value of the dotted-line attribute of the object is set according to the received attribute setting instruction.
Wherein the attribute setting instruction is an instruction to set a dotted attribute value. For example, the attribute setting instruction may be a setting instruction directly triggered by the user. For another example, the attribute setting instruction may be a setting instruction that is triggered in the case where the animation processing condition is satisfied.
In one example, the attribute setting instructions may indicate both that attribute values need to be set and how to set the attribute values.
For example, an attribute setting instruction is received, and the initial value of the dotted-line attribute of the object is set according to a setting target value carried in the attribute setting instruction.
The set target value may be an attribute value input by a user, and the initial value of the dotted-line attribute of the object is set according to the attribute value input by the user, so that controllability of the initial value of the dotted-line attribute is achieved.
In addition, the attribute setting instruction may indicate how to set the attribute value in another manner, for example, the attribute setting instruction may also carry an identifier indicating an initial value of the dotted-line attribute, and the initial value of the dotted-line attribute of the object is set according to the identifier.
In another example, an attribute setting instruction is received, and an initial value of the dotted-line attribute of the object is set according to a preset setting target value.
In this example, at least one setting target value may be set in advance, and the initial value of the dotted-line attribute of the object is set directly according to the preset setting target value when the attribute setting instruction is received.
Therefore, the initial value of the dotted line attribute of the object can be set according to the preset set target value, user input is not needed, and user experience is improved.
It can be understood that, according to the received attribute setting instruction, after the initial value of the dotted-line attribute of the object is set, the object may be redrawn.
Based on the above embodiments, the present application separately introduces the cases where the lines constituting the object are broken lines and solid lines.
For the case where the line constituting the object is a dotted line, the object currently has a dotted line attribute value, but in order to achieve a certain animation effect, the dotted line attribute value of the object may be changed according to the animation effect that needs to be achieved. For example, to achieve the effect of gradually displaying the object, the dotted-line attribute value of the object may be reset to be set to the dotted-line attribute initial value, where the interval-length attribute initial value is greater than the real-line-segment-length attribute initial value. For another example, to achieve the effect of gradually disappearing the object, the dashed attribute value of the object may be reset and set to the dashed attribute initial value, where the interval length attribute initial value in the dashed attribute initial value is smaller than the real line segment length attribute initial value.
The difference value between the initial value of the interval length attribute and the initial value of the real line segment length attribute is related to the animation display effect. For example, if the effect of gradually displaying the object is an animation display effect from nothing, the interval length attribute initial value is set to a value much larger than the real line length attribute initial value, for example, the real line length attribute initial value may be 0, and the interval length attribute initial value may be 1000. For another example, when the effect of gradually displaying the object is an animation display effect from a hidden display to a clear display, the interval length attribute initial value is set to a value slightly larger than the real line length attribute initial value, for example, the real line length attribute initial value may be 1, and the interval length attribute initial value may be 20.
In an example, the difference between the initial value of the interval length attribute and the initial value of the real-line length attribute may be a difference defined by the animation effect displayed by the user as needed, or a difference determined by the machine according to the input animation effect, and is not limited specifically.
In the case where the line constituting the object is a solid line, the object may have a dotted-line attribute, but the dotted-line attribute has no effective value, and based on this, it is necessary to set an initial value of the dotted-line attribute of the object so that the solid line constituting the object is changed to a dotted line. In one example, the initial value of the dotted-line attribute of the object may be set according to the received attribute setting instruction. The above examples have been introduced, and are not described in detail herein.
Regarding step 102, the dashed attribute value of the object may be adjusted successively according to the determined initial value of the dashed attribute and a preset adjustment policy, and after each adjustment, the object may be redrawn according to the adjusted dashed attribute value.
The preset adjusting strategy is a preset strategy for adjusting the dotted line attribute value of the object so as to enable the object to have an animation effect. For example, the dotted-line attribute value of the object may be adjusted successively according to a preset adjustment amplitude value. The adjustment amplitude value of each adjustment can be the same or different, and the adjustment amplitude value can be determined according to the animation effect, or can be an amplitude value generated randomly each time. The adjustment frequency may also be set in a preset adjustment strategy. Since the adjustment is performed one by one, and the object is redrawn according to the adjusted dotted-line attribute value after each adjustment, the object drawn each time may be different, and thus an animation effect can be achieved.
The successive adjustment of the dotted line attribute value of the object may be performed by successively adjusting the real line length attribute of the object, by successively adjusting the interval length attribute value of the object, by successively adjusting the real line length attribute and the interval length attribute value of the object at the same time, or by adjusting the real line length attribute of the object at one time and the interval length attribute value of the object at the next time during the adjustment, and the adjustment is performed cyclically in sequence.
In an alternative implementation, in a case where the animation effect of the object is an effect of gradually displaying the object, an interval length attribute initial value of the broken line attribute initial values is larger than a real line segment length attribute initial value.
The step of successively adjusting the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy at least comprises one of the following steps:
successively increasing the real line segment length attribute value in the dotted line attribute value of the object according to a first preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and gradually reducing the interval length attribute value in the dotted line attribute value of the object according to a second preset amplitude value by taking the determined interval length attribute initial value as a starting point.
In order to achieve the effect of gradually displaying the object, of the broken-line attribute initial values, the interval-length attribute initial value may be set larger than the real-line-segment-length attribute initial value.
In one example, after determining the initial value of the dashed-line attribute, the real-line-length attribute value of the dashed-line attribute values of the object may be successively increased by a first preset amplitude value with the determined initial value of the real-line-length attribute as a starting point, so as to gradually reduce the difference between the real-line-length attribute value and the interval-length attribute value. The successively increasing of the real-line segment length attribute value in the dashed-line attribute value of the object may be increasing a first preset amplitude value every time adjustment is performed according to a preset adjustment frequency, with the determined real-line segment length attribute initial value as a starting point.
Wherein, the reduction range can be set according to the animation effect. The first preset amplitude value increased in each adjustment may be the same or different.
Assuming that the initial value of the dotted line attribute is set to [0,1000], at this time, the object is invisible, in each adjustment, the real line segment length attribute value in the dotted line attribute value of the object is increased by a first preset amplitude value of 5, the dotted line attribute value after the first adjustment is [5, 1000], the object is drawn according to the adjusted dotted line attribute value, the dotted line attribute value after the second adjustment is [10, 1000], the object is drawn according to the adjusted dotted line attribute value, and so on, and the animation effect of realizing the object can be obtained.
Therefore, in this embodiment, the difference between the real-line length attribute value and the interval length attribute value can be gradually reduced by gradually increasing the real-line length attribute value, so as to gradually display the animation effect of the object.
After the initial value of the dotted line attribute is determined, the determined initial value of the interval length attribute may also be used as a starting point, and the interval length attribute value in the dotted line attribute value of the object is gradually reduced according to a second preset amplitude value, so as to gradually reduce the difference between the real line segment length attribute value and the interval length attribute value. The step of successively decreasing the interval length attribute value in the dotted line attribute value of the object may be to subtract a second preset amplitude value every time of adjustment according to a preset adjustment frequency, with the determined interval length attribute initial value as a starting point.
In each adjustment, the reduced second preset amplitude value may be the same or different. To finally be able to display the object, the real line segment length attribute initial value is not equal to 0.
Assuming that the initial value of the dotted line attribute is set to [20,1000], because the difference between the real line segment length attribute value and the interval length attribute value is too large, the object is invisible, in each adjustment, the interval length attribute value in the object dotted line attribute value is reduced by a second preset amplitude value of 2, the dotted line attribute value after the first adjustment is [10, 998], the object is drawn according to the adjusted dotted line attribute value, the dotted line attribute value after the second adjustment is [10, 996], the object is drawn according to the adjusted dotted line attribute value, and so on, so that the animation effect of realizing the object can be obtained.
Therefore, in this embodiment, the difference between the real-line segment length attribute value and the interval length attribute value can be gradually reduced by gradually reducing the interval length attribute value, so as to gradually display the animation effect of the object.
In an example, after determining the initial value of the dashed-line attribute, the determined initial value of the real-line-segment length attribute may be used as a starting point, and the real-line-segment length attribute value in the dashed-line attribute values of the object may be successively increased according to a first preset amplitude value; and simultaneously, the determined interval length attribute initial value is used as a starting point, and the interval length attribute value in the dotted line attribute value of the object is gradually reduced according to a second preset amplitude value, so that the difference value between the real line segment length attribute value and the interval length attribute value is gradually reduced.
Wherein, the reduction range can be set according to the animation effect. The first preset amplitude value may be the same or different in each adjustment, and the second preset amplitude value may be the same or different.
Assuming that the initial value of the dotted line attribute is set to [0,1000], in each adjustment, the real line segment length attribute value in the dotted line attribute value of the object is increased by a first preset amplitude value 1, and the interval length attribute value in the dotted line attribute value of the object is decreased by a second preset amplitude value 5, the dotted line attribute value after the first adjustment is [1, 995], and the object is drawn according to the adjusted dotted line attribute value, the dotted line attribute value after the second adjustment is [2, 990], and the object is drawn according to the adjusted dotted line attribute value, and so on, so that the animation effect for realizing the object can be obtained.
Therefore, in this embodiment, the difference between the real-line length attribute value and the interval length attribute value can be gradually reduced by gradually increasing the real-line length attribute value and decreasing the interval length attribute value, so as to gradually display the animation effect of the object.
It can be understood that the present application may also at least increase the real-line length attribute value in the dashed attribute values of the objects or decrease the interval length attribute value in the dashed attribute values of the objects in each adjustment, thereby achieving an animation effect of gradually displaying the objects.
In another alternative implementation, in a case where the animation effect of the object is an effect of fading away the object, an interval length attribute initial value of the broken line attribute initial values is smaller than a real line segment length attribute initial value.
The step of successively adjusting the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy at least comprises one of the following steps:
successively reducing the real line segment length attribute value in the dotted line attribute value of the object according to a third preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and gradually increasing the interval length attribute value in the dotted line attribute value of the object according to a fourth preset amplitude value by taking the determined interval length attribute initial value as a starting point.
In order to achieve the effect of fading out the object, of the broken-line attribute initial values, the interval-length attribute initial value may be set smaller than the real-line-segment-length attribute initial value.
In one example, after determining the initial value of the dashed-line attribute, the real-line-length attribute value in the dashed-line attribute values of the object may be successively decreased by a third preset amplitude value with the determined initial value of the real-line-length attribute as a starting point, so as to gradually increase the difference between the real-line-length attribute value and the interval-length attribute value.
Wherein the increase amplitude can be set according to animation effect. The third preset amplitude value reduced in each adjustment may be the same or different.
Therefore, in this embodiment, the difference between the real-line length attribute value and the interval length attribute value can be gradually increased by gradually decreasing the real-line length attribute value, so as to achieve an animation effect of gradually disappearing the object.
In one example, after determining the initial value of the interval length attribute, the interval length attribute value in the dashed line attribute values of the object may be successively increased by a fourth preset amplitude value with the determined initial value of the interval length attribute as a starting point, so as to gradually increase the difference between the real line segment length attribute value and the interval length attribute value.
Wherein the increase amplitude can be set according to animation effect. The fourth preset amplitude value increased in each adjustment may be the same or different.
Therefore, in this embodiment, the difference between the real-line segment length attribute value and the interval length attribute value can be gradually increased by gradually increasing the intermediate interval length attribute value, so as to achieve an animation effect of gradually disappearing the object.
In an example, after determining the initial value of the dashed-line attribute, the determined initial value of the real-line-segment length attribute may be used as a starting point, and the real-line-segment length attribute value in the dashed-line attribute values of the object may be successively reduced according to a third preset amplitude value; and simultaneously, the determined interval length attribute initial value is used as a starting point, and the interval length attribute value in the dotted line attribute value of the object is gradually increased according to a fourth preset amplitude value, so that the difference value between the real line segment length attribute value and the interval length attribute value is gradually increased.
Wherein the increase amplitude can be set according to animation effect. The third preset amplitude value may be the same or different in each adjustment, and the fourth preset amplitude value may be the same or different.
As can be seen, this embodiment may implement an animation effect of gradually disappearing the object by gradually decreasing the real-line-segment-length attribute value among the dotted-line attribute values of the object and gradually increasing the interval-length attribute value among the dotted-line attribute values of the object.
It can be understood that, the present application may further at least decrease the real-line length attribute value in the dashed attribute values of the object or increase the interval length attribute value in the dashed attribute values of the object in each adjustment, thereby achieving an animation effect of gradually disappearing the object.
In an alternative implementation, the gradual display and gradual fade-out animation effects may exist simultaneously in one animation.
In one example, in a preset adjustment strategy, whether to switch from the current animation effect to another animation effect may be determined according to an adjustment time of the animation effect. For example, the determined initial value of the real-line-segment length attribute is used as a starting point, and the real-line-segment length attribute value in the dotted-line attribute value of the object is gradually increased according to a first preset amplitude value; meanwhile, the determined interval length attribute initial value is used as a starting point, and the interval length attribute value in the dotted line attribute value of the object is gradually reduced according to a second preset amplitude value; and when the adjusting time reaches the first set time, taking the adjusted dotted line attribute value as a starting point, successively reducing the real line segment length attribute value in the dotted line attribute value of the object according to a third preset amplitude value, simultaneously successively increasing the interval length attribute value in the dotted line attribute value of the object according to a fourth preset amplitude value, and when the adjusting time reaches the second set time, ending the adjusting operation of the dotted line attribute value and the drawing operation of the object.
Therefore, whether the adjustment method is switched or not is determined by adjusting the time, so that different animation effects can be realized.
In one example, in a preset adjustment strategy, whether to switch from the current animation effect to another animation effect may be determined according to a dotted attribute value of the object. In the adjusting process, when the adjusted dotted line attribute value reaches the set dotted line attribute value, the current animation effect can be switched to other animation effects. For example, the determined initial value of the real-line-segment length attribute is used as a starting point, and the real-line-segment length attribute value in the dotted-line attribute value of the object is gradually increased according to a first preset amplitude value; and when the real-line-segment-length attribute value reaches the first set real-line-segment-length attribute value, successively reducing the real-line-segment-length attribute value in the dotted-line attribute value of the object by taking the adjusted dotted-line attribute value as a starting point according to a third preset amplitude value, and when the real-line-segment-length attribute value reaches the second set real-line-segment-length attribute value, ending the adjustment operation of the dotted-line attribute value and the drawing operation of the object.
Therefore, whether the adjustment method is switched or not is determined by the dotted line attribute value of the object, so that different animation effects can be realized.
In the preset adjustment strategy, an adjustment ending strategy is not required to be set, so that the object is always in the adjustment process.
In an optional implementation manner, in order to avoid resource waste caused by constant adjustment, an adjustment ending policy may be set in the preset adjustment policy.
In one example, when the adjusted dotted-line attribute value reaches a preset dotted-line attribute end value, the adjustment operation of the dotted-line attribute value and the drawing operation of the object are ended.
For example, when the difference between the real-line-segment-length attribute value and the interval-length attribute value is gradually reduced by gradually increasing the real-line-segment-length attribute value, if the initial value of the dotted-line attribute is set to [0,1000], the end value of the dotted-line attribute may be [1000,1000], and when the real-line-segment-length attribute value is increased to 1000, no adjustment is performed, that is, the adjustment operation of the dotted-line attribute value and the drawing operation of the object are ended, thereby avoiding resource waste caused by continuous operation.
Therefore, by setting the end value of the dotted line attribute, when the adjusted dotted line attribute value reaches the preset end value of the dotted line attribute, the adjustment operation of the dotted line attribute value and the drawing operation of the object are ended, thereby avoiding resource waste caused by continuous operation.
In another example, when the time to adjust the dotted-line attribute value of the object reaches the set end time, the adjustment operation of the dotted-line attribute value and the drawing operation of the object are ended.
Therefore, by setting the end time, when the time of the dotted line attribute value of the adjustment object reaches the set end time, the adjustment operation of the dotted line attribute value and the drawing operation of the object are ended, thereby avoiding resource waste caused by continuous operation.
The application lists an application scenario for explanation.
As shown in fig. 1C, fig. 1C is a schematic diagram of an application example of the animation processing method shown in the present application. In this example, a trajectory line supported by Canvas may be drawn, the dashed attribute of the trajectory line is set to [0,1000], a completely empty trajectory line may be obtained, and then the real line length attribute value (i.e., the first parameter) of the trajectory line is adjusted up frame by frame, so that the animation effect as shown in the figure may be obtained. It can be understood that, for convenience of illustration, the drawing is not redrawn at the original position, but the drawn graphics are sequentially displayed on the same page, and in the actual operation process, the drawing application can be repeatedly drawn at the same position, so that the animation effect can be seen.
Corresponding to the embodiment of the animation processing method, the application also provides embodiments of an animation processing device and an electronic device.
The embodiment of the animation processing device can be applied to various electronic devices provided with the graphic processing tool, for example, the electronic devices can comprise mobile phones, tablet computers, computers and the like. The embodiments of the apparatus may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware level, as shown in fig. 2, a hardware structure diagram of an electronic device in which the animation processing apparatus 231 is located according to the present application is shown, in addition to the processor 210, the memory 230, the network interface 240, and the nonvolatile memory 220 shown in fig. 2, the electronic device in which the apparatus is located in the embodiment may further include other hardware generally according to the actual functions of the device, and one hardware is not shown in fig. 2.
Referring to fig. 3, a block diagram of an embodiment of an animation processing apparatus according to the present application:
the device includes: an initial value determination module 310 and an animation processing module 320.
An initial value determining module 310, configured to determine an initial value of a dashed line attribute of an object, where the object is a graph formed by at least one line, and the dashed line attribute includes a real line segment length attribute and a space length attribute between two solid line segments;
the animation processing module 320 is configured to successively adjust the dashed attribute value of the object according to the determined dashed attribute initial value and a preset adjustment policy; and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
In an alternative implementation, the initial value determining module 310 (not shown in fig. 3) includes:
the first initial value determining submodule is used for directly determining the current dotted line attribute value of the object as the initial value of the dotted line attribute of the object;
or the like, or, alternatively,
and the second initial value determining submodule is used for setting the initial value of the dotted line attribute of the object according to the received attribute setting instruction.
In an optional implementation manner, the second initial value determining sub-module includes:
the first initial value setting submodule is used for receiving an attribute setting instruction and setting a dotted line attribute initial value of the object according to a setting target value carried in the attribute setting instruction;
or the like, or, alternatively,
and the second initial value setting submodule is used for receiving the attribute setting instruction and setting the initial value of the dotted line attribute of the object according to a preset setting target value.
In an alternative implementation, in a case that the animation effect of the object is an effect of gradually displaying the object, an interval length attribute initial value of the broken line attribute initial values is greater than a real line segment length attribute initial value;
the animation processing module 320 includes at least one of the following sub-modules (not shown in fig. 3):
the first animation processing submodule is used for gradually increasing the real line segment length attribute value in the dotted line attribute value of the object according to a third preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and the second animation processing submodule is used for gradually reducing the interval length attribute value in the dotted line attribute value of the object by taking the determined interval length attribute initial value as a starting point according to a fourth preset amplitude value.
In an alternative implementation manner, in a case that the animation effect of the object is an effect of gradually disappearing the object, an interval length attribute initial value in the broken line attribute initial values is smaller than a real line segment length attribute initial value;
the animation processing module 320 includes at least one of the following sub-modules (not shown in fig. 3):
the third animation processing submodule is used for reducing the real line segment length attribute value in the dotted line attribute value of the object gradually by taking the determined real line segment length attribute initial value as a starting point according to a first preset amplitude value;
and the fourth animation processing submodule is used for gradually increasing the interval length attribute value in the dotted line attribute value of the object by taking the determined interval length attribute initial value as a starting point according to a second preset amplitude value.
In an optional implementation manner, the animation processing module 320 further includes:
the first end control submodule is used for ending the adjustment operation of the dotted line attribute value and the drawing operation of the object when the adjusted dotted line attribute value reaches a preset dotted line attribute end value;
or the like, or, alternatively,
and the second ending control submodule is used for ending the adjustment operation of the dotted line attribute value and the drawing operation of the object when the time for adjusting the dotted line attribute value of the object reaches the set ending time.
Based on this, the present application also provides an electronic device, comprising:
a processor; a memory for storing the processor-executable instructions;
wherein the processor is configured to:
determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments;
according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy;
and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (13)

1. A method for processing an animation, the method comprising:
determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments;
according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy, wherein the preset adjustment strategy is a preset strategy for adjusting the dotted line attribute value of the object so as to enable the object to have an animation effect;
and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
2. The method of claim 1, wherein determining an initial value of a dashed attribute of the object comprises:
directly determining the current dotted line attribute value of the object as the initial value of the dotted line attribute of the object;
or the like, or, alternatively,
and setting the initial value of the dotted line attribute of the object according to the received attribute setting instruction.
3. The method according to claim 2, wherein the setting of the initial value of the dotted attribute of the object according to the received attribute setting instruction comprises:
receiving an attribute setting instruction, and setting a dotted line attribute initial value of the object according to a setting target value carried in the attribute setting instruction;
or the like, or, alternatively,
and receiving an attribute setting instruction, and setting the initial value of the dotted line attribute of the object according to a preset setting target value.
4. The method according to claim 1, wherein in a case where the animation effect of the object is an effect of gradually displaying the object, the interval length attribute initial value of the broken line attribute initial values is larger than a real line segment length attribute initial value;
the step of successively adjusting the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy at least comprises one of the following steps:
successively increasing the real line segment length attribute value in the dotted line attribute value of the object according to a third preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and gradually reducing the interval length attribute value in the dotted line attribute value of the object according to a fourth preset amplitude value by taking the determined interval length attribute initial value as a starting point.
5. The method according to claim 1, wherein in a case where the animation effect of the object is an effect of fading out the object, the interval length attribute initial value of the broken line attribute initial values is smaller than the real line segment length attribute initial value;
the step of successively adjusting the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy at least comprises one of the following steps:
successively reducing the real line segment length attribute value in the dotted line attribute value of the object according to a first preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and gradually increasing the interval length attribute value in the dotted line attribute value of the object according to a second preset amplitude value by taking the determined interval length attribute initial value as a starting point.
6. The method according to any one of claims 1 to 5, further comprising:
when the adjusted dotted line attribute value reaches a preset dotted line attribute end value, ending the adjustment operation of the dotted line attribute value and the drawing operation of the object;
or the like, or, alternatively,
and when the time for adjusting the dotted-line attribute value of the object reaches the set end time, ending the adjustment operation of the dotted-line attribute value and the drawing operation of the object.
7. An animation processing apparatus, characterized in that the apparatus comprises:
the device comprises an initial value determining module, a judging module and a judging module, wherein the initial value determining module is used for determining an initial value of a dotted line attribute of an object, the object is a graph formed by at least one line, and the dotted line attribute comprises a real line segment length attribute and an interval length attribute between two solid line segments;
the animation processing module is used for carrying out successive adjustment on the dotted line attribute value of the object according to the determined dotted line attribute initial value and a preset adjustment strategy; and after each adjustment, redrawing the object according to the adjusted dotted line attribute value, wherein the preset adjustment strategy is a preset strategy for adjusting the dotted line attribute value of the object so as to enable the object to have an animation effect.
8. The apparatus of claim 7, wherein the initial value determining module comprises:
the first initial value determining submodule is used for directly determining the current dotted line attribute value of the object as the initial value of the dotted line attribute of the object;
or the like, or, alternatively,
and the second initial value determining submodule is used for setting the initial value of the dotted line attribute of the object according to the received attribute setting instruction.
9. The apparatus of claim 8, wherein the second initial value determination submodule comprises:
the first initial value setting submodule is used for receiving an attribute setting instruction and setting a dotted line attribute initial value of the object according to a setting target value carried in the attribute setting instruction;
or the like, or, alternatively,
and the second initial value setting submodule is used for receiving the attribute setting instruction and setting the initial value of the dotted line attribute of the object according to a preset setting target value.
10. The apparatus according to claim 7, wherein in a case where the animation effect of the object is an effect of gradually displaying the object, the interval length attribute initial value of the broken line attribute initial values is larger than the real line segment length attribute initial value;
the animation processing module at least comprises one of the following sub-modules:
the first animation processing submodule is used for gradually increasing the real line segment length attribute value in the dotted line attribute value of the object according to a third preset amplitude value by taking the determined real line segment length attribute initial value as a starting point;
and the second animation processing submodule is used for gradually reducing the interval length attribute value in the dotted line attribute value of the object by taking the determined interval length attribute initial value as a starting point according to a fourth preset amplitude value.
11. The apparatus according to claim 7, wherein in a case where the animation effect of the object is an effect of fading away the object, the interval length attribute initial value of the broken line attribute initial values is smaller than the real line segment length attribute initial value;
the animation processing module at least comprises one of the following sub-modules:
the third animation processing submodule is used for reducing the real line segment length attribute value in the dotted line attribute value of the object gradually by taking the determined real line segment length attribute initial value as a starting point according to a first preset amplitude value;
and the fourth animation processing submodule is used for gradually increasing the interval length attribute value in the dotted line attribute value of the object by taking the determined interval length attribute initial value as a starting point according to a second preset amplitude value.
12. The apparatus of any of claims 7 to 11, wherein the animation processing module further comprises:
the first end control submodule is used for ending the adjustment operation of the dotted line attribute value and the drawing operation of the object when the adjusted dotted line attribute value reaches a preset dotted line attribute end value;
or the like, or, alternatively,
and the second ending control submodule is used for ending the adjustment operation of the dotted line attribute value and the drawing operation of the object when the time for adjusting the dotted line attribute value of the object reaches the set ending time.
13. An electronic device, comprising:
a processor; a memory for storing the processor-executable instructions;
wherein the processor is configured to:
determining an initial value of a dotted line attribute of an object, wherein the object is a graph formed by at least one line, and the dotted line attribute comprises a solid line segment length attribute and a space length attribute between two solid line segments;
according to the determined initial value of the dotted line attribute, carrying out successive adjustment on the dotted line attribute value of the object according to a preset adjustment strategy, wherein the preset adjustment strategy is a preset strategy for adjusting the dotted line attribute value of the object so as to enable the object to have an animation effect;
and after each adjustment, redrawing the object according to the adjusted dotted line attribute value.
CN201610811737.0A 2016-09-08 2016-09-08 Animation processing method, device and equipment Active CN106960460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610811737.0A CN106960460B (en) 2016-09-08 2016-09-08 Animation processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610811737.0A CN106960460B (en) 2016-09-08 2016-09-08 Animation processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN106960460A CN106960460A (en) 2017-07-18
CN106960460B true CN106960460B (en) 2020-09-01

Family

ID=59481398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610811737.0A Active CN106960460B (en) 2016-09-08 2016-09-08 Animation processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN106960460B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107784679A (en) * 2017-11-09 2018-03-09 福建中金在线信息科技有限公司 A kind of dotted lines method and device
CN109086115B (en) * 2018-08-01 2021-09-07 武汉斗鱼网络科技有限公司 Android animation execution method, device, terminal and readable medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1725927A4 (en) * 2004-02-23 2007-12-26 Hillcrest Lab Inc Method of real-time incremental zooming
CN101593216A (en) * 2008-05-29 2009-12-02 复旦大学 A kind of mark ratio of graphing and method of line style ratio of changing
US9734618B2 (en) * 2013-11-25 2017-08-15 Autodesk, Inc. Animating sketches via kinetic textures
KR20150145774A (en) * 2014-06-19 2015-12-31 삼성전자주식회사 Electronic Apparatus and Method for Providing of Handwriting Animation

Also Published As

Publication number Publication date
CN106960460A (en) 2017-07-18

Similar Documents

Publication Publication Date Title
EP2840472B1 (en) Menu layout processing method and apparatus
JP6355746B2 (en) Image editing techniques for devices
CN109089043B (en) Shot image preprocessing method and device, storage medium and mobile terminal
CN106658139B (en) Focus control method and device
EP3128419A1 (en) Method and apparatus for uninstalling an application
CN102800045A (en) Image processing method and device
CN107357501B (en) Desktop wallpaper updating method and device and terminal
WO2021243788A1 (en) Screenshot method and apparatus
CN103076954B (en) The method of adjustment display effect and device
CN104808959B (en) Information processing method and electronic equipment
CN105573603A (en) Method and device for adjusting screen darkening time of terminal
CN106960460B (en) Animation processing method, device and equipment
CN105739936B (en) A kind of user terminal control method and user terminal
CN110858154B (en) Switching display method and device of carousel graphs, electronic equipment and storage medium
US20170039733A1 (en) Gui display method and apparatus, and terminal device
CN113867870A (en) Popup management system, popup control method, storage medium, and computer device
CN106155676B (en) Access control method and device for application program and terminal
CN112667343B (en) Interface adjustment method, device, equipment and storage medium
CN111443956B (en) Setting control display method and device, storage medium and electronic equipment
CN109766530B (en) Method and device for generating chart frame, storage medium and electronic equipment
CN111010528A (en) Video call method, mobile terminal and computer readable storage medium
CN105635832B (en) A kind of method for processing video frequency and device
CN111026481A (en) Desktop layout method, terminal and computer storage medium
CN110941413B (en) Display screen generation method and related device
CN108737879A (en) A kind of present column display methods, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.