WO2016188289A1 - 一种界面元素的绘制方法及装置 - Google Patents
一种界面元素的绘制方法及装置 Download PDFInfo
- Publication number
- WO2016188289A1 WO2016188289A1 PCT/CN2016/080306 CN2016080306W WO2016188289A1 WO 2016188289 A1 WO2016188289 A1 WO 2016188289A1 CN 2016080306 W CN2016080306 W CN 2016080306W WO 2016188289 A1 WO2016188289 A1 WO 2016188289A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- interface element
- focus
- target
- target location
- time
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
- H04N21/4312—Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/81—Monomedia components thereof
- H04N21/8146—Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics
Definitions
- the present application relates to the field of computer technology, and in particular, to a method and an apparatus for drawing interface elements.
- interface elements in the display interface may have a location tracking relationship with each other.
- the two interface elements of focus and focus frame as an example, there is a position tracking relationship between them.
- the focus frame moves to the current position of the focus, which means that the focus frame control draws the focus frame at the current position of the focus.
- the focus is under the control of the focus control, and the tracking moves to the current position of the focus frame, that is, the focus control draws the focus at the current position of the focus frame.
- the prior art implements location tracking as follows:
- the focus frame control draws at the target position according to the information of the acquired target position.
- the focus frame in order to achieve the purpose of the focus frame tracking focus to move.
- the problem with the above method is that there is a large lag at the moment when the focus frame moves to the target position relative to the time when the focus moves to the target position, and the existence of the large lag may cause the user to mistakenly think that the focus frame is not Move to the target position as desired, and the user will re-trigger the focus and the focus frame to move, which causes a misoperation, resulting in unnecessary waste of processing resources.
- the embodiment of the present application provides a method for drawing an interface element, which is used to solve the problem that the location tracking method of the interface element in the prior art is used, which may result in unnecessary processing resource waste.
- the embodiment of the present application further provides an apparatus for drawing an interface element, which is used to solve the problem that the location tracking method using the interface elements in the prior art may cause unnecessary processing resource waste.
- a method of drawing interface elements including:
- a drawing device for an interface element comprising:
- a motion trend information acquiring unit configured to acquire information that characterizes a motion trend of the first interface element
- a target location prediction unit configured to predict, according to the information, a target location to which the first interface element is to be moved
- a drawing unit configured to The second interface element is drawn by the second interface element drawing position determined by the target position.
- the target position to which the first interface element is to be moved can be predicted, and the second interface element is drawn according to the target position, the second interface element is not drawn after the first interface element moves to the target position, thereby reducing the The hysteresis of the movement of the second interface element avoids unnecessary waste of processing resources due to repeated movement operations of the user.
- FIG. 1 is a schematic flowchart of a specific implementation process of a method for drawing an interface element according to an embodiment of the present application
- FIG. 1a is a schematic diagram of a time axis according to an embodiment of the present application.
- FIG. 1b is a schematic diagram of a focus of a digital television screen interface and a positional relationship of a focus frame according to an embodiment of the present application;
- 1c is a schematic diagram of a focus of a digital television screen interface and a positional relationship of a focus frame according to an embodiment of the present application;
- FIG. 1 is a schematic structural diagram of a drawing component of an interface element according to an embodiment of the present application
- FIG. 2 is a schematic flowchart of a specific implementation process of a method for drawing a focus or a focus frame in a digital television according to an embodiment of the present disclosure
- FIG. 3 is a schematic structural diagram of a device for drawing an interface element according to an embodiment of the present application.
- the embodiment of the present application provides a method for drawing an interface element, which is used to solve the lag problem that occurs when the interface element is moved in the prior art.
- the schematic diagram of the specific implementation process of the method is shown in FIG. 1 and mainly includes the following steps:
- Step 11 Obtain information that characterizes a motion trend of the first interface element
- the first interface element is an interface element that moves relative to the two interface elements that have a location tracking relationship.
- acquiring information indicating a trend of movement of the first interface element includes: acquiring at least two position parameters of the first interface element, and when the first interface element is located at a position respectively indicated by the two position parameters Determining, according to the at least two position parameters, a moving direction of the first interface element; determining, according to the at least two position parameters, and a time when the first interface element is located at the position respectively indicated by the two position parameters The speed at which the first interface element moves.
- the positional parameter of the first interface element is (0, 11), and at time T2 after 5s, the position of the first interface element is The number is (0, 20), so that according to the two position parameters, it can be determined that the moving direction of the first interface element is moving in the vertical direction (such as along the Y axis of the vertical coordinate axis).
- the motion speed of the focus can be calculated as (20-10)/10; or, when the first interface element moves at a uniform speed according to the default speed set by the system, the motion of the first interface element Speed information can be obtained from the system settings information.
- the location parameter refers to any information that can indicate the location of the interface element, such as a coordinate value and the like.
- the manner of obtaining information indicating the trend of the movement of the first interface element may include at least the following two types:
- Manner 1 According to the preset position parameter sampling period, information for characterizing the movement trend of the first interface element is obtained.
- the system will automatically acquire the coordinate value of the position where the focus is in the screen coordinate system every 30 ms, as the first interface.
- the positional parameter of the element, and according to the positional parameter of the first interface element, information for characterizing the motion trend of the first interface element is obtained.
- the location parameter of the sampled first interface element needs to be at least two in order to obtain the motion direction information of the first interface element.
- Manner 2 After receiving the first interface element position change triggering instruction, obtaining information indicating a trend of the first interface element motion.
- the position of the focus in the screen coordinate system can be obtained. Further, according to the preset position parameter sampling period, the position parameter of the focus during the movement process is acquired; and the motion trend information of the focus is obtained through the acquired position parameters.
- the manner of obtaining the motion trend information of the focus according to the position parameter may be referred to. As mentioned above, it will not be repeated here.
- the embodiment of the present application provides a method for timing sampling.
- the method specifically includes:
- the system timer is set, and the first interface element position parameter is sampled whenever the timing time of the system timer reaches the sampling time determined according to the sampling period. For example, if it is necessary to acquire the position parameter of the focus every 30 ms, the time of setting the system timer is 30 ms, and then the position parameter of the focus point is sampled every 30 ms according to the time of the system timer.
- Step 12 predict, according to information indicating a trend of motion of the first interface element, a target location to which the first interface element is to be moved;
- step 12 may include: according to the drawing period of the display interface, the moving speed, and The direction of movement, predicting the target location to which the first interface element will be moved.
- the drawing period of the display interface that is, the drawing period of the display interface that is followed when the interface (such as the interface including the first interface element and the second interface element) is drawn, and the drawing period of the display interface may be 30 ms, 40 ms, and many more.
- the drawing period of the display interface is 30ms, one frame interface is drawn every 30ms.
- the specific size of the drawing period of the display interface is not limited.
- the interface of the first interface element in the N+1th frame or the N+2 frame may be predicted according to the drawing period of the display interface of 30 ms and the acquired information indicating the motion trend of the first interface element.
- the target position to be moved to when being drawn may be predicted according to the drawing period of the display interface of 30 ms and the acquired information indicating the motion trend of the first interface element.
- the drawing period of the display interface is 30 ms, and the information indicating the motion trend of the first interface element includes motion.
- the direction is to the right in the horizontal direction and the moving speed is 5/30ms, then It is predicted that the first interface element is at the target position of (15, 0) when the interface of the N+1th frame is drawn.
- 10 of the above (10, 0), 5 of the motion speed expression 5/30 ms, and 15 of the above (15, 0) may each be a unit length in the interface coordinate system.
- the embodiment of the present application provides an estimation algorithm, where the algorithm This can be done by moving the distance estimator by the first interface element.
- the evaluator can be used to complete step 11 in addition to the step 12 being completed.
- the estimator can calculate the moving speed of the first interface element according to the obtained positional parameter of the first interface element, and determine the moving direction of the first interface element; and further predict the first according to the instantaneous speed and the moving direction. The target location to which the interface element will be moved.
- the focus is displayed on the interface of the smart TV
- the smart TV draws a frame display interface with a drawing period of 30 ms;
- the smart TV receives the focus movement command, that is, the focus starts to move at time T0;
- the position parameter of the focus at time T0 is (x0, y1);
- sampling period is the same as the drawing period of the display interface, which is 30 ms.
- the estimator can acquire the position parameter (x0, y1) of the focus at time T0, and acquire the position parameter of the focus at time T1 (x1). , y1);
- the position parameter (x2, y1) of the focus is obtained at time T2.
- the time interval between T0 and T1 and the interval between T1 and T2 is a drawing period, that is, 30 ms.
- expectedDistanceX focusViewMovingVelocityX ⁇ (T2-T0). That is, how much distance the predicted focus moves at the upcoming T2 relative to the position at T0.
- the information of the movement tendency of the focus can be determined as the X-axis along the horizontal direction.
- the target position to which the focus is to be moved at the time T2 can be predicted, that is, the positional parameter after the focus moves in the horizontal direction X axis is ( X0+expectedDistanceX, y1).
- the position parameter at time t0 is (0, 9)
- the sampling period is preset according to the preset focus position parameter
- the focus is acquired at time t1.
- the position parameter is (0, 12)
- it can be determined that the moving direction of the focus is moving in the Y-axis direction in the vertical direction; and at the same time, the position of the focus is from t0 to t1 according to the positional parameters of the focus at time t0 and time t1.
- the time interval between t2 and t1 is 30 ms of the system preset sampling period
- the focus can be calculated to move at time t2.
- step 13 the second interface element is drawn according to the target position.
- Case 1 When the first interface element moves to the target position, the second interface is drawn according to the target position element.
- the first interface element reaches the target position at time T1 (ie, a specific time as mentioned above), at time T1, the second interface element is drawn according to the target position.
- a display interface including the first interface element and the second interface element is drawn; 2.
- the function obtained by performing step 11 is used to represent the movement trend of the first interface element.
- the information is: the position parameters of the first interface element in the first frame display interface and the second frame display interface respectively; 3.
- the first interface element is currently in the second frame display interface.
- the time at which the second interface element is drawn according to the target position may be a time at which the third frame display interface is drawn, that is, a time later than the drawing time of the second frame display interface by 30 ms.
- Case 2 At the time before the first interface element moves to the target position, the second interface element is drawn according to the target position.
- the first interface element starts moving at time T0 and reaches the target position at time T1, and then the second interface can be drawn according to the target position at a certain time before the time T1, that is, at a certain time before the time T1 (that is, the specific time mentioned above). element.
- the second interface element is drawn according to the determined target location, and specifically includes the following two implementation manners:
- Implementation 1 Determine a first drawing position according to a target position and a set distance threshold; and at the specific time, draw a second interface element according to the target position.
- the current position of the element when the distance between the target position and the position represented by the current position parameter of the second interface element (hereinafter referred to as the current position of the element) is less than the set distance threshold, the current position of the element may be determined. A position is drawn for the second interface element; such that at the particular moment, the current position of the element is taken as the first drawing position and the second interface element is drawn at the location. In particular, it is possible for the target position to coincide with the current position of the element, ie the above distance is zero.
- the target position When the distance between the target position and the current position of the element is not less than the set distance threshold, the target position may be determined as the second interface element drawing position; thus, at a specific moment, the second interface element is drawn at the target position.
- the embodiment of the present application provides an estimation algorithm, and the algorithm may be moved by the second interface element distance estimator.
- the specific algorithm is as follows:
- Embodiment 2 determining, according to the target location, whether the first interface element moves outside the display area currently occupied by the second interface element when the first interface element moves to the target location; determining the second interface element according to the determination result Drawing a position; and drawing a second interface element at a second interface element drawing position at a time when the first interface element moves to the target position.
- the target position is determined as the second interface element drawing position;
- the location of the display area currently occupied by the second interface element is determined. Draw a position for the second interface element.
- the first interface element is the focus and the second interface element is the focus frame. It is assumed that in the initial state, on the screen as shown in FIG. 1b, the focus and the focus frame are all in the same position, wherein the display area currently occupied by the focus frame is the gray area in the figure.
- the focus moves to the position shown in Figure 1c, due to the position of the focus If it does not move to the gray area shown in FIG. 1c, then the position of the gray area is determined as the second interface element drawing position.
- the manner of drawing the second interface element at the time when the first interface element moves to the target location may include: the second interface element according to the moment when the first interface element moves to the target location Draw the features of the third interface element of the position and draw the second interface element.
- drawing the second interface element according to the feature of the third interface element may mean that the second interface element is drawn according to the way that the second interface element has the feature; or the second interface element is not The second interface element is drawn in a manner that has this feature.
- the focus frame is drawn into a rectangle according to the shape feature of the poster B when the focus frame is drawn at the target position where the focus is reached.
- the features of the third interface element include: shape, color, size, animation effect, and the like.
- the above method may be completed by a drawing component of an interface element as shown in FIG. 1d, and the drawing component of the interface element specifically includes the following modules: a motion trend information acquiring module, a target position prediction module, a drawing module, a system timer, and a core calculation.
- Module including a first interface element moving distance estimator and a second interface element moving distance estimator.
- the above step 11 can be completed by the motion trend information acquisition module.
- the target position to which the first interface element is to be moved in step 12 may be predicted by the target position prediction module according to the parameter calculated by the first interface element moving distance estimator.
- the function implementation manner of the first interface element moving distance estimator is as described above, and is not described here.
- the system timer can set a fixed time interval as the sampling period, so that the position parameter obtaining module can sample the position parameter of the first interface element according to the time interval set by the system timer.
- the second interface element moves the distance estimator for determining the second interface element drawing position according to the target position and the set distance threshold.
- the function realization manner of the second interface element moving distance estimator is as described above, and will not be described here.
- the drawing module may draw the first interface element according to the predicted first interface element to be moved to the target position; and draw the position according to the determined second interface element to draw the second interface element.
- the method can predict the target location to which the first interface element is to be moved by calculating the information of the motion trend of the first interface element, and then can be based on the target location at a specific moment.
- Drawing the second interface element reduces the lag of the movement of the second interface element, thereby avoiding the repeated movement of the user, reducing the occupation of system resources and improving the operating efficiency of the system.
- the execution bodies of the steps of the method provided in Embodiment 1 may all be the same device, or the method may also be performed by different devices.
- the execution body of step 11 and step 12 may be a first interface element control
- the execution body of step 13 may be a second interface element control;
- the execution body of step 11 may be a first interface element control
- step 12 and The execution body of step 13 may be a second interface element control;
- the execution bodies of steps 11 to 13 may each be a second interface element control;
- the embodiment of the present invention provides a method for drawing a focus or a focus frame in a digital television, which is used to solve the lag problem that occurs when the focus or the focus frame is moved in the prior art.
- the schematic diagram of the specific implementation process of the method is shown in FIG. 2, and mainly includes the following steps:
- Step 21 The digital television set top box acquires motion trend information of the first interface element
- the motion trend information of the focus is obtained by using the position parameter of the focus at different times, including: acquiring at least two position parameters of the focus, and the focus is located at the two positions. The time at which the parameter represents the position; according to the at least two bits Setting a parameter to determine a moving direction of the focus; determining a moving speed of the focus according to the at least two positional parameters and a time when the focus is at a position respectively indicated by the two positional parameters.
- the information on the movement trend of the focus is obtained, including the following two methods:
- Step 22 predict, according to the motion trend information of the acquired focus, a target position to which the focus is to be moved;
- step 22 may include: The target position to which the focus is to be moved is predicted according to the drawing period of the display interface, the moving speed, and the moving direction.
- the digital television draws a display interface of each frame with a drawing period of 30 ms;
- the focus moves along the horizontal X axis
- the digital television receives the focus movement command, that is, the focus starts to move at time T0;
- the position parameter of the focus at time T0 is (x0, y1).
- sampling period is the same as the drawing period of the display interface, which is 30 ms.
- the position parameter of the focus acquired at time t2 is (x2, y1).
- the prediction of the target position to which the focus is to be moved includes the following sub-steps:
- Sub-step 4 according to the position parameter of the focus acquired at time t1 and time t2, the moving direction of the focus can be obtained as the x-axis in the horizontal direction.
- Sub-step 5 according to the moving direction of the acquired focus and the moving distance in a certain time, it can be predicted that the focus will be moved to reach the target position, that is, the focus moves in the horizontal direction X-axis to reach the target position.
- the positional parameter is (x2+expectedDistanceX, y1).
- Step 23 Draw a focus frame according to the target position.
- the determined second interface element drawing position is the current position of the focus frame.
- the parameter of the target position at which the first interface element moves to the target position is (x3, y3), and the position is still in focus.
- the current position of the focus frame is redrawn to the focus frame.
- the size, color, shape and the like of the TV poster A and the TV poster B may be different, in order to be in the TV poster B.
- the size, the color, the shape, and the like of the focus frame are matched with the features of the TV poster B.
- the embodiment of the present application provides a method for the third interface element where the focus is located when the focus is moved to the target position (ie, The focus frame is drawn by the feature of the third interface element at the position when the focus moves to the target position.
- the focus frame is drawn in the target area.
- you draw the focus frame into a triangle when you draw the focus frame into a triangle.
- the method can predict the target position to which the focus (or the focus frame) is to be moved by calculating the motion trend information of the focus (or the focus frame), and thus can be at the target position.
- the focus frame (or focal point) is drawn, which reduces the hysteresis of the movement of the second interface element, thereby avoiding unnecessary processing resource waste caused by the repeated movement operation of the user, and improving the operating efficiency of the system.
- the embodiment of the present application provides a device for drawing an interface element, which is used to solve the lag problem that occurs when the interface element is moved in the prior art.
- a schematic diagram of a specific implementation flow of the device is shown in FIG. 4, and mainly includes a motion trend information acquiring unit 31, a target position predicting unit 32, and a drawing unit 33.
- the motion trend information acquiring unit is configured to obtain information that represents a trend of motion of the first interface element
- a target location prediction unit configured to predict, according to the information, a target location to which the first interface element is to be moved
- a drawing unit configured to draw the second interface element at the second interface element drawing position determined according to the target position.
- the drawing unit is configured to: at a specific moment, draw the second interface element according to the target location.
- the specific moment is no later than the moment when the first interface element moves to the target location.
- the drawing unit is configured to: determine a first drawing position according to the target position and the set distance threshold; and draw a second interface element at the first drawing position at the specific moment; or Determining, according to the target location, whether the first interface element moves outside the display area currently occupied by the second interface element at the specific moment; determining a second drawing position according to the determination result; and at the specific moment, in the second Draw the position to draw the second interface element.
- the drawing unit is configured to: when the distance between the target location and the location represented by the current location parameter of the second interface element is less than the set distance threshold, move the element in the first interface to At a time of the target position, drawing a second interface element at a position indicated by a current position parameter of the second interface element; a distance between the target position and a position indicated by a current position parameter of the second interface element is not less than At a fixed distance threshold, a second interface element is drawn at the target location at a time when the first interface element moves to the target location.
- the drawing unit is configured to: move the first interface element when the distance between the target location and the location of the current location parameter of the second interface element is not less than a set distance threshold At the time of the target location, a second interface element is drawn at the target location.
- the drawing unit is configured to: acquire a feature of the third interface element at the target position at the specific time; and draw a second interface element according to the feature.
- the features include at least one of the following: color, size, animation effect, shape, and the like.
- the motion trend information acquiring unit is configured to: after receiving the first interface element position change triggering instruction, acquire information indicating a motion trend of the first interface element; or according to a preset position parameter sampling period, Obtain information that characterizes the movement trend of the first interface element.
- the motion trend information acquiring unit is configured to: obtain information that characterizes a motion trend of the first interface element according to a preset position parameter sampling period.
- the information characterizing the motion trend of the first interface element includes: a moving speed and a moving direction of the first interface element.
- the motion trend information acquiring unit is configured to: acquire at least two position parameters of the first interface element, and a time when the first interface element is located at the position respectively indicated by the two position parameters; Determining a moving direction of the first interface element according to the at least two position parameters; determining the first interface element according to the at least two position parameters and a time when the first interface element is located at the position respectively indicated by the two position parameters The speed of movement.
- the target location prediction unit is configured to: according to a drawing period of the display interface, The moving speed and the moving direction predict a target position to which the first interface element is to be moved.
- the target position prediction unit calculates the motion trend information of the first interface element
- the target position to which the first interface element is to be moved can be predicted, and then the first interface element can be
- the second interface element is drawn at the target position, which reduces the lag of the movement of the second interface element, thereby avoiding the use of repeated movement of the user, reducing the occupation of system resources, and improving The operating efficiency of the system.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
- embodiments of the present application can be provided as a method, system, or computer program product.
- the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
- the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请公开了一种界面元素的绘制方法,用于解决采用现有技术中的界面元素的位置追踪方法,会导致不必要的处理资源浪费的问题。方法包括:获取表征第一界面元素运动趋势的信息;根据所述信息,预测第一界面元素将要移动到的目标位置;根据所述目标位置绘制第二界面元素。本申请还公开一种界面元素的绘制装置。
Description
本申请涉及计算机技术领域,尤其涉及一种界面元素的绘制方法及装置。
目前,显示界面中的界面元素彼此之间可能存在位置追踪关系。以焦点和焦点框这两种界面元素为例,它们之间就存在位置追踪关系。具体而言,有可能是焦点发生移动后,焦点框在焦点框控件的控制下,追踪移动到焦点当前所在位置。其中,焦点框移动到焦点当前所在位置,是指焦点框控件在焦点当前所在位置绘制焦点框。又或者,是焦点框发生移动后,焦点在焦点控件的控制下,追踪移动到焦点框当前所在位置,即焦点控件在焦点框当前所在位置绘制焦点。
以焦点框追踪焦点为例,现有技术实现位置追踪的方式如下:
当焦点从原位置移动到目标位置后,获取目标位置的信息(一般为基于显示界面建立的屏幕坐标系中的坐标值);焦点框控件根据获取到的目标位置的信息,在该目标位置绘制焦点框,从而达到焦点框追踪焦点进行移动的目的。
上述方法存在的问题在于,相对于焦点移动到目标位置的时刻,焦点框移动到该目标位置的时刻会存在较大的滞后,该较大的滞后的存在,可能导致用户误以为焦点框并没有按照期望移动到目标位置,进而用户会重新触发焦点及焦点框进行移动,这就产生了误操作,导致了不必要的处理资源浪费。
发明内容
本申请实施例提供一种界面元素的绘制方法,用于解决采用现有技术中的界面元素的位置追踪方法,会导致不必要的处理资源浪费的问题。
本申请实施例还提供一种界面元素的绘制的装置,用于解决采用现有技术中的界面元素的位置追踪方法,会导致不必要的处理资源浪费的问题。
本申请实施例采用下述技术方案:
一种界面元素的绘制方法,包括:
获取表征第一界面元素运动趋势的信息;根据所述信息,预测第一界面元素将要移动到的目标位置;根据所述目标位置绘制第二界面元素。
一种界面元素的绘制装置,包括:
运动趋势信息获取单元,用于获取表征第一界面元素运动趋势的信息;目标位置预测单元,用于根据所述信息,预测第一界面元素将要移动到的目标位置;绘制单元,用于在根据所述目标位置确定出的第二界面元素绘制位置绘制第二界面元素。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:
由于可以预测出第一界面元素将要移动到的目标位置,并根据目标位置绘制第二界面元素,避免了在第一界面元素移动到目标位置后,才进行第二界面元素的绘制,从而降低了第二界面元素移动的滞后性,避免了因为用户的重复移动操作而导致的不必要的处理资源浪费。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例提供的一种界面元素的绘制方法的具体实现流程示意图;
图1a为本申请实施例所述的时间轴的示意图;
图1b为本申请实施例提供的一种数字电视屏幕界面的焦点及焦点框位置关系示意图;
图1c为本申请实施例提供的一种数字电视屏幕界面的焦点及焦点框位置关系示意图;
图1d为本申请实施例提供的一种界面元素的绘制组件的具体结构示意图;
图2为本申请实施例提供的一种数字电视中焦点或焦点框的绘制方法的具体实现流程示意图;
图3为本申请实施例提供的一种界面元素的绘制装置的具体结构示意图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图,详细说明本申请各实施例提供的技术方案。
实施例1
本申请实施例提供一种界面元素的绘制方法,用于解决现有技术中对界面元素进行移动时出现的滞后问题。该方法的具体实现流程示意图如图1所示,主要包括下述步骤:
步骤11,获取表征第一界面元素运动趋势的信息;
其中,第一界面元素,为存在位置追踪关系的两个界面元素中,相对而言先进行移动的界面元素。
在一种实施方式中,获取表征第一界面元素运动趋势的信息,包括:获取第一界面元素的至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻;根据所述至少两个位置参数,确定第一界面元素的移动方向;根据所述至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻,确定第一界面元素的移动速度。
例如,若假设第一界面元素从T1时刻开始发生移动,且在T1时刻,第一界面元素的位置参数为(0,11),在5s后的T2时刻,第一界面元素的位置参
数为(0,20),从而根据这两个位置参数,可以确定出第一界面元素的运动方向为沿垂直方向(如沿垂直坐标轴Y轴)移动。
例如,假设按照10ms的采样频率对焦点的位置参数进行采样,获取到焦点在t1时刻的位置参数为(0,10),焦点在t2时刻的位置参数为(0,20),t1时刻与t2时刻之间的时间间隔为10ms,则可以计算出焦点的运动速度为(20-10)/10;或者,当第一界面元素按照系统设定的默认速度匀速运动时,第一界面元素的运动速度信息可从系统设置信息中获取。
本申请实施例中,位置参数,是指任何可以表示界面元素所处位置的信息,该信息比如是坐标值等。
本申请实施例中,获取表征第一界面元素运动趋势的信息的方式至少可以包括以下两种:
方式一:按照预设的位置参数采样周期,获取表征第一界面元素运动趋势的信息。
比如,以第一界面元素为焦点为例,预设的位置参数采样周期若为30ms,则系统将每隔30ms自动获取焦点此时在屏幕坐标系中所处位置的坐标值,作为第一界面元素的位置参数,并根据第一界面元素的位置参数,获取表征第一界面元素运动趋势的信息。其中,为了获取第一界面元素的运动方向信息,采样得到的第一界面元素的位置参数至少需要两个。
方式二:在收到第一界面元素位置变化触发指令后,获取表征第一界面元素运动趋势的信息。
比如,以第一界面元素为数字电视屏幕焦点为例,假设用户通过遥控器输入了焦点位置调整指令,则在该数字电视在接收到该指令后,可以获取焦点当前在屏幕坐标系中的位置参数;进一步地,按照预设的位置参数采样周期,获取焦点在发生移动过程中的位置参数;并通过获取到的各位置参数,获取焦点的运动趋势信息。
方式一和方式二中根据位置参数获取焦点的运动趋势信息的方式可以参
照前文,此处不再赘述。
在一种实施方式中,为了保证能够按照设定的时间间隔对位置参数进行采样,本申请实施例提供一种定时采样的方式。该方式具体包括:
按照采样周期,设置系统定时器,每当系统定时器的计时时间到达按照采样周期确定出的采样时刻时,对第一界面元素位置参数进行采样。例如,假设需要每30ms获取一次焦点的位置参数,则设置系统定时器的时间为30ms,进而将按系统定时器的计时时间,每隔30ms对焦点的位置参数进行采样。
步骤12,根据表征第一界面元素运动趋势的信息,预测第一界面元素将要移动到的目标位置;
在一种实施方式中,若第一界面元素运动趋势的信息包括第一界面元素的移动速度和移动方向,那么步骤12的具体实现方式可以包括:根据显示界面的绘制周期、所述移动速度和移动方向,预测第一界面元素将要移动到的目标位置。
上述显示界面的绘制周期,即在对界面(比如包含第一界面元素和第二界面元素的界面)进行绘制时所遵循的显示界面的绘制周期,该显示界面的绘制周期可以为30ms、40ms,等等。当显示界面的绘制周期为30ms时,会每隔30ms进行一帧界面的绘制。本申请实施例中,对该显示界面的绘制周期的具体大小不做限定。
本申请实施例中,若假设在对第一界面元素将要移动到的目标位置进行预测时,第一界面元素当前处于被绘制的第N帧界面中,并且,显示界面的绘制周期为30ms,那么,在步骤12中,就可以根据该显示界面的绘制周期30ms,和获取到的表征第一界面元素运动趋势的信息,预测第一界面元素在第N+1帧或第N+2帧等界面被绘制时将要移动到的目标位置。
比如,若第一界面元素的中心点当前处于被绘制的第N帧界面中的(10,0)这一位置,显示界面的绘制周期为30ms,表征第一界面元素的运动趋势的信息包括运动方向为沿水平方向向右以及运动速度为5/30ms时,那么,可以
预测出第一界面元素在第N+1帧界面被绘制时,处于(15,0)这一目标位置。其中,上述(10,0)中的10、运动速度表达式5/30ms中的5,以及上述(15,0)中的15,均可以为界面坐标系中的单位长度。
需要说明的是,在一种实施方式中,为了根据获取到的第一界面元素运动趋势的信息预测第一界面元素将要移动到的目标位置,本申请实施例提供一种估值算法,该算法可以由第一界面元素移动距离估值器完成。
需要说明的是,该估值器除了可以用于完成步骤12外,还可以用于完成步骤11。比如,该估值器可以根据获取到的第一界面元素的位置参数,计算第一界面元素的移动速度,并确定出第一界面元素的移动方向;进而根据瞬时速度、移动方向,预测第一界面元素将要移动到的目标位置。
以第一界面元素为焦点为例,若下述假设成立:
1、该焦点显示在智能电视的界面上;
2、该智能电视以30ms的绘制周期,绘制各帧显示界面;
3、焦点沿水平方向X轴进行移动;
4、在T0时刻,智能电视接收到焦点移动指令,即焦点在T0时刻开始移动;
5、焦点在T0时刻的位置参数为(x0,y1);
6、按照系统设定的采样周期,对焦点的位置参数进行采样。其中,该采样周期与显示界面的绘制周期相同,为30ms。
那么,该估值器完成上述计算过程的步骤如下:
一、如图1a所示,假设焦点在T0时刻开始以移动,那么,该估值器可以在T0时刻获取到焦点的位置参数(x0,y1),在T1时刻获取到焦点的位置参数(x1,y1);在T2时刻获取到焦点的位置参数(x2,y1)。
其中,T0时刻与T1时刻,T1与T2之间的时间间隔为绘制周期,即30ms。
二、该估值器根据T0时刻获取到的焦点的位置参数(x0,y1)和T1时刻获取到的焦点的位置参数(x1,y1),计算焦点移动前后的水平坐标差:
totalDistanceX=x1-x0。
三、根据totalDistanceX、焦点处于(x1,y1)的时刻T1,以及焦点处于(x0,y1)的时刻T0,计算焦点的移动速度:focusViewMovingVelocityX=totalDistanceX÷(T1-T0)。
四、根据移动速度以及T2,计算焦点从T0至T2的移动距离:expectedDistanceX=focusViewMovingVelocityX×(T2-T0)。即,预测焦点在即将到来的T2,相对于T0时所处位置移动了多少距离。
五、根据T0时刻焦点的位置参数(x0,y1),T1时刻焦点的位置参数(x1,y1),可以确定出焦点的运动趋势的信息为沿水平方向X轴。
六、根据确定出的焦点的运动趋势的信息以及计算出的expectedDistanceX,可预测出焦点在T2这一时刻将要移动到的目标位置,即,焦点在沿水平方向X轴移动后的位置参数为(x0+expectedDistanceX,y1)。
基于上述估值器的计算原理,比如,假设焦点在t0时刻开始发生移动,其t0时刻的位置参数为(0,9),若按照预设的焦点位置参数采样周期,获取到焦点在t1时刻的位置参数为(0,12),则可以确定焦点的移动方向为沿垂直方向Y轴方向移动;同时根据焦点在t0时刻以及t1时刻的位置参数可以计算出焦点在t0到t1的这段时间内的移动距离为:(12-9)=3,时间间隔为:t1-t0=30ms。则根据移动距离以及时间间隔,可计算出焦点的移动速度:3÷30=0.1。假设需要预测焦点在t2时刻(t2与t1的时间间隔为系统预设的采样周期30ms)到达的目标位置的参数,则根据焦点的移动方向和焦点的移动速度,可以计算出焦点在t2时刻移动的距离为:瞬时速度×(t2-t1)=0.1×30=3;则焦点在t2时刻到达的目标位置的位置参数为(0,15)。
步骤13,根据目标位置绘制第二界面元素。
本申请实施例中,根据所述目标位置绘制第二界面元素的时刻,可能会有下述三种情况:
情况1:在第一界面元素运动到目标位置时,根据目标位置绘制第二界面
元素。
例如,假设第一界面元素在T1时刻(即前文所说的特定时刻)到达目标位置,则在T1时刻,根据目标位置绘制第二界面元素。
举例而言,若假设:1、按照30ms的绘制周期,绘制包含第一界面元素和第二界面元素的显示界面;2、通过执行步骤11获取到的、用于表征第一界面元素运动趋势的信息为:第一界面元素分别在绘制的第一帧显示界面和第二帧显示界面中的位置参数;3、第一界面元素当前处于第二帧显示界面。那么,根据所述目标位置绘制第二界面元素的时刻,可以为绘制第三帧显示界面的时刻,即晚于第二帧显示界面的绘制时刻30ms的时刻。
情况2:在第一界面元素运动到目标位置之前的时刻,根据目标位置绘制第二界面元素。
假设,第一界面元素在T0时刻开始移动,在T1时刻到达目标位置,则可以在T0时刻之后,T1时刻之前的某个时刻(即前文所说的特定时刻),根据目标位置绘制第二界面元素。
情况3:在第一界面元素运动到目标位置的时刻后的设定时长内(该时刻后的设定时长内的任一时刻,均可以视为前文所说的特定时刻),根据目标位置绘制第二界面元素。其中,该设定时长,应满足:不会使得用户在视觉上,感受到第二界面元素的绘制时刻明显滞后于第一界面元素的绘制时刻。
假设,第一界面元素在T1时刻到达目标位置,则最晚在T1+ΔT时刻,绘制第二界面元素。其中,[0,ΔT]为上述设定时长。
本申请实施例中,根据确定出的目标位置绘制第二界面元素,具体可以包括以下两种实现方式:
实现方式1:根据目标位置和设定的距离阈值,确定第一绘制位置;并在所述特定时刻,根据目标位置绘制第二界面元素。
具体地,在目标位置与第二界面元素当前的位置参数表示的位置(后简称元素当前位置)之间的距离小于设定的距离阈值时,可以将元素当前位置确定
为第二界面元素绘制位置;从而在所述特定时刻,将元素当前位置作为第一绘制位置,并在该位置绘制第二界面元素。特别地,目标位置有可能与元素当前位置重合,即上述距离为0。
在目标位置与元素当前位置之间的距离不小于设定的距离阈值时,可以将目标位置确定为第二界面元素绘制位置;从而在特定时刻,在目标位置绘制第二界面元素。
在一种实施方式中,为了根据目标位置和设定的距离阈值,确定第二界面元素绘制位置,本申请实施例提供一种估值算法,该算法可以由第二界面元素移动距离估值器完成,具体的算法如下:
1、totalDistanceX!=0&&ViewMovingDistanceX==0;
2、expectedDistanceX>0.45*totalDistanceX(其中0.45为动态可调配的参数),并且focusViewAccmulateDistanceX<expectedDistanceX)。
其中各个参数的具体算法同上文所述,此处不再赘述。
实现方式2:根据目标位置,判断第一界面元素在第一界面元素移动到所述目标位置的时刻,是否移动到了第二界面元素当前占据的显示区域外;根据判断结果,确定第二界面元素绘制位置;并在第一界面元素移动到所述目标位置的时刻,在第二界面元素绘制位置绘制第二界面元素。
具体地,当判断结果为第一界面元素在第一界面元素移动到所述目标位置的时刻移动到了第二界面元素当前占据的显示区域外,则将目标位置确定为第二界面元素绘制位置;当判断结果为第一界面元素在第一界面元素移动到所述目标位置的时刻没有移动到第二界面元素当前占据的显示区域外,则将第二界面元素当前占据的显示区域所在位置,确定为第二界面元素绘制位置。
例如,以数字电视为例,假设第一界面元素为焦点,第二界面元素为焦点框。假设初始状态下,如图1b所示的屏幕上,焦点及焦点框均处在相同的位置,其中,焦点框当前占据的显示区域为图中的灰色区域。当用户通过遥控器对焦点进行了移动,使得焦点移动到如图1c所示的位置后,由于焦点的位置
没有移动到图1c所示的灰色区域外,则此时将灰色区域所在位置确定为第二界面元素绘制位置。
在一种实施方式中,在第一界面元素移动到所述目标位置的时刻对第二界面元素进行绘制的方式可以包括:根据第一界面元素移动到所述目标位置的时刻处于第二界面元素绘制位置的第三界面元素的特征,绘制第二界面元素。
具体而言,根据该第三界面元素的特征绘制第二界面元素,可以是指按照使第二界面元素具备该特征的方式,绘制第二界面元素;也可以是指按照使第二界面元素不具备该特征的方式,绘制第二界面元素。
例如,以数字电视机切换选定的电视剧海报为例,若焦点从电视剧海报A(其中电视剧海报A为正方形)移动到电视剧海报B(其中电视剧海报B为长方形,且该电视剧海报B所在位置为确定出的目标位置),则在焦点到达的目标位置绘制焦点框时,将按照海报B的形状特征,将焦点框绘制成长方形。
需要说明的是,第三界面元素的特征包括:形状、颜色、尺寸、动画效果等。
上述方法可以由如图1d所示的一种界面元素的绘制组件完成,该界面元素的绘制组件具体包括以下模块:运动趋势信息获取模块、目标位置预测模块、绘制模块、系统定时器以及核心计算模块(包括第一界面元素移动距离估值器和第二界面元素移动距离估值器)。
以下介绍上述各模块的功能。
上述步骤11可以由运动趋势信息获取模块完成。
步骤12中所述的第一界面元素将要移动到的目标位置,可以由目标位置预测模块根据第一界面元素移动距离估值器计算出的参数而预测得出。该第一界面元素移动距离估值器的功能实现方式详见前文,此处不再赘述。
系统定时器可以设定固定的时间间隔作为采样周期,从而使得位置参数获取模块可以按照系统定时器设定的时间间隔,对第一界面元素的位置参数进行采样。
第二界面元素移动距离估值器,用于根据目标位置和设定的距离阈值,确定第二界面元素绘制位置。该第二界面元素移动距离估值器的功能实现方式详见前文,此处不再赘述。
绘制模块,可以根据预测的第一界面元素将要移动到目标位置,对第一界面元素进行绘制;并根据确定的第二界面元素绘制位置,对第二界面元素进行绘制。
通过本申请实施例1提供的上述方法可知,该方法通过对第一界面元素运动趋势的信息进行计算,可以预测出第一界面元素将要移动到的目标位置,进而可以在特定时刻,根据目标位置绘制第二界面元素,降低了第二界面元素移动的滞后性,从而避免了因为用户的重复移动操作,减少了系统资源的占用,提高了系统的运行效率。
需要说明的是,实施例1所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。比如,步骤11和步骤12的执行主体可以为第一界面元素控件,步骤13的执行主体可以为第二界面元素控件;又比如,步骤11的执行主体可以为第一界面元素控件,步骤12和步骤13的执行主体可以为第二界面元素控件;再比如,步骤11~步骤13的执行主体均可以为第二界面元素控件;等等。
实施例2
本申请实施例提供一种数字电视中焦点或焦点框的绘制方法,用于解决现有技术中对焦点或焦点框进行移动时出现的滞后问题。该方法的具体实现流程示意图如图2所示,主要包括下述步骤:
步骤21,数字电视机顶盒获取第一界面元素的运动趋势信息;
本申请实施例中,假设第一界面元素为焦点,则通过焦点在不同时刻的位置参数,获取焦点的运动趋势信息,包括:获取焦点的至少两个位置参数,以及焦点位于所述两个位置参数分别表示的位置时的时刻;根据所述至少两个位
置参数,确定焦点的移动方向;根据所述至少两个位置参数,以及焦点位于所述两个位置参数分别表示的位置时的时刻,确定焦点的移动速度。
其中,获取焦点的运动趋势信息,包括以下两种方式:
方式一:按照预设的焦点位置参数采样周期,获取焦点的运动趋势信息;
方式二:在收到第一界面元素位置变化触发指令后,获取焦点的运动趋势信息。
步骤22,根据获取的焦点的运动趋势信息,预测焦点将要移动到的目标位置;
在一种实施方式中,若该目标位置,为焦点在某一特定时刻将要移动到的位置,且焦点运动趋势的信息包括焦点的移动速度和移动方向,那么步骤22的具体实现方式可以包括:根据显示界面的绘制周期、所述移动速度和移动方向,预测焦点将要移动到的目标位置。
例如,若下述假设成立:
1、该数字电视以30ms的绘制周期,绘制各帧显示界面;
2、焦点沿水平方向X轴进行移动;
3、在T0时刻,数字电视接收到焦点移动指令,即焦点在T0时刻开始移动;
4、焦点在T0时刻的位置参数为(x0,y1)。
4、按照系统设定的采样周期(30ms),对焦点的位置参数进行采样。
5、按照系统设定的采样周期,对焦点的位置参数进行采样。其中,该采样周期与显示界面的绘制周期相同,为30ms。
6、按照系统设定的采样周期(30ms),在t2时刻获取到的焦点的位置参数为(x2,y1)。
在一种实施方式中,根据获取的焦点的运动趋势信息,对焦点将要移动到的目标位置进行预测的具体包括以下子步骤:
子步骤1,根据焦点的当前位置参数,计算焦点移动前后的水平坐标差:
totalDistanceX=(x2-x1)。
子步骤2,根据所述获取的totalDistanceX,以及系统设定的30ms采样周期,计算焦点的移动速度:focusViewMovingVelocityX=(x2-x1)÷30。
子步骤3,根据focusViewMovingVelocityX,以及特定的时刻t3,其中所述的t3时刻在时间轴上位于t2时刻之后,计算焦点预测移动距离:expectedDistanceX=focusViewMovingVelocityX×(t3-t2)。
子步骤4,根据t1时刻以及t2时刻获取到的焦点的位置参数,可以获取焦点的运动方向为沿水平方向x轴。
子步骤5,根据所述获取的焦点的运动方向以及在特定时间内的移动距离,则可预测出,焦点将要移动到达的目标位置,即,焦点在沿水平方向X轴移动到达的目标位置的位置参数为(x2+expectedDistanceX,y1)。
步骤23,根据所述目标位置绘制焦点框。
在一种实施方式中,当预测的焦点目标位置并未移动到焦点框当前所在的位置区域外,则确定出的第二界面元素绘制位置为焦点框的当前位置。
例如,当用户通过遥控器对焦点进行移动时,根据步骤22预测,在第一界面元素移动到所述目标位置的时刻焦点所在目标位置的参数为(x3,y3),而该位置仍然在焦点框的当前位置区域内,则此时焦点框的当前位置重新绘制焦点框。
一般地,当焦点从电视海报A所在的区域移动到电视海报B所在的区域时,电视海报A与电视海报B的尺寸,颜色,形状等特征可能是不一样的,为了在电视海报B所在的区域绘制的焦点框的尺寸,颜色,形状等特征与电视海报B的特征相匹配,本申请实施例提供一种方法,用于根据焦点移动到目标位置时,焦点所在的第三界面元素(即焦点移动到目标位置时,处于该位置的第三界面元素)的特征,绘制焦点框。
例如,当焦点从电视海报A所在的区域(电视海报A为正方形)移动到电视海报B所在的区域(电视海报B为三角形),则在目标区域绘制焦点框的
时,将焦点框绘制成三角形。
通过本申请实施例2提供的上述方法可知,该方法通过对焦点(或焦点框)的运动趋势信息进行计算,可以预测出焦点(或焦点框)将要移动到的目标位置,进而可以在目标位置对焦点框(或焦)点进行绘制,降低了第二界面元素移动的滞后性,从而避免了因为用户的重复移动操作而导致的不必要的处理资源浪费,提高了系统的运行效率。
实施例3
本申请实施例提供一种界面元素的绘制装置,用于解决现有技术中对界面元素进行移动时出现的滞后问题。该装置的具体实现流程示意图如图4所示,主要包括运动趋势信息获取单元31、目标位置预测单元32以及绘制单元33。
其中运动趋势信息获取单元,用于获取表征第一界面元素运动趋势的信息;
目标位置预测单元,用于根据所述信息,预测第一界面元素将要移动到的目标位置;
绘制单元,用于在根据所述目标位置确定出的第二界面元素绘制位置绘制第二界面元素。
在一种实施方式中,绘制单元,用于:在特定时刻,根据所述目标位置绘制第二界面元素。
在一种实施方式中,所述特定时刻不晚于第一界面元素移动到所述目标位置的时刻。
在一种实施方式中,绘制单元,用于:根据所述目标位置和设定的距离阈值,确定第一绘制位置;并在所述特定时刻,在第一绘制位置绘制第二界面元素;或根据所述目标位置,判断第一界面元素在所述特定时刻是否移动到了第二界面元素当前占据的显示区域外;根据判断结果,确定第二绘制位置;并在所述特定时刻,在第二绘制位置绘制第二界面元素。
在一种实施方式中,绘制单元,用于:在所述目标位置与第二界面元素当前的位置参数表示的位置之间的距离,小于设定的距离阈值时,在第一界面元素移动到所述目标位置的时刻,在第二界面元素当前的位置参数表示的位置绘制第二界面元素;在所述目标位置与第二界面元素当前的位置参数表示的位置之间的距离,不小于设定的距离阈值时,在第一界面元素移动到所述目标位置的时刻,在所述目标位置绘制第二界面元素。
在一种实施方式中,绘制单元,用于:在所述目标位置与第二界面元素当前的位置参数表示的位置之间的距离,不小于设定的距离阈值时,在第一界面元素移动到所述目标位置的时刻,在所述目标位置绘制第二界面元素。
在一种实施方式中,绘制单元,用于:获取在所述特定时刻处于所述目标位置的第三界面元素的特征;根据所述特征,绘制第二界面元素。
在一种实施方式中,所述的特征包括下述至少一种:颜色、尺寸、动画效果、形状等。
在一种实施方式中,运动趋势信息获取单元,用于:在收到第一界面元素位置变化触发指令后,获取表征第一界面元素运动趋势的信息;或按照预设的位置参数采样周期,获取表征第一界面元素运动趋势的信息。
在一种实施方式中,运动趋势信息获取单元,用于:按照预设的位置参数采样周期,获取表征第一界面元素运动趋势的信息。
在一种实施方式中,所述表征第一界面元素运动趋势的信息,包括:第一界面元素的移动速度和移动方向。
在一种实施方式中,运动趋势信息获取单元,用于:获取第一界面元素的至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻;根据所述至少两个位置参数,确定第一界面元素的移动方向;根据所述至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻,确定第一界面元素的移动速度。
在一种实施方式中,目标位置预测单元,用于:根据显示界面的绘制周期、
所述移动速度和移动方向,预测第一界面元素将要移动到的目标位置。
采用本申请实施例3提供的上述装置,由于运用目标位置预测单元对第一界面元素的运动趋势信息进行计算,可以预测出第一界面元素将要移动到的目标位置,进而可以在第一界面元素移动到所述目标位置的时刻,在目标位置对第二界面元素进行绘制,降低了第二界面元素移动的滞后性,从而避免了因为用户的重复移动操作,减少了系统资源的占用,提高了系统的运行效率。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。
Claims (23)
- 一种界面元素的绘制方法,其特征在于,包括:获取表征第一界面元素运动趋势的信息;根据所述信息,预测第一界面元素将要移动到的目标位置;根据所述目标位置绘制第二界面元素。
- 如权利要求1所述的方法,其特征在于,根据所述目标位置绘制第二界面元素,包括:在特定时刻,根据所述目标位置绘制第二界面元素。
- 如权利要求2所述的方法,其特征在于,所述特定时刻不晚于第一界面元素移动到所述目标位置的时刻。
- 如权利要求2所述的方法,其特征在于,在所述特定时刻,根据所述目标位置绘制第二界面元素,包括:根据所述目标位置和设定的距离阈值,确定第一绘制位置;并在所述特定时刻,在第一绘制位置绘制第二界面元素;或根据所述目标位置,判断第一界面元素在所述特定时刻是否移动到了第二界面元素当前占据的显示区域外;根据判断结果,确定第二绘制位置;并在所述特定时刻,在第二绘制位置绘制第二界面元素。
- 如权利要求4所述方法,其特征在于,根据所述目标位置和设定的距离阈值,确定第一绘制位置,包括:在所述目标位置与第二界面元素当前位置之间的距离小于设定的距离阈值时,将第二界面元素当前位置确定为第一绘制位置;在所述目标位置与第二界面元素当前位置之间的距离不小于设定的距离阈值时,将所述目标位置确定为第一绘制位置。
- 如权利要求2~5任一权项所述的方法,其特征在于,绘制第二界面元素,包括:获取在所述特定时刻处于所述目标位置的第三界面元素的特征;根据所述特征,绘制第二界面元素。
- 如权利要求6所述的方法,其特征在于,所述特征包括下述至少一种:颜色;尺寸;动画效果;形状。
- 如权利要求1所述的方法,其特征在于,获取表征第一界面元素运动趋势的信息,包括:在收到第一界面元素位置变化触发指令后,获取表征第一界面元素运动趋势的信息;或按照预设的位置参数采样周期,获取表征第一界面元素运动趋势的信息。
- 如权利要求1~5、7、8任一权项所述的方法,其特征在于,所述表征第一界面元素运动趋势的信息,包括:第一界面元素的移动速度和移动方向。
- 如权利要求9所述的方法,其特征在于,获取表征第一界面元素运动趋势的信息,包括:获取第一界面元素的至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻;根据所述至少两个位置参数,确定第一界面元素的移动方向;根据所述至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻,确定第一界面元素的移动速度。
- 如权利要求10所述的方法,其特征在于,根据所述信息,预测第一界面元素将要移动到的目标位置,包括:根据显示界面的绘制周期、所述移动速度和移动方向,预测第一界面元素将要移动到的目标位置。
- 一种界面元素的绘制装置,其特征在于,包括:运动趋势信息获取单元,用于获取表征第一界面元素运动趋势的信息;目标位置预测单元,用于根据所述信息,预测第一界面元素将要移动到的目标位置;绘制单元,用于根据所述目标位置绘制第二界面元素。
- 如权利要求12所述装置,其特征在于,绘制单元,用于:在特定时刻,根据所述目标位置绘制第二界面元素。
- 如权利要求13所述装置,其特征在于,所述特定时刻不晚于第一界面元素移动到所述目标位置的时刻。
- 如权利要求13所述装置,其特征在于,绘制单元,用于:根据所述目标位置和设定的距离阈值,确定第一绘制位置;并在所述特定时刻,在第一绘制位置绘制第二界面元素;或根据所述目标位置,判断第一界面元素在所述特定时刻是否移动到了第二界面元素当前占据的显示区域外;根据判断结果,确定第二绘制位置;并在所述特定时刻,在第二绘制位置绘制第二界面元素。
- 如权利要求15所述装置,其特征在于,绘制单元,用于:在所述目标位置与第二界面元素当前的位置参数表示的位置之间的距离,小于设定的距离阈值时,将第二界面元素当前位置确定为第一绘制位置;在所述目标位置与第二界面元素当前位置之间的距离不小于设定的距离阈值时,将所述目标位置确定为第一绘制位置。
- 如权利要求13~16任一权项所述装置,其特征在于,绘制单元,用于:获取在所述特定时刻处于所述目标位置的第三界面元素的特征;根据所述特征,绘制第二界面元素。
- 如权利要求17所述装置,其特征在于:所述特征包括下述至少一种:颜色;尺寸;动画效果;形状。
- 如权利要求12所述装置,其特征在于,运动趋势信息获取单元,用于:在收到第一界面元素位置变化触发指令后,获取表征第一界面元素运动趋势的信息;或按照预设的位置参数采样周期,获取表征第一界面元素运动趋势的信息。
- 如权利要求12~16、18、19任一项权项所述的装置,其特征在于,所述表征第一界面元素运动趋势的信息,包括:第一界面元素的移动速度和移动方向。
- 如权利要求20所述的装置,其特征在于,运动趋势信息获取单元,用于:获取第一界面元素的至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻;根据所述至少两个位置参数,确定第一界面元素的移动方向;根据所述至少两个位置参数,以及第一界面元素位于所述两个位置参数分别表示的位置时的时刻,确定第一界面元素的移动速度。
- 如权利要求21所述的装置,其特征在于,目标位置预测单元,用于:根据显示界面的绘制周期、所述移动速度和移动方向,预测第一界面元素将要移动到的目标位置。
- 一种界面元素的绘制组件,其特征在于,包括如12~14、16、19任一项权项所述的装置。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510278764.1A CN106303652B (zh) | 2015-05-27 | 2015-05-27 | 一种界面元素的绘制方法及装置 |
| CN201510278764.1 | 2015-05-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016188289A1 true WO2016188289A1 (zh) | 2016-12-01 |
Family
ID=57392532
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/080306 Ceased WO2016188289A1 (zh) | 2015-05-27 | 2016-04-27 | 一种界面元素的绘制方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106303652B (zh) |
| WO (1) | WO2016188289A1 (zh) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110990005A (zh) * | 2019-11-20 | 2020-04-10 | 金现代信息产业股份有限公司 | 网页元素定位方法 |
| CN113538624A (zh) * | 2021-07-23 | 2021-10-22 | 北京光启元数字科技有限公司 | 一种扇环形页面元素的圆角绘制方法、装置、设备和介质 |
| WO2021249104A1 (en) * | 2020-06-09 | 2021-12-16 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | System and method for determining position of a new interface element on user interface |
| CN116366929A (zh) * | 2023-04-11 | 2023-06-30 | 北京达佳互联信息技术有限公司 | 素材处理方法、装置、设备和存储介质 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107835461B (zh) * | 2017-11-02 | 2021-09-28 | 深圳市雷鸟网络传媒有限公司 | 焦点移动控制方法、智能电视及计算机可读存储介质 |
| CN108388465B (zh) * | 2018-03-15 | 2021-04-23 | 阿里巴巴(中国)有限公司 | 动态形变开关组件的实现方法、装置及终端 |
| CN110737963B (zh) * | 2019-12-20 | 2020-03-31 | 广东博智林机器人有限公司 | 海报元素布局方法、系统和计算机可读存储介质 |
| CN113821152B (zh) * | 2020-11-06 | 2024-06-18 | 北京沃东天骏信息技术有限公司 | 界面元素的位置确定方法及装置、介质和设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101814031A (zh) * | 2010-04-22 | 2010-08-25 | 四川长虹电器股份有限公司 | 用户界面元素的焦点框样式可定制的实现方法 |
| WO2014031191A1 (en) * | 2012-08-20 | 2014-02-27 | Google Inc. | User interface element focus based on user's gaze |
| WO2014200811A1 (en) * | 2013-06-12 | 2014-12-18 | Microsoft Corporation | User focus controlled graphical user interface using a head mounted device |
| CN104461256A (zh) * | 2014-12-30 | 2015-03-25 | 广州视源电子科技股份有限公司 | 界面元素显示方法和系统 |
| CN104486686A (zh) * | 2014-12-23 | 2015-04-01 | 深圳市九洲电器有限公司 | 一种电子节目菜单的导航方法和系统 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103019518B (zh) * | 2012-12-14 | 2016-06-22 | 广东欧珀移动通信有限公司 | 一种自动调整人机交互界面的方法 |
| CN103530040B (zh) * | 2013-10-22 | 2016-03-30 | 腾讯科技(深圳)有限公司 | 目标元素移动方法、装置及电子设备 |
-
2015
- 2015-05-27 CN CN201510278764.1A patent/CN106303652B/zh active Active
-
2016
- 2016-04-27 WO PCT/CN2016/080306 patent/WO2016188289A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101814031A (zh) * | 2010-04-22 | 2010-08-25 | 四川长虹电器股份有限公司 | 用户界面元素的焦点框样式可定制的实现方法 |
| WO2014031191A1 (en) * | 2012-08-20 | 2014-02-27 | Google Inc. | User interface element focus based on user's gaze |
| WO2014200811A1 (en) * | 2013-06-12 | 2014-12-18 | Microsoft Corporation | User focus controlled graphical user interface using a head mounted device |
| CN104486686A (zh) * | 2014-12-23 | 2015-04-01 | 深圳市九洲电器有限公司 | 一种电子节目菜单的导航方法和系统 |
| CN104461256A (zh) * | 2014-12-30 | 2015-03-25 | 广州视源电子科技股份有限公司 | 界面元素显示方法和系统 |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110990005A (zh) * | 2019-11-20 | 2020-04-10 | 金现代信息产业股份有限公司 | 网页元素定位方法 |
| CN110990005B (zh) * | 2019-11-20 | 2023-05-30 | 金现代信息产业股份有限公司 | 网页元素定位方法 |
| WO2021249104A1 (en) * | 2020-06-09 | 2021-12-16 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | System and method for determining position of a new interface element on user interface |
| CN113538624A (zh) * | 2021-07-23 | 2021-10-22 | 北京光启元数字科技有限公司 | 一种扇环形页面元素的圆角绘制方法、装置、设备和介质 |
| CN113538624B (zh) * | 2021-07-23 | 2024-06-11 | 腾讯云计算(北京)有限责任公司 | 一种扇环形页面元素的圆角绘制方法、装置、设备和介质 |
| CN116366929A (zh) * | 2023-04-11 | 2023-06-30 | 北京达佳互联信息技术有限公司 | 素材处理方法、装置、设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106303652A (zh) | 2017-01-04 |
| CN106303652B (zh) | 2019-09-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016188289A1 (zh) | 一种界面元素的绘制方法及装置 | |
| US10445132B2 (en) | Method and apparatus for switching applications | |
| KR102139587B1 (ko) | 디스플레이 성능 제어 | |
| CN106127843B (zh) | 三维虚拟场景的渲染方法和装置 | |
| KR102930025B1 (ko) | 투사 방법 및 시스템 | |
| US20180011818A1 (en) | Webpage Update Method And Apparatus | |
| US10620972B2 (en) | Processing touch gestures in hybrid applications | |
| JP2017130185A (ja) | イベント信号処理方法及び装置並びにイベント基盤ビジョンセンサ基盤のピクセル増強方法及び装置 | |
| CN104869470A (zh) | 根据遥控光标位置自动捕获ui焦点的实现方法及系统 | |
| CN110496395B (zh) | 一种针对虚幻引擎的组件运行方法、系统及设备 | |
| WO2017202314A1 (zh) | 数据处理方法及装置 | |
| WO2016101810A1 (zh) | 多窗口系统下切换显示对象的方法及其装置 | |
| CN103888605A (zh) | 一种信息处理的方法及电子设备 | |
| JP6630669B2 (ja) | ウィジェットエリアの調整方法および調整装置 | |
| WO2015103819A1 (zh) | 一种触摸屏下实现快速批量操作的方法及装置 | |
| WO2016101816A1 (zh) | 一种即时通讯中的信息显示方法及装置 | |
| US11314388B2 (en) | Method for viewing application program, graphical user interface, and terminal | |
| US20150145749A1 (en) | Image processing apparatus and image processing method | |
| CN107092410A (zh) | 一种触摸屏的界面交互方法、设备以及智能终端设备 | |
| CN110780788A (zh) | 一种执行触控操作的方法与设备 | |
| CN108181989B (zh) | 基于视频数据的手势控制方法及装置、计算设备 | |
| CN106445254B (zh) | 触摸屏扫描方法和装置 | |
| HK1233089B (zh) | 一种界面元素的绘制方法及装置 | |
| US12468394B2 (en) | Gesture interaction method, apparatus and electronic device | |
| HK1233089A (zh) | 一種界面元素的繪製方法及裝置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16799178 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16799178 Country of ref document: EP Kind code of ref document: A1 |