WO2017028436A1 - Drawing tool implementation method, apparatus, device, and computer storage medium - Google Patents

Drawing tool implementation method, apparatus, device, and computer storage medium Download PDF

Info

Publication number
WO2017028436A1
WO2017028436A1 PCT/CN2015/098081 CN2015098081W WO2017028436A1 WO 2017028436 A1 WO2017028436 A1 WO 2017028436A1 CN 2015098081 W CN2015098081 W CN 2015098081W WO 2017028436 A1 WO2017028436 A1 WO 2017028436A1
Authority
WO
WIPO (PCT)
Prior art keywords
gesture operation
drawn line
gesture
coordinate system
position coordinates
Prior art date
Application number
PCT/CN2015/098081
Other languages
French (fr)
Chinese (zh)
Inventor
王梦阳
Original Assignee
百度在线网络技术(北京)有限公司
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 百度在线网络技术(北京)有限公司 filed Critical 百度在线网络技术(北京)有限公司
Publication of WO2017028436A1 publication Critical patent/WO2017028436A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction 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

Definitions

  • the present invention relates to the field of computer application technologies, and in particular, to a method, an apparatus, a device, and a computer storage medium for implementing a drawing tool.
  • the present invention provides a method and apparatus for implementing a drawing tool to facilitate user convenience in drawing on a mobile device.
  • the invention provides a method for implementing a drawing tool, the method comprising:
  • the graphic drawing tool is called to draw and display the target points.
  • the method further includes:
  • the gesture operation of switching the drawing mode includes:
  • the method further comprises: filtering the monitored drawing gesture operation in the drawing mode, and retaining only valid drawing gesture operations; wherein the filtering comprises:
  • the effective drawing gesture operation includes a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
  • the gesture operation of drawing a line includes: a sliding gesture that starts with a short press;
  • the gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
  • the respective operations of the gesture operation for drawing a line Punctuation is each point on the sliding track corresponding to the sliding gesture starting with a short press;
  • Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
  • the sliding gesture starting with the long end of the drawn line ends causes a change in the tilt angle or length of the drawn line
  • a swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
  • the method further includes:
  • the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system are adapted according to the new service data acquired by the gesture operation;
  • the graphics drawing tool is invoked to draw and display points on the drawn line after the adaptation process.
  • the effective gesture operation comprises: a sliding screen operation, an enlargement or reduction operation.
  • the adapting the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system includes:
  • the method further includes:
  • the relative position information of the record is persistently stored.
  • the method further includes:
  • the graphic drawing tool is invoked to draw and display the drawn lines within the scope of the current application interface display.
  • the application of the drawing tool includes: a stock application.
  • the invention also provides an implementation device of a drawing tool, the device comprising:
  • An acquiring unit configured to acquire, when the listening unit monitors a valid drawing gesture operation in the drawing mode, acquire position coordinates of each target point corresponding to the drawing gesture operation in a coordinate system adopted by the operating system;
  • mapping unit configured to map position coordinates of the target points in a coordinate system adopted by the operating system to a coordinate system used by the graphic drawing tool
  • the calling unit is configured to invoke the graphic drawing tool to draw and display the target points.
  • the device further comprises:
  • a switching unit configured to switch to a drawing mode when the monitoring unit monitors a gesture operation of switching the drawing mode in the non-drawing mode; or when the monitoring unit monitors the gesture operation of switching the drawing mode in the drawing mode , switch to non-drawing mode.
  • the gesture operation of switching the drawing mode includes:
  • the device further comprises:
  • a filtering unit configured to filter the drawing gesture operation monitored by the monitoring unit in the drawing mode, and only retain a valid drawing gesture operation; wherein the filtering comprises:
  • the effective drawing gesture operation includes a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
  • the gesture operation of drawing a line includes: a sliding gesture that starts with a short press;
  • the gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
  • each target point corresponding to the gesture operation for drawing a line is a point on the sliding track corresponding to the sliding gesture that starts with a short press
  • Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
  • the sliding begins with the long end of the drawn line Gestures cause changes in the angle or length of the drawn line;
  • a swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
  • the device further comprises:
  • an adapting unit configured to: if the monitoring unit monitors a valid gesture operation in the non-drawing mode, according to the new service data acquired by the gesture operation, the position of the point on the drawn line in the operating system Coordinates are processed;
  • the mapping unit is further configured to map the position coordinates of the points on the drawn line after the adaptation process in the coordinate system used by the operating system to the coordinate system used by the graphic drawing tool;
  • the calling unit is further configured to invoke the graphic drawing tool to draw and display points on the drawn line after the adaptation process.
  • the effective gesture operation comprises: a sliding screen operation, an enlargement or reduction operation.
  • the adapting unit is specifically configured to utilize the relative position between the drawn line and the service data, and after acquiring the new service data, according to the service data on the application interface.
  • the position coordinates in the coordinate system used by the operating system determine the position coordinates of the drawn line in the coordinate system used by the operating system.
  • the device further comprises:
  • a storage unit configured to record a relative position between the target points and service data displayed on the current application interface; and store the relative position information of the record for persistent storage.
  • the device further comprises:
  • a processing unit configured to acquire relative location information of the persistent storage when the application where the drawing tool is started; and the service data and the information displayed according to the current application interface Relative position information, determining the position coordinates of the drawn line within the current application interface display range;
  • the mapping unit is further configured to map location coordinates determined by the startup processing unit to a coordinate system used by the graphics rendering tool;
  • the calling unit is further configured to invoke the graphic drawing tool to draw and display the drawn lines in the display range of the current application interface.
  • the application of the graphic drawing tool includes: a stock application.
  • the present invention maps the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool by monitoring the user's effective drawing gesture operation. In the middle, and call the graphics drawing tool to draw and display each target point, so that the user can conveniently draw on the mobile device through gestures.
  • FIG. 1 is a flowchart of a main method according to an embodiment of the present invention
  • FIG. 2a is a schematic diagram of an application interface in a non-drawing mode according to an embodiment of the present invention
  • FIG. 2b is a schematic diagram of an application interface in a drawing mode according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for drawing a line according to an embodiment of the present invention.
  • 4a is a diagram showing an example of drawing a line according to an embodiment of the present invention.
  • 4b is a diagram showing an example of modifying a drawn line according to an embodiment of the present invention.
  • 4c is a diagram showing another example of modifying a drawn line according to an embodiment of the present invention.
  • 4d is a diagram showing an example of deleting a drawn line according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for modifying a drawn line according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a processing method in a non-drawing mode according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of starting and displaying an application interface according to an embodiment of the present invention.
  • FIG. 8 is a structural diagram of a device according to an embodiment of the present invention.
  • the method provided by the present invention is mainly applied to a mobile terminal having a touch screen, including but not limited to a smartphone, a tablet, a PDA (Personal Digital Assistant), and the like.
  • the mobile terminal includes some basic components in the architecture, such as a bus, a processing system, a storage system, one or more input/output systems, and a communication interface.
  • the bus may include one or more wires for enabling communication between components of the mobile terminal.
  • a processing system includes various types of processors or microprocessors for executing instructions, processing processes, or threads.
  • the storage system may include a dynamic memory such as a random access memory (RAM) that stores dynamic information, and a static memory such as a read only memory (ROM) that stores static information, and a large-capacity memory including a magnetic or optical recording medium and a corresponding drive.
  • RAM random access memory
  • ROM read only memory
  • the input system allows the user to input information to the mobile terminal, such as a stylus, a touch screen, a voice recognition system, or a biometric system.
  • the output system includes a touch screen, a speaker, and the like for outputting information.
  • the communication interface is used to enable the mobile terminal to communicate with other devices.
  • the communication interfaces can be connected to the network through a wired connection, a wireless connection, or an optical connection.
  • the mobile terminal includes operating system software for managing system resources, controlling the running of other programs, and application software for implementing specific functional modules.
  • the method and device for implementing the drawing tool provided by the present invention can be mounted on a plurality of application software on a mobile terminal, such as stock application software, weather application software, and icon application soft. Pieces and so on.
  • the implementation method and apparatus of the drawing tool provided by the present invention can perform line drawing on the basis of the data provided by the application software, thereby helping the user to perform data analysis.
  • the stock application software is taken as an example for description, and the scenarios of other application software are similar.
  • FIG. 1 is a flowchart of a main method according to an embodiment of the present invention. As shown in FIG. 1, the method may include the following steps:
  • the user's gesture operation is monitored.
  • the application currently being used by the user may be switched between two modes by using the drawing tool provided by the present invention: a drawing mode and a non-drawing mode.
  • the main function of the stock application software is to display the stock information, so the default is in the non-drawing mode, that is, the current application is in the non-drawing mode by default after startup.
  • Switching from non-drawing mode to drawing mode can be triggered by the user's gesture operation. That is, in the non-drawing mode, if the gesture operation of switching the drawing mode is monitored, the mode is switched to the drawing mode. When listening to the gesture operation of switching the drawing mode in the drawing mode, switch to the non-drawing mode.
  • the gesture operation of switching the drawing mode may be preset, as long as it is different from the current application and the gesture operation of the operating system of the mobile terminal.
  • a gesture operation example for switching the drawing mode is shown.
  • FIG. 2a when the stock data is displayed in the current application, there is a function button for switching the drawing mode on the interface, that is, the figure is marked as "Draw a line” button, when the user needs to perform a drawing operation, by clicking on the The function button switches from non-drawing mode to drawing mode.
  • the above function button becomes "return", as shown in Fig. 2b, when the user clicks the function button again, it switches back to the non-drawing mode.
  • effective drawing gesture operations may include, but are not limited to, a gesture operation of drawing a line, a gesture operation of modifying a drawn line, and a gesture operation of deleting a drawn line.
  • the target coordinates corresponding to the drawing gesture operation acquired by 102 are recorded in the coordinate system in the coordinate system used by the operating system.
  • the user's gesture operation is touched on the screen by taking the upper left corner of the screen as the origin. The position of the x, y coordinate of the point touched.
  • the graphic drawing tool used in the embodiment of the present invention may be, but not limited to, OpenGL, that is, OpenGL may provide an interface to the graphic drawing tool for the graphic drawing tool to call, thereby completing the drawing and displaying of the target point.
  • the origin of the coordinate system of OpenGL is in the lower left corner, so the position coordinates of the target point need to be converted and converted into coordinates used by a graphic drawing tool such as OpenGL.
  • the position coordinates in the system Since the coordinate origin of a graphics drawing tool such as OpenGL is different from the coordinate origin of the Android system, for example, the origin of the coordinate system of OpenGL is in the lower left corner, so the position coordinates of the target point need to be converted and converted into coordinates used by a graphic drawing tool such as OpenGL. The position coordinates in the system.
  • a graphical drawing tool is invoked to draw and display each target point.
  • FIG. 3 is a flowchart of a method for drawing a line according to an embodiment of the present invention. Let the user switch the current application to the drawing mode, and the user wants to draw the line in the drawing mode. As shown in FIG. 3, the process may specifically include the following steps:
  • the user's gesture operation is monitored.
  • the monitored gesture operation is filtered in the drawing mode.
  • the drawing range in the drawing mode may be preset, that is, a range is preset on the interface of the current application, and only the drawing gestures performed within the range are valid, and the drawing gestures beyond the range are filtered out.
  • some effective drawing gesture types may also be preset. These gesture types may be gesture types capable of drawing straight lines, polylines, curves, etc., and gestures that do not conform to these drawing gesture types will be filtered out.
  • the position coordinates of the coordinate system of the operating system are converted to the position coordinates of the coordinate system of the OpenGL for each target point corresponding to the gesture operation of the monitored drawing line.
  • the coordinate system of the operating system is the coordinate origin of the upper left corner and is in units of pixels, and OpenGL uses the center point as the coordinate origin and the height of the entire view, it is necessary to The target point is converted to the position coordinate of the coordinate system of the OpenGL coordinate system in the coordinate system of the Android operating system. If the position coordinate of a target point in the coordinate system of the Android operating system is (xPosi, yPosi), then the position coordinates (x, y) of the coordinate system obtained in the OpenGL after conversion are:
  • oriCanvasWidth is the view width
  • oriCanvasHeight is the view height
  • widthRatio is the OpenGL width coefficient
  • heightRatio is the OpenGL height coefficient
  • OpenGL is called to draw and display each target point.
  • k-line data and k-line data are usually displayed. It is continuously updated in the direction of the time axis. As shown in Figure 2b, the latest business data displayed on the current interface is the k-line data on December 2, but until tomorrow, the latest business data displayed becomes December 3. The k-line data, which causes the image to move to the left as a whole. If only the position coordinates (ie, absolute position coordinates) of each target point in the coordinate system used by the Android operating system are recorded, the updated business data is no longer applicable.
  • the recorded relative position information is persistently stored.
  • the persistent storage in this step means that the storage remains after the current application is closed, and the content of the persistent storage will always exist unless the user manually deletes the content of the persistent storage.
  • the user can draw lines on the current application interface, the user can The lines are drawn on the interface shown in Figure 2b and the results can be as shown in Figure 4a. It should be noted that the drawing of the line is not limited to the straight line segment shown in FIG. 4a, and may be a broken line or a curved line or the like.
  • FIG. 5 is a flowchart of a method for modifying a drawn line according to an embodiment of the present invention.
  • a user has switched the current application to a drawing mode, and the user needs to modify the drawn line in the drawing mode.
  • the process can include the following steps:
  • the monitored gesture operation is filtered in the drawing mode.
  • the drawing range and the drawing gesture type may be set in advance, if the gesture range of the user modifying the existing line is out of the drawing range, or the gesture type of modifying the existing line does not conform to the preset drawing. Gesture type, then filter it out.
  • a gesture operation type for the drawn line is determined, and if it is an operation to delete the drawn line, 504 is performed; if it is an operation to modify the drawn line, 505 is performed.
  • the type of gesture operation on the drawn line may be set in advance, and may include, but is not limited to, modifying the style or position of the drawn line, deleting the drawn line, and the like.
  • the gesture operation for modifying each of the drawn lines can also be set in advance. For example, a swipe gesture starting with a long press of the end point of the drawn line is set to cause a change in the tilt angle or length of the drawn line, that is, the user can achieve the tilt angle or length of the drawn line by pressing and holding one end point of the drawn line. Drag and drop.
  • a swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line, that is, the user can move the drawn line to the position where the user's finger leaves the screen by holding down the middle position of the drawn line.
  • the delete button on the interface is set to remove the gesture action of the drawn line.
  • a submenu pops up on the interface, and there is a delete option in the submenu, and when the user clicks the delete option, the drawn line is deleted.
  • the drawing mode there is a delete button on the interface.
  • the deleted line is deleted, and OpenGL does not display the deleted line, and ends the processing of the gesture operation.
  • Each target point corresponding to the gesture operation of modifying the drawn line may be each point obtained by changing the drawn line style or position caused by the sliding gesture starting from the point on the drawn line.
  • the position coordinates of the target point in the coordinate system adopted by the Android operating system are converted into the position coordinates of the coordinate system in OpenGL.
  • OpenGL is called to draw and display each target point.
  • the user can operate the drawn line on the current application interface.
  • the user can modify one of the straight line segments shown in FIG. 4a with the following modifications:
  • the first modification dragging and dropping an end point of a straight line segment to change the tilt angle and/or length of the straight line segment, as shown in Figure 4b.
  • the user's finger long presses the drawn line
  • the end point of the strip is swiped to the position shown by point B.
  • the tilt angle and length of the line can be modified by the drag, the dotted line segment represents the drawn line before the modification, and the solid line segment represents the modified line. Lines have been drawn, and thick arrows indicate the sliding trajectory of the user's finger.
  • the second modification dragging the middle position of the straight line segment to change the position of the straight line segment, as shown in Figure 4c.
  • the user's finger presses the middle position of the drawn line, and slides from point C to position D, by which the position of the straight line can be moved.
  • the dotted line in the figure indicates the drawn line before the modification
  • the solid line indicates the drawn line after the modification
  • the thick arrow indicates the sliding track of the user's finger.
  • the third modification long press the drawn line to bring up the submenu and select the delete option on the submenu to delete the drawn line.
  • the user's finger presses the drawn line, and a submenu pops up on the interface.
  • the submenu includes the delete option.
  • the user clicks the delete option the drawn line can be deleted.
  • FIG. 6 is a flowchart of a processing method in a non-drawing mode according to an embodiment of the present invention. In this embodiment, it is assumed that a user has switched the current application to a non-drawing mode. As shown in FIG. 6, the process may include the following steps. :
  • the user's gesture operation is monitored.
  • the gesture operations monitored in the non-plot mode are filtered.
  • the range and type of the gesture operation in the non-drawing mode can be preset, and the gesture operations beyond the above range and not conforming to the above types can be filtered, only Keep valid gestures.
  • the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system are adapted.
  • the gesture operations monitored here may include, but are not limited to, a swipe screen operation, an enlargement or reduction operation.
  • the current application needs to obtain new business data according to the sliding screen operation, and the acquired business data is determined according to the sliding amplitude.
  • the user slides to the left on the application interface as shown in FIG. 4a (unlike FIG. 4a, the operation is in the non-drawing mode), and if the sliding amplitude corresponds to one week of business data, it is necessary to acquire a new week of business.
  • the data that is, the k-line data from December 3 to December 9, causes the business data on the screen to move uniformly to the left for one week, and displays the k-line data from September 6 to December 9. Since it is possible that the user has drawn a line on the interface, after moving the screen, it is also necessary to adapt the position of the drawn line.
  • the current application needs to obtain finer-grained service data according to the magnitude of the amplification operation. That is to say, the range of business data displayed on the screen becomes smaller, but the granularity is finer. Also, since it is possible that the user has drawn a line on the interface, it is also necessary to adapt the position of the drawn line after moving the screen.
  • the current application needs to acquire a larger range of business data according to the magnitude of the zoom-out operation, that is, the range of business data displayed on the screen becomes larger, but the granularity is coarser. This situation also requires adaptation of the position of the drawn line.
  • the focus of this step is on the adaptation processing of the position of the drawn line.
  • the adaptation process is actually using the relative position between the already drawn line drawn and the business data. After moving the screen, zooming in or out, etc., the position coordinates of the drawn line are determined according to the position coordinates of the business data.
  • the position coordinates are position coordinates in the coordinate system employed by the operating system.
  • the position coordinates on the drawn line after the adaptation process are mapped to the coordinate system of the OpenGL in the coordinate system adopted by the Android operating system.
  • OpenGL is called to draw and display the points on the drawn line after the adaptation process.
  • the process shown in FIG. 3 or FIG. 5 may be further combined.
  • the drawn lines are modified according to the finer-grained business data; after the user moves the screen, the lines are further drawn according to the newly acquired business data, and the like.
  • the position coordinates of the drawn lines within the current application interface display range are determined.
  • the position coordinates of the drawn line can be obtained according to the position coordinates of the business data displayed in the current application interface (in the coordinate system of the operating system).
  • the position coordinates of the obtained drawn lines are only taken within the scope of the current application interface display.
  • the position coordinates determined in step 702 are converted to position coordinates in the coordinate system of OpenGL.
  • FIG. 8 is a structural diagram of a device according to an embodiment of the present invention.
  • the device may be disposed in an application software having a drawing requirement.
  • the device may include: a listening unit 01, an obtaining unit 02, a mapping unit 03, and
  • the calling unit 04 may further include a switching unit 05, a filtering unit 06, an adaptation unit 07, a storage unit 08, and a startup processing unit 09.
  • the main functions of each component are as follows:
  • the listening unit 01 is responsible for monitoring the gesture operation of the user.
  • the effective drawing gesture operations may include: a gesture operation of drawing a line, a gesture operation of modifying a drawn line, or a gesture operation of deleting a drawn line.
  • the gesture operation of drawing a line includes: a swipe gesture that starts with a short press; a gesture operation of modifying the drawn line includes: a swipe gesture that starts with a long press on a point on the drawn line.
  • Gesture operations for deleting a drawn line include: long-pressing a gesture to call a submenu and selecting a delete option on the submenu, or selecting a gesture operation after the line has been drawn and clicking the delete button on the interface.
  • each target point corresponding to the gesture operation of drawing a line is a point on the sliding track corresponding to the sliding gesture that starts with a short press; each target point corresponding to the gesture operation of modifying the drawn line is to long press on the drawn line Points obtained by changing the drawn line style or position caused by the swipe gesture at the beginning of the point.
  • a swipe gesture that begins with a long press of the endpoint of the drawn line causes a change in the tilt angle or length of the drawn line; a swipe gesture that begins with a long point of the middle point of the drawn line causes the drawn Change the position of the line.
  • the mapping unit 03 is responsible for mapping the position coordinates of each target point in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool.
  • the calling unit 04 is responsible for calling the graphics drawing tool to draw and display the target points.
  • the graphic drawing tool used in the embodiment of the present invention may be, but not limited to, OpenGL, that is, OpenGL may provide an interface to the graphic drawing tool for the graphic drawing tool to call, thereby completing the drawing and displaying of the target point.
  • the application software equipped with the device can switch between the two modes, that is, the switching between the drawing mode and the non-plot mode, which is performed by the switching unit 05. Specifically, when the listening unit 01 monitors the gesture operation of switching the drawing mode in the non-drawing mode, the switching unit 05 switches to the drawing mode; or, when the listening unit 01 monitors the gesture operation of switching the drawing mode in the drawing mode, The switching unit 05 switches to the non-drawing mode.
  • the gesture operation in which the drawing mode is switched may be preset, as long as it is different from the current application and the gesture operation of the operating system of the mobile terminal.
  • a function button that clicks the user to switch the drawing mode can be used.
  • the filtering unit 06 is responsible for filtering the drawing gesture operation monitored by the monitoring unit 01 in the drawing mode, and only retains the effective drawing gesture operation; wherein the filtering may include, but is not limited to, filtering out the gesture beyond the drawing range, and/or filtering A gesture that does not match the preset drawing gesture type.
  • the adaptation unit 07 may operate the acquired new service data according to the gesture.
  • the position coordinates of the points on the drawn line are adapted in the coordinate system used by the operating system.
  • the mapping unit 03 will adapt the position coordinate mapping of the points on the drawn line after processing in the coordinate system adopted by the operating system. Go to the coordinate system of the drawing tool.
  • the calling unit 04 calls the graphics drawing tool to draw and display the points on the drawn lines after the adaptation process.
  • the adapting unit 07 can utilize the relative position between the recorded line drawn and the service data, and after acquiring the new service data, determine the position coordinate in the coordinate system adopted by the operating system according to the service data on the application interface. Draws the position coordinates of the line in the coordinate system used by the operating system.
  • the storage unit 08 is responsible for recording the relative position between each target point on the drawn line and the business data displayed on the current application interface; and storing the relative position information of the record for persistent storage.
  • the startup processing unit 09 may obtain the relative location information of the persistent storage; determine the drawn in the current application interface display range according to the service data displayed by the current application interface and the obtained relative location information. The position coordinates of the line.
  • the mapping unit 03 maps the position coordinates determined by the startup processing unit 09 to the coordinate system employed by the graphic drawing tool.
  • Calling unit 04 calls the graphics drawing tool to draw and display the drawn lines within the scope of the current application interface display.
  • the method and apparatus provided by the present invention can have the following advantages:
  • the present invention maps the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool by monitoring the effective drawing gesture operation of the user in the drawing mode. And call the graphics drawing tool to draw and display each target point, so that the user can conveniently draw on the mobile device through the gesture operation.
  • the user can perform the current application interface through effective gestures. Move, zoom in and out, and draw and modify the graphics on this basis, making the drawing of the graphics more accurate.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division, and the actual implementation may have another division manner.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Position Input By Displaying (AREA)

Abstract

A drawing tool implementation method, apparatus, device, and computer storage medium. The method comprises: listening to a gesture operation of a user (101); obtaining, if an effective drawing gesture operation is detected in a drawing mode, position coordinates of each target point, in a coordinate system used by an operating system, corresponding to the drawing gesture operation (102); mapping the position coordinates of each target point in the coordinate system used by the operating system to position coordinates in a coordinate system used by an image drawing tool (103); and calling the image drawing tool to perform drawing and presentation on each target point (104). The method can help a user draw on a mobile device accurately and conveniently.

Description

一种绘图工具的实现方法、装置、设备和计算机存储介质Method, device, device and computer storage medium for implementing drawing tool
本申请要求了申请日为2015年08月18日,申请号为201510508391.2发明名称为“一种绘图工具的实现方法和装置”的中国专利申请的优先权。The present application claims priority from Chinese Patent Application No. 201510508391.2, entitled "A Method and Apparatus for Implementing a Drawing Tool", filed on Aug. 18, 2015.
技术领域Technical field
本发明涉及计算机应用技术领域,特别涉及一种绘图工具的实现方法、装置、设备和计算机存储介质。The present invention relates to the field of computer application technologies, and in particular, to a method, an apparatus, a device, and a computer storage medium for implementing a drawing tool.
背景技术Background technique
随着智能手机、平板电脑等移动设备的迅速普及和发展,人们越来越多的利用移动设备来进行通讯、工作、娱乐和信息获取。但由于其便携性的限制,往往移动设备的屏幕较小且人们大多通过手指在移动设备的触摸屏上进行操作。这一限制对于在移动设备上实现绘图带来了难度,人们往往不能准确方便地在移动设备上进行绘图,哪怕是简单的绘图操作,例如用户在使用智能手机查看股票信息时,常常需要在股票信息的显示界面上划出趋势线,从而帮助用户进行趋势分析。然而,由于上述移动设备的屏幕限制,目前市场上只有在PC端针对股票软件提供相应的绘图工具,而在移动设备端仍处于空白状态。With the rapid spread and development of mobile devices such as smartphones and tablets, people are increasingly using mobile devices for communication, work, entertainment and information acquisition. However, due to the limitation of portability, the screen of the mobile device is often small and people mostly operate on the touch screen of the mobile device through the finger. This limitation makes it difficult to implement drawing on mobile devices. People often cannot draw on mobile devices accurately or conveniently. Even simple drawing operations, such as when users use smartphones to view stock information, often need to be in stock. A trend line is drawn on the display interface of the information to help the user to perform trend analysis. However, due to the screen limitations of the above mobile devices, currently only the corresponding drawing tools are provided for the stock software on the PC side, but still blank in the mobile device side.
发明内容Summary of the invention
有鉴于此,本发明提供了一种绘图工具的实现方法和装置,以便于帮助用户方便地在移动设备上进行绘图。In view of this, the present invention provides a method and apparatus for implementing a drawing tool to facilitate user convenience in drawing on a mobile device.
具体技术方案如下:The specific technical solutions are as follows:
本发明提供了一种绘图工具的实现方法,该方法包括:The invention provides a method for implementing a drawing tool, the method comprising:
监听用户的手势操作;Listening to the user's gestures;
如果在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势 操作对应的各目标点在操作***所采用坐标系中的位置坐标;Get the drawing gesture if a valid drawing gesture operation is heard in drawing mode The position coordinates of the corresponding target points in the coordinate system adopted by the operating system;
将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;Mapping the position coordinates of the target points in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool;
调用所述图形绘制工具对所述各目标点进行绘制和展示。The graphic drawing tool is called to draw and display the target points.
根据本发明一优选实施方式,该方法还包括:According to a preferred embodiment of the present invention, the method further includes:
当在非绘图模式下监听到切换绘图模式的手势操作时,切换至绘图模式;或者,When listening to the gesture operation of switching the drawing mode in the non-drawing mode, switching to the drawing mode; or,
当在绘图模式下监听到切换绘图模式的手势操作时,切换至非绘图模式。When listening to the gesture operation of switching the drawing mode in the drawing mode, switch to the non-drawing mode.
根据本发明一优选实施方式,切换绘图模式的手势操作包括:According to a preferred embodiment of the present invention, the gesture operation of switching the drawing mode includes:
点击用户切换绘图模式的功能按键。Click the function button for the user to switch the drawing mode.
根据本发明一优选实施方式,该方法还包括:在绘图模式下对监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作;其中所述过滤包括:According to a preferred embodiment of the present invention, the method further comprises: filtering the monitored drawing gesture operation in the drawing mode, and retaining only valid drawing gesture operations; wherein the filtering comprises:
过滤掉超出绘制范围的手势,和/或,过滤掉不符合预设绘图手势类型的手势。Filter out gestures that are out of the drawing range, and/or filter out gestures that do not match the preset drawing gesture type.
根据本发明一优选实施方式,所述有效的绘图手势操作包括:绘制线条的手势操作或者修改已绘制线条的手势操作。According to a preferred embodiment of the present invention, the effective drawing gesture operation includes a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
根据本发明一优选实施方式,所述绘制线条的手势操作包括:以短按开始的滑动手势;According to a preferred embodiment of the present invention, the gesture operation of drawing a line includes: a sliding gesture that starts with a short press;
所述修改已绘制线条的手势操作包括:以长按已绘制线条上的点开始的滑动手势。The gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
根据本发明一优选实施方式,所述绘制线条的手势操作对应的各目 标点为所述以短按开始的滑动手势对应的滑动轨迹上的各点;According to a preferred embodiment of the present invention, the respective operations of the gesture operation for drawing a line Punctuation is each point on the sliding track corresponding to the sliding gesture starting with a short press;
所述修改已绘制线条的手势操作对应的各目标点为所述以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
根据本发明一优选实施方式,以长按已绘制线条的端点开始的滑动手势引起已绘制线条的倾斜角度或长度的变更;According to a preferred embodiment of the present invention, the sliding gesture starting with the long end of the drawn line ends causes a change in the tilt angle or length of the drawn line;
以长按已绘制线条的中部点开始的滑动手势引起已绘制线条的位置的变更。A swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
根据本发明一优选实施方式,该方法还包括:According to a preferred embodiment of the present invention, the method further includes:
如果在非绘图模式下监听到有效的手势操作,则依据所述手势操作所获取的新的业务数据,对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理;If a valid gesture operation is detected in the non-drawing mode, the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system are adapted according to the new service data acquired by the gesture operation;
将适配处理后已绘制线条上的点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;Mapping the position coordinates of the points on the drawn line after the adaptation process in the coordinate system used by the operating system to the coordinate system used by the graphic drawing tool;
调用所述图形绘制工具对所述适配处理后已绘制线条上的点进行绘制和展示。The graphics drawing tool is invoked to draw and display points on the drawn line after the adaptation process.
根据本发明一优选实施方式,所述有效的手势操作包括:滑动屏幕操作、放大或缩小操作。According to a preferred embodiment of the present invention, the effective gesture operation comprises: a sliding screen operation, an enlargement or reduction operation.
根据本发明一优选实施方式,所述对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理包括:According to a preferred embodiment of the present invention, the adapting the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system includes:
利用记录的所述已绘制线条与业务数据之间的相对位置,在获取所述新的业务数据后,依据应用界面上业务数据在操作***所采用坐标系中的位置坐标确定已绘制线条在操作***所采用坐标系中的位置坐标。 Using the recorded relative position between the drawn line and the business data, after acquiring the new business data, determining the drawn line in operation according to the position coordinates of the business data on the application interface in the coordinate system adopted by the operating system The position coordinates in the coordinate system used by the system.
根据本发明一优选实施方式,该方法还包括:According to a preferred embodiment of the present invention, the method further includes:
记录所述各目标点与当前应用界面上显示的业务数据之间的相对位置;Recording a relative position between each target point and service data displayed on the current application interface;
对记录的所述相对位置信息进行持久化存储。The relative position information of the record is persistently stored.
根据本发明一优选实施方式,该方法还包括:According to a preferred embodiment of the present invention, the method further includes:
当所述绘图工具所在的应用被启动时,获取持久化存储的相对位置信息;Obtaining relative location information of the persistent storage when the application in which the drawing tool is located is started;
依据当前应用界面展示的业务数据以及获取的相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标;Determining the position coordinates of the drawn lines within the current application interface display range according to the business data displayed by the current application interface and the obtained relative position information;
将确定的位置坐标映射到所述图形绘制工具的坐标系中;Mapping the determined position coordinates into a coordinate system of the graphic drawing tool;
调用所述图形绘制工具对在当前应用界面展示范围内的已绘制线条进行绘制和展示。The graphic drawing tool is invoked to draw and display the drawn lines within the scope of the current application interface display.
根据本发明一优选实施方式,所述绘图工具所在的应用包括:股票类应用。According to a preferred embodiment of the present invention, the application of the drawing tool includes: a stock application.
本发明还提供了一种绘图工具的实现装置,该装置包括:The invention also provides an implementation device of a drawing tool, the device comprising:
监听单元,用于监听用户的手势操作;a listening unit for monitoring a user's gesture operation;
获取单元,用于如果所述监听单元在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标;An acquiring unit, configured to acquire, when the listening unit monitors a valid drawing gesture operation in the drawing mode, acquire position coordinates of each target point corresponding to the drawing gesture operation in a coordinate system adopted by the operating system;
映射单元,用于将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;a mapping unit, configured to map position coordinates of the target points in a coordinate system adopted by the operating system to a coordinate system used by the graphic drawing tool;
调用单元,用于调用所述图形绘制工具对所述各目标点进行绘制和展示。 The calling unit is configured to invoke the graphic drawing tool to draw and display the target points.
根据本发明一优选实施方式,该装置还包括:According to a preferred embodiment of the present invention, the device further comprises:
切换单元,用于当所述监听单元在非绘图模式下监听到切换绘图模式的手势操作时,切换至绘图模式;或者,当所述监听单元在绘图模式下监听到切换绘图模式的手势操作时,切换至非绘图模式。a switching unit, configured to switch to a drawing mode when the monitoring unit monitors a gesture operation of switching the drawing mode in the non-drawing mode; or when the monitoring unit monitors the gesture operation of switching the drawing mode in the drawing mode , switch to non-drawing mode.
根据本发明一优选实施方式,切换绘图模式的手势操作包括:According to a preferred embodiment of the present invention, the gesture operation of switching the drawing mode includes:
点击用户切换绘图模式的功能按键。Click the function button for the user to switch the drawing mode.
根据本发明一优选实施方式,该装置还包括:According to a preferred embodiment of the present invention, the device further comprises:
过滤单元,用于在绘图模式下对所述监听单元监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作;其中所述过滤包括:a filtering unit, configured to filter the drawing gesture operation monitored by the monitoring unit in the drawing mode, and only retain a valid drawing gesture operation; wherein the filtering comprises:
过滤掉超出绘制范围的手势,和/或,过滤掉不符合预设绘图手势类型的手势。Filter out gestures that are out of the drawing range, and/or filter out gestures that do not match the preset drawing gesture type.
根据本发明一优选实施方式,所述有效的绘图手势操作包括:绘制线条的手势操作或者修改已绘制线条的手势操作。According to a preferred embodiment of the present invention, the effective drawing gesture operation includes a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
根据本发明一优选实施方式,所述绘制线条的手势操作包括:以短按开始的滑动手势;According to a preferred embodiment of the present invention, the gesture operation of drawing a line includes: a sliding gesture that starts with a short press;
所述修改已绘制线条的手势操作包括:以长按已绘制线条上的点开始的滑动手势。The gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
根据本发明一优选实施方式,所述绘制线条的手势操作对应的各目标点为所述以短按开始的滑动手势对应的滑动轨迹上的各点;According to a preferred embodiment of the present invention, each target point corresponding to the gesture operation for drawing a line is a point on the sliding track corresponding to the sliding gesture that starts with a short press;
所述修改已绘制线条的手势操作对应的各目标点为所述以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
根据本发明一优选实施方式,以长按已绘制线条的端点开始的滑动 手势引起已绘制线条的倾斜角度或长度的变更;According to a preferred embodiment of the invention, the sliding begins with the long end of the drawn line Gestures cause changes in the angle or length of the drawn line;
以长按已绘制线条的中部点开始的滑动手势引起已绘制线条的位置的变更。A swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
根据本发明一优选实施方式,该装置还包括:According to a preferred embodiment of the present invention, the device further comprises:
适配单元,用于如果所述监听单元在非绘图模式下监听到有效的手势操作,则依据所述手势操作所获取的新的业务数据,对已绘制线条上的点在操作***中的位置坐标进行适配处理;And an adapting unit, configured to: if the monitoring unit monitors a valid gesture operation in the non-drawing mode, according to the new service data acquired by the gesture operation, the position of the point on the drawn line in the operating system Coordinates are processed;
所述映射单元,还用于将适配处理后已绘制线条上的点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;The mapping unit is further configured to map the position coordinates of the points on the drawn line after the adaptation process in the coordinate system used by the operating system to the coordinate system used by the graphic drawing tool;
所述调用单元,还用于调用所述图形绘制工具对所述适配处理后已绘制线条上的点进行绘制和展示。The calling unit is further configured to invoke the graphic drawing tool to draw and display points on the drawn line after the adaptation process.
根据本发明一优选实施方式,所述有效的手势操作包括:滑动屏幕操作、放大或缩小操作。According to a preferred embodiment of the present invention, the effective gesture operation comprises: a sliding screen operation, an enlargement or reduction operation.
根据本发明一优选实施方式,所述适配单元,具体用于利用记录的所述已绘制线条与业务数据之间的相对位置,在获取所述新的业务数据后,依据应用界面上业务数据在操作***所采用坐标系中的位置坐标确定已绘制线条在操作***所采用坐标系中的位置坐标。According to a preferred embodiment of the present invention, the adapting unit is specifically configured to utilize the relative position between the drawn line and the service data, and after acquiring the new service data, according to the service data on the application interface. The position coordinates in the coordinate system used by the operating system determine the position coordinates of the drawn line in the coordinate system used by the operating system.
根据本发明一优选实施方式,该装置还包括:According to a preferred embodiment of the present invention, the device further comprises:
存储单元,用于记录所述各目标点与当前应用界面上显示的业务数据之间的相对位置;对记录的所述相对位置信息进行持久化存储。a storage unit, configured to record a relative position between the target points and service data displayed on the current application interface; and store the relative position information of the record for persistent storage.
根据本发明一优选实施方式,该装置还包括:According to a preferred embodiment of the present invention, the device further comprises:
启动处理单元,用于当所述绘图工具所在的应用被启动时,获取持久化存储的相对位置信息;依据当前应用界面展示的业务数据以及获取 的相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标;And activating a processing unit, configured to acquire relative location information of the persistent storage when the application where the drawing tool is started; and the service data and the information displayed according to the current application interface Relative position information, determining the position coordinates of the drawn line within the current application interface display range;
所述映射单元,还用于将所述启动处理单元确定的位置坐标映射到所述图形绘制工具所采用的坐标系中;The mapping unit is further configured to map location coordinates determined by the startup processing unit to a coordinate system used by the graphics rendering tool;
所述调用单元,还用于调用所述图形绘制工具对所述在当前应用界面展示范围内的已绘制线条进行绘制和展示。The calling unit is further configured to invoke the graphic drawing tool to draw and display the drawn lines in the display range of the current application interface.
根据本发明一优选实施方式,所述图形绘制工具所在的应用包括:股票类应用。According to a preferred embodiment of the present invention, the application of the graphic drawing tool includes: a stock application.
由以上技术方案可以看出,本发明通过对用户有效绘图手势操作的监听,将绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中,并调用图形绘制工具对各目标点进行绘制和展示,从而实现用户通过手势操作方便地在移动设备上进行绘图。It can be seen from the above technical solution that the present invention maps the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool by monitoring the user's effective drawing gesture operation. In the middle, and call the graphics drawing tool to draw and display each target point, so that the user can conveniently draw on the mobile device through gestures.
附图说明DRAWINGS
图1为本发明实施例提供的主要方法流程图;FIG. 1 is a flowchart of a main method according to an embodiment of the present invention;
图2a为本发明实施例提供的非绘图模式下应用界面的实例图;2a is a schematic diagram of an application interface in a non-drawing mode according to an embodiment of the present invention;
图2b为本发明实施例提供的绘图模式下应用界面的实例图;2b is a schematic diagram of an application interface in a drawing mode according to an embodiment of the present invention;
图3为本发明实施例提供的绘制线条的方法流程图;FIG. 3 is a flowchart of a method for drawing a line according to an embodiment of the present invention;
图4a为本发明实施例提供的绘制线条的实例图;4a is a diagram showing an example of drawing a line according to an embodiment of the present invention;
图4b为本发明实施例提供的一个修改已绘制线条的实例图;4b is a diagram showing an example of modifying a drawn line according to an embodiment of the present invention;
图4c为本发明实施例提供的另一个修改已绘制线条的实例图;4c is a diagram showing another example of modifying a drawn line according to an embodiment of the present invention;
图4d为本发明实施例提供的删除已绘制线条的实例图;4d is a diagram showing an example of deleting a drawn line according to an embodiment of the present invention;
图5为本发明实施例提供的修改已绘制线条的方法流程图; FIG. 5 is a flowchart of a method for modifying a drawn line according to an embodiment of the present invention;
图6为本发明实施例提供的非绘图模式下的处理方法流程图;FIG. 6 is a flowchart of a processing method in a non-drawing mode according to an embodiment of the present invention;
图7为本发明实施例提供的启动并展示应用界面的流程图;FIG. 7 is a flowchart of starting and displaying an application interface according to an embodiment of the present invention;
图8为本发明实施例提供的装置结构图。FIG. 8 is a structural diagram of a device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描述。The present invention will be described in detail below with reference to the drawings and specific embodiments.
本发明提供的方法主要应用于具有触摸屏幕的移动终端,包括但不限于智能手机、平板电脑、PDA(个人数字助理)等。The method provided by the present invention is mainly applied to a mobile terminal having a touch screen, including but not limited to a smartphone, a tablet, a PDA (Personal Digital Assistant), and the like.
其中,移动终端在架构上包含一些基本组件,如总线、处理***、存储***、一个或多个输入/输出***、和通信接口等。总线可以包括一个或多个导线,用来实现移动终端各组件之间的通信。处理***包括各类型的用来执行指令、处理进程或线程的处理器或微处理器。存储***可以包括存储动态信息的随机访问存储器(RAM)等动态存储器,和存储静态信息的只读存储器(ROM)等静态存储器,以及包括磁或光学记录介质与相应驱动的大容量存储器。输入***供用户输入信息到移动终端,如手写笔、触摸屏幕、声音识别***、或生物测定***等。输出***包括用来输出信息的触摸屏幕、扬声器等。通信接口用来使移动终端与其它设备进行通信。通信接口之间可通过有线连接、无线连接、或光连接连接到网络中。Among them, the mobile terminal includes some basic components in the architecture, such as a bus, a processing system, a storage system, one or more input/output systems, and a communication interface. The bus may include one or more wires for enabling communication between components of the mobile terminal. A processing system includes various types of processors or microprocessors for executing instructions, processing processes, or threads. The storage system may include a dynamic memory such as a random access memory (RAM) that stores dynamic information, and a static memory such as a read only memory (ROM) that stores static information, and a large-capacity memory including a magnetic or optical recording medium and a corresponding drive. The input system allows the user to input information to the mobile terminal, such as a stylus, a touch screen, a voice recognition system, or a biometric system. The output system includes a touch screen, a speaker, and the like for outputting information. The communication interface is used to enable the mobile terminal to communicate with other devices. The communication interfaces can be connected to the network through a wired connection, a wireless connection, or an optical connection.
另外,移动终端上包含有用来管理***资源、控制其它程序运行的操作***软件,以及用来实现特定功能模块的应用软件。In addition, the mobile terminal includes operating system software for managing system resources, controlling the running of other programs, and application software for implementing specific functional modules.
本发明提供的绘图工具的实现方法和装置可以搭载于移动终端上的多种应用软件,诸如股票类应用软件、天气类应用软件、图标类应用软 件等等。使用本发明提供的绘图工具的实现方法和装置可以在上述应用软件所提供数据的基础上进行线条类的绘制,从而帮助用户进行数据分析。在本发明的实施例中以股票类应用软件为例进行描述,其他应用软件的场景类似。The method and device for implementing the drawing tool provided by the present invention can be mounted on a plurality of application software on a mobile terminal, such as stock application software, weather application software, and icon application soft. Pieces and so on. The implementation method and apparatus of the drawing tool provided by the present invention can perform line drawing on the basis of the data provided by the application software, thereby helping the user to perform data analysis. In the embodiment of the present invention, the stock application software is taken as an example for description, and the scenarios of other application software are similar.
图1为本发明实施例提供的主要方法流程图,如图1中所示,该方法可以包括以下步骤:FIG. 1 is a flowchart of a main method according to an embodiment of the present invention. As shown in FIG. 1, the method may include the following steps:
在101中,监听用户的手势操作。In 101, the user's gesture operation is monitored.
在102中,如果在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标。In 102, if a valid drawing gesture operation is monitored in the drawing mode, the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system are acquired.
在本发明实施例中,用户当前正在使用的应用(后续简称为当前应用)由于搭载了本发明提供的绘图工具,可以存在两种模式之间的切换:绘图模式和非绘图模式。为了保证当前应用的已有功能作为其主要功能,例如股票类应用软件其主要功能还是进行股票信息的展示,因此默认处于非绘图模式,即当前应用在启动后默认处于非绘图模式。In the embodiment of the present invention, the application currently being used by the user (hereinafter referred to as the current application) may be switched between two modes by using the drawing tool provided by the present invention: a drawing mode and a non-drawing mode. In order to ensure the existing functions of the current application as its main function, for example, the main function of the stock application software is to display the stock information, so the default is in the non-drawing mode, that is, the current application is in the non-drawing mode by default after startup.
从非绘图模式到绘图模式的切换可以由用户的手势操作来触发。即在非绘图模式下如果监听到切换绘图模式的手势操作时,切换至绘图模式。在绘图模式下监听到切换绘图模式的手势操作时,切换至非绘图模式。Switching from non-drawing mode to drawing mode can be triggered by the user's gesture operation. That is, in the non-drawing mode, if the gesture operation of switching the drawing mode is monitored, the mode is switched to the drawing mode. When listening to the gesture operation of switching the drawing mode in the drawing mode, switch to the non-drawing mode.
其中切换绘图模式的手势操作可以预先设定,只要与当前应用以及移动终端的操作***已有功能的手势操作相区别即可。在本发明实施例中举一个切换绘图模式的手势操作实例,如图2a中所示,在当前应用中进行股票数据的展示时,界面上存在一个切换绘图模式的功能按钮,即图中标示为“画线”的按钮,当用户需要进行绘图操作时,通过点击该 功能按钮从非绘图模式切换至绘图模式。当切换至绘图模式时,上述功能按钮变为“返回”,如图2b中所示,当用户再次点击该功能按钮时,切换回非绘图模式。The gesture operation of switching the drawing mode may be preset, as long as it is different from the current application and the gesture operation of the operating system of the mobile terminal. In the embodiment of the present invention, a gesture operation example for switching the drawing mode is shown. As shown in FIG. 2a, when the stock data is displayed in the current application, there is a function button for switching the drawing mode on the interface, that is, the figure is marked as "Draw a line" button, when the user needs to perform a drawing operation, by clicking on the The function button switches from non-drawing mode to drawing mode. When switching to the drawing mode, the above function button becomes "return", as shown in Fig. 2b, when the user clicks the function button again, it switches back to the non-drawing mode.
这里所谓的“有效”指的是,需要对监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作,具体将在后续实施例中描述。The term "effective" as used herein refers to the need to filter the intercepted drawing gesture operations, leaving only valid drawing gesture operations, as will be described in the subsequent embodiments.
另外,在本发明实施例中,有效的绘图手势操作可以包括但不限于:绘制线条的手势操作、修改已绘制线条的手势操作以及删除已绘制线条的手势操作。In addition, in the embodiment of the present invention, effective drawing gesture operations may include, but are not limited to, a gesture operation of drawing a line, a gesture operation of modifying a drawn line, and a gesture operation of deleting a drawn line.
在103中,将各目标点在操作***所采用坐标系中的位置坐标转换为在图形绘制工具所采用的坐标系中的位置坐标。In 103, the position coordinates of each target point in the coordinate system employed by the operating system are converted into position coordinates in the coordinate system employed by the graphic drawing tool.
首先会对102获取的绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标进行记录,以Android操作***为例,以屏幕左上角为原点,记录用户手势操作在屏幕上触碰的点的x,y坐标的位置。Firstly, the target coordinates corresponding to the drawing gesture operation acquired by 102 are recorded in the coordinate system in the coordinate system used by the operating system. Taking the Android operating system as an example, the user's gesture operation is touched on the screen by taking the upper left corner of the screen as the origin. The position of the x, y coordinate of the point touched.
在本发明实施例中采用的图形绘制工具可以是但不限于OpenGL,也就是说,OpenGL可以向图形绘制工具提供接口,供图形绘制工具进行调用,从而完成对目标点的绘制和显示。The graphic drawing tool used in the embodiment of the present invention may be, but not limited to, OpenGL, that is, OpenGL may provide an interface to the graphic drawing tool for the graphic drawing tool to call, thereby completing the drawing and displaying of the target point.
由于诸如OpenGL等图形绘制工具的坐标原点与Android***的坐标原点不同,例如OpenGL的坐标系原点在左下角,因此需要将目标点的位置坐标进行转换,转换为OpenGL等图形绘制工具所采用的坐标系中的位置坐标。Since the coordinate origin of a graphics drawing tool such as OpenGL is different from the coordinate origin of the Android system, for example, the origin of the coordinate system of OpenGL is in the lower left corner, so the position coordinates of the target point need to be converted and converted into coordinates used by a graphic drawing tool such as OpenGL. The position coordinates in the system.
在104中,调用图形绘制工具对各目标点进行绘制和展示。In 104, a graphical drawing tool is invoked to draw and display each target point.
下面通过几个实施例对本发明涉及的几种使用场景进行详细描述。Several usage scenarios involved in the present invention are described in detail below through several embodiments.
图3为本发明实施例提供的绘制线条的方法流程图,在本实施例中假 设用户已经将当前应用切换到绘图模式下,用户要在该绘图模式下进行线条的绘制,如图3中所示,该过程可以具体包括以下步骤:FIG. 3 is a flowchart of a method for drawing a line according to an embodiment of the present invention. Let the user switch the current application to the drawing mode, and the user wants to draw the line in the drawing mode. As shown in FIG. 3, the process may specifically include the following steps:
在301中,监听用户的手势操作。In 301, the user's gesture operation is monitored.
在302中,在绘图模式下将监听到的手势操作进行过滤。In 302, the monitored gesture operation is filtered in the drawing mode.
在本步骤中,可以预先设置绘图模式下的绘制范围,即在当前应用的界面上预设一个范围,只有在该范围内进行的绘图手势才有效,超出该范围的绘图手势将被过滤掉。In this step, the drawing range in the drawing mode may be preset, that is, a range is preset on the interface of the current application, and only the drawing gestures performed within the range are valid, and the drawing gestures beyond the range are filtered out.
另外,也可以预先设置一些有效的绘制手势类型,这些手势类型可以是能够绘制出直线、折线、曲线等的手势类型,对于不符合这些绘制手势类型的手势将被过滤掉。In addition, some effective drawing gesture types may also be preset. These gesture types may be gesture types capable of drawing straight lines, polylines, curves, etc., and gestures that do not conform to these drawing gesture types will be filtered out.
在303中,将监听到的绘制线条的手势操作对应的各目标点在操作***的坐标系的位置坐标转换为在OpenGL的坐标系的位置坐标。In 303, the position coordinates of the coordinate system of the operating system are converted to the position coordinates of the coordinate system of the OpenGL for each target point corresponding to the gesture operation of the monitored drawing line.
本实施例中,如果监听到以短按开始的滑动手势,且该滑动手势是经过302的过滤后保留下来的,那么可以确定监听到绘制线条的手势操作,其滑动轨迹上的各点即为上述的目标点。In this embodiment, if a sliding gesture starting with a short press is detected, and the sliding gesture is retained after being filtered by 302, it can be determined that the gesture operation of the drawn line is monitored, and each point on the sliding track is The above target points.
以Android操作***为例,由于操作***的坐标系是以左上角为坐标原点的,且以像素为单位,而OpenGL是以中心点为坐标原点且以整个视图的高度为单位,因此需要将各目标点在Android操作***的坐标系的位置坐标转换为在OpenGL的坐标系的位置坐标。如果某目标点在Android操作***的坐标系的位置坐标为(xPosi,yPosi),那么转换后得到的在OpenGL的坐标系的位置坐标(x,y)为:Taking the Android operating system as an example, since the coordinate system of the operating system is the coordinate origin of the upper left corner and is in units of pixels, and OpenGL uses the center point as the coordinate origin and the height of the entire view, it is necessary to The target point is converted to the position coordinate of the coordinate system of the OpenGL coordinate system in the coordinate system of the Android operating system. If the position coordinate of a target point in the coordinate system of the Android operating system is (xPosi, yPosi), then the position coordinates (x, y) of the coordinate system obtained in the OpenGL after conversion are:
Figure PCTCN2015098081-appb-000001
Figure PCTCN2015098081-appb-000001
Figure PCTCN2015098081-appb-000002
Figure PCTCN2015098081-appb-000002
其中,oriCanvasWidth为视图宽度,oriCanvasHeight为视图高度,widthRatio为OpenGL的宽度系数,heightRatio为OpenGL的高度系数。Where oriCanvasWidth is the view width, oriCanvasHeight is the view height, widthRatio is the OpenGL width coefficient, and heightRatio is the OpenGL height coefficient.
在304中,调用OpenGL对各目标点进行绘制和展示。In 304, OpenGL is called to draw and display each target point.
在305中,记录上述各目标点与当前应用界面上显示的业务数据之间的相对位置。In 305, the relative position between each of the above target points and the business data displayed on the current application interface is recorded.
由于各目标点在Android操作***所采用坐标系中的位置坐标是一个绝对位置坐标,而业务数据实际上是逐渐更新的,以股票类软件为例,通常显示的是k线数据,k线数据是在时间轴方向上不断更新的,如图2b中所示,当前界面显示的最新业务数据为12月2日的k线数据,但等到明天,显示的最新业务数据就变成12月3日的k线数据,这就会造成图像整体向左移动。如果仅仅记录各目标点在Android操作***所采用坐标系中的位置坐标(即绝对位置坐标),那么对于更新后的业务数据则不再适用。Since the position coordinates of each target point in the coordinate system adopted by the Android operating system are an absolute position coordinate, and the business data is actually updated gradually, taking stock software as an example, k-line data and k-line data are usually displayed. It is continuously updated in the direction of the time axis. As shown in Figure 2b, the latest business data displayed on the current interface is the k-line data on December 2, but until tomorrow, the latest business data displayed becomes December 3. The k-line data, which causes the image to move to the left as a whole. If only the position coordinates (ie, absolute position coordinates) of each target point in the coordinate system used by the Android operating system are recorded, the updated business data is no longer applicable.
为了克服上述的问题,使得当业务数据发生更新时,仍能够正确地显示用户绘制的线条,需要记录上述各目标点与当前应用界面上显示的业务数据之间的相对位置。In order to overcome the above problem, when the business data is updated, the lines drawn by the user can still be correctly displayed, and the relative position between the target points and the business data displayed on the current application interface needs to be recorded.
在306中,对记录的上述相对位置信息进行持久化存储。At 306, the recorded relative position information is persistently stored.
本步骤中的持久化存储指的是,该存储在当前应用被关闭后仍保留,除非用户手动删除该持久化存储的内容,否则该持久化存储的内容将一直存在。The persistent storage in this step means that the storage remains after the current application is closed, and the content of the persistent storage will always exist unless the user manually deletes the content of the persistent storage.
通过图3中所示流程,用户可以在当前应用界面上绘制线条,用户可 以在图2b所示的界面上绘制出线条,结果可以如图4a中所示。需要说明的是,对于线条的绘制并不限于图4a中所示的直线段,也可以是折线或曲线等。Through the process shown in Figure 3, the user can draw lines on the current application interface, the user can The lines are drawn on the interface shown in Figure 2b and the results can be as shown in Figure 4a. It should be noted that the drawing of the line is not limited to the straight line segment shown in FIG. 4a, and may be a broken line or a curved line or the like.
图5为本发明实施例提供的修改已绘制线条的方法流程图,在本实施例中假设用户已经将当前应用切换到绘图模式下,用户要在该绘图模式下对于已绘制的线条进行修改,如图5中所示,该过程可以包括以下步骤:FIG. 5 is a flowchart of a method for modifying a drawn line according to an embodiment of the present invention. In this embodiment, it is assumed that a user has switched the current application to a drawing mode, and the user needs to modify the drawn line in the drawing mode. As shown in Figure 5, the process can include the following steps:
在501中,监听用户的手势操作。In 501, the user's gesture operation is monitored.
在502中,在绘图模式下将监听到的手势操作进行过滤。In 502, the monitored gesture operation is filtered in the drawing mode.
与图3中步骤302类似的,可以预先对绘制范围和绘图手势类型进行设定,如果用户修改已有线条的手势操作范围超出绘制范围,或者修改已有线条的手势类型不符合预设的绘图手势类型,则将其过滤掉。Similar to step 302 in FIG. 3, the drawing range and the drawing gesture type may be set in advance, if the gesture range of the user modifying the existing line is out of the drawing range, or the gesture type of modifying the existing line does not conform to the preset drawing. Gesture type, then filter it out.
在503中,确定对已绘制线条的手势操作类型,如果是删除已绘制线条的操作,则执行504;如果是修改已绘制线条的操作,执行505。In 503, a gesture operation type for the drawn line is determined, and if it is an operation to delete the drawn line, 504 is performed; if it is an operation to modify the drawn line, 505 is performed.
在本实施例中,可以预先设置对已绘制线条的手势操作类型,可以包括但不限于:修改已绘制线条的样式或位置,删除已绘制线条,等等。另外,对于各修改已绘制线条的手势操作同样可以预先设置。例如以长按已绘制线条的端点开始的滑动手势设置为引起已绘制线条的倾斜角度或长度的变更,即用户通过按住已绘制线条的一个端点可以实现对已绘制线条的倾斜角度或长度的拖拽。再例如,以长按已绘制线条的中部点开始的滑动手势引起已绘制线条的位置的变更,即用户通过按住已绘制线条的中部位置可以移动该已绘制线条至用户手指离开屏幕的位置。In this embodiment, the type of gesture operation on the drawn line may be set in advance, and may include, but is not limited to, modifying the style or position of the drawn line, deleting the drawn line, and the like. In addition, the gesture operation for modifying each of the drawn lines can also be set in advance. For example, a swipe gesture starting with a long press of the end point of the drawn line is set to cause a change in the tilt angle or length of the drawn line, that is, the user can achieve the tilt angle or length of the drawn line by pressing and holding one end point of the drawn line. Drag and drop. As another example, a swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line, that is, the user can move the drawn line to the position where the user's finger leaves the screen by holding down the middle position of the drawn line.
再例如,将长按已绘制线条调出子菜单并选择子菜单上的删除选项设置为删除已绘制线条的手势操作,或者将选中已绘制线条后点击 界面上的删除按钮设置为删除已绘制线条的手势操作。前一种情况下,当用户长按已绘制线条时,在界面上可以弹出一个子菜单,在该子菜单中存在一个删除选项,当用户点选该删除选项时,删除该已绘制线条。在后一种情况下,在绘图模式下,界面上存在一个删除按钮,当用户以点击等方式选中已绘制线条后,如果再点击该删除按钮,则删除该已绘制线条。For another example, long press the drawn line to bring up the submenu and select the delete option on the submenu to set the gesture operation to delete the drawn line, or click on the drawn line and click The delete button on the interface is set to remove the gesture action of the drawn line. In the former case, when the user long presses the drawn line, a submenu pops up on the interface, and there is a delete option in the submenu, and when the user clicks the delete option, the drawn line is deleted. In the latter case, in the drawing mode, there is a delete button on the interface. When the user selects the drawn line by clicking or the like, if the delete button is clicked again, the drawn line is deleted.
在504中,删除已绘制线条,OpenGL就不会展示已删除的线条,结束对本次手势操作的处理。In 504, the deleted line is deleted, and OpenGL does not display the deleted line, and ends the processing of the gesture operation.
在505中,获取修改已绘制线条的手势操作对应的各目标点在Android操作***所采用坐标系中的位置坐标。In 505, the position coordinates of each target point corresponding to the gesture operation for modifying the drawn line in the coordinate system adopted by the Android operating system are obtained.
修改已绘制线条的手势操作对应的各目标点可以是上述以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Each target point corresponding to the gesture operation of modifying the drawn line may be each point obtained by changing the drawn line style or position caused by the sliding gesture starting from the point on the drawn line.
在506中,将上述目标点在Android操作***所采用坐标系中的位置坐标转换为在OpenGL的坐标系的位置坐标。In 506, the position coordinates of the target point in the coordinate system adopted by the Android operating system are converted into the position coordinates of the coordinate system in OpenGL.
在507中,调用OpenGL对各目标点进行绘制和展示。In 507, OpenGL is called to draw and display each target point.
在508中,记录上述各目标点与当前应用界面上显示的业务数据之间的相对位置。At 508, the relative position between each of the target points and the business data displayed on the current application interface is recorded.
在509中,对记录的上述相对位置信息进行持久化存储。In 509, the above-described relative position information of the record is persistently stored.
通过图5所示流程,用户可以在当前应用界面上对已绘制线条进行操作,例如用户可以对图4a中所示的其中一条直线段进行修改以下修改:Through the flow shown in FIG. 5, the user can operate the drawn line on the current application interface. For example, the user can modify one of the straight line segments shown in FIG. 4a with the following modifications:
第一种修改:按住直线段的一个端点进行拖拽,来改变该直线段的倾斜角度和/或长度,如图4b中所示。在图4b中,用户手指长按已绘制线 条的A端点并滑动至B点所示的位置,通过该拖拽就能够对线条的倾斜角度和长度进行修改,虚线段表示的是修改之前的已绘制线条,实线段表示的是修改之后的已绘制线条,粗箭头表示用户手指的滑动轨迹。The first modification: dragging and dropping an end point of a straight line segment to change the tilt angle and/or length of the straight line segment, as shown in Figure 4b. In Figure 4b, the user's finger long presses the drawn line The end point of the strip is swiped to the position shown by point B. The tilt angle and length of the line can be modified by the drag, the dotted line segment represents the drawn line before the modification, and the solid line segment represents the modified line. Lines have been drawn, and thick arrows indicate the sliding trajectory of the user's finger.
第二种修改:按住直线段的中部位置进行拖动,来改变该直线段的位置,如图4c中所示。在图4c中,用户手指长按已绘制线条的中部位置,从C点滑动至D点的位置,通过该滑动就能够将该直线段的位置进行移动。图中虚线段表示的是修改之前的已绘制线条,实线段表示的是修改之后的已绘制线条,粗箭头表示用户手指的滑动轨迹。The second modification: dragging the middle position of the straight line segment to change the position of the straight line segment, as shown in Figure 4c. In Fig. 4c, the user's finger presses the middle position of the drawn line, and slides from point C to position D, by which the position of the straight line can be moved. The dotted line in the figure indicates the drawn line before the modification, the solid line indicates the drawn line after the modification, and the thick arrow indicates the sliding track of the user's finger.
第三种修改:长按已绘制线条调出子菜单并选择子菜单上的删除选项,来删除已绘制线条。如图4d中,用户手指长按已绘制线条,界面上会弹出一个子菜单,子菜单中包括删除选项,当用户点击删除选项时,就能够删除该已绘制线条。The third modification: long press the drawn line to bring up the submenu and select the delete option on the submenu to delete the drawn line. As shown in Figure 4d, the user's finger presses the drawn line, and a submenu pops up on the interface. The submenu includes the delete option. When the user clicks the delete option, the drawn line can be deleted.
用户在进行绘图的过程中,可能会遇到这样的问题,由于屏幕较小,业务数据在显示时往往粒度很大,或者显示的业务数据有限,这就造成用户在绘制线条时常常不能准确定位,需要对屏幕上显示的业务数据进行缩放或移动。对于这种需求,需要用户切换到非绘图模式下进行。图6为本发明实施例提供的非绘图模式下的处理方法流程图,在本实施例中假设用户已经将当前应用切换到非绘图模式下,如图6中所示,该过程可以包括以下步骤:In the process of drawing, the user may encounter such a problem. Due to the small screen, the business data is often displayed in a large granularity, or the displayed business data is limited, which causes the user to often not accurately locate the line when drawing. , you need to scale or move the business data displayed on the screen. For this requirement, the user needs to switch to non-drawing mode. FIG. 6 is a flowchart of a processing method in a non-drawing mode according to an embodiment of the present invention. In this embodiment, it is assumed that a user has switched the current application to a non-drawing mode. As shown in FIG. 6, the process may include the following steps. :
在601中,监听用户的手势操作。In 601, the user's gesture operation is monitored.
在602中,对在非绘图模式下监听到的手势操作进行过滤。At 602, the gesture operations monitored in the non-plot mode are filtered.
同样,可以对非绘图模式下手势操作的区域范围和类型进行预先设置,对于超出上述区域范围和不符合上述类型的手势操作进行过滤,仅 保留有效的手势操作。Similarly, the range and type of the gesture operation in the non-drawing mode can be preset, and the gesture operations beyond the above range and not conforming to the above types can be filtered, only Keep valid gestures.
在603中,依据监听到的手势操作所获取的新的业务数据,对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理。In 603, according to the new business data acquired by the monitored gesture operation, the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system are adapted.
这里监听到的手势操作可以包括但不限于滑动屏幕操作、放大或缩小操作。The gesture operations monitored here may include, but are not limited to, a swipe screen operation, an enlargement or reduction operation.
如果是滑动屏幕操作,则当前应用需要依据该滑动屏幕操作获取新的业务数据,获取的业务数据依据滑动幅度确定。例如用户在如图4a所示的应用界面上(与图4a不同的是本操作处于非绘图模式下)向左滑动,假设该滑动幅度对应了一个星期的业务数据,则需要获取新一周的业务数据,即12月3日~12月9日的k线数据,使得屏幕上的业务数据统一向左移动一周,显示从9月6日~12月9日的k线数据。由于可能用户已经在该界面上绘制了线条,那么在移动屏幕后,也需要对已绘制线条的位置进行适配处理。If it is a sliding screen operation, the current application needs to obtain new business data according to the sliding screen operation, and the acquired business data is determined according to the sliding amplitude. For example, the user slides to the left on the application interface as shown in FIG. 4a (unlike FIG. 4a, the operation is in the non-drawing mode), and if the sliding amplitude corresponds to one week of business data, it is necessary to acquire a new week of business. The data, that is, the k-line data from December 3 to December 9, causes the business data on the screen to move uniformly to the left for one week, and displays the k-line data from September 6 to December 9. Since it is possible that the user has drawn a line on the interface, after moving the screen, it is also necessary to adapt the position of the drawn line.
如果是放大操作,则当前应用需要根据该放大操作的幅度获取更细粒度的业务数据。也就是说,屏幕上显示的业务数据范围变小了,但粒度更细了。同样,由于可能用户已经在该界面上绘制了线条,那么在移动屏幕后,也需要对已绘制线条的位置进行适配处理。If it is an enlargement operation, the current application needs to obtain finer-grained service data according to the magnitude of the amplification operation. That is to say, the range of business data displayed on the screen becomes smaller, but the granularity is finer. Also, since it is possible that the user has drawn a line on the interface, it is also necessary to adapt the position of the drawn line after moving the screen.
如果是缩小操作,则当前应用需要根据该缩小操作的幅度获取更大范围的业务数据,也就是说,屏幕上显示的业务数据范围变大了,但粒度更粗。这种情况同样需要对已绘制线条的位置进行适配处理。If it is a zoom-out operation, the current application needs to acquire a larger range of business data according to the magnitude of the zoom-out operation, that is, the range of business data displayed on the screen becomes larger, but the granularity is coarser. This situation also requires adaptation of the position of the drawn line.
由于上述操作所引起的业务数据获取是已有技术,不做详述,本步骤的重点在于对已绘制线条的位置进行的适配处理。其中适配处理实际上就是利用已经记录的已绘制线条与业务数据之间的相对位置,在进行 移动屏幕、放大或缩小等操作后,依据业务数据的位置坐标确定已绘制线条的位置坐标。该位置坐标是在操作***所采用坐标系中的位置坐标。Since the service data acquisition caused by the above operation is a prior art and will not be described in detail, the focus of this step is on the adaptation processing of the position of the drawn line. The adaptation process is actually using the relative position between the already drawn line drawn and the business data. After moving the screen, zooming in or out, etc., the position coordinates of the drawn line are determined according to the position coordinates of the business data. The position coordinates are position coordinates in the coordinate system employed by the operating system.
在604中,将适配处理后已绘制线条上的点在Android操作***所采用坐标系中的位置坐标映射到OpenGL的坐标系中。In 604, the position coordinates on the drawn line after the adaptation process are mapped to the coordinate system of the OpenGL in the coordinate system adopted by the Android operating system.
在605中,调用OpenGL对适配处理后已绘制线条上的点进行绘制和展示。In 605, OpenGL is called to draw and display the points on the drawn line after the adaptation process.
需要说明的是,采用图6所示方式对当前应用界面进行操作后,可以进一步结合图3或图5中所示流程。例如用户对屏幕进行放大后,根据更细粒度的业务数据,对已绘制的线条进行修改;用户对屏幕进行移动后,根据新获取的业务数据进行线条的进一步绘制,等等。It should be noted that after the current application interface is operated in the manner shown in FIG. 6, the process shown in FIG. 3 or FIG. 5 may be further combined. For example, after the user enlarges the screen, the drawn lines are modified according to the finer-grained business data; after the user moves the screen, the lines are further drawn according to the newly acquired business data, and the like.
从图3和图5所示流程中可以看到,对已绘制线条与业务数据之间的相对位置进行了持久化存储,那么当用户在下次启动并展示当前应用的界面时,执行的流程可以如图7所示,包括以下步骤:As can be seen from the flow shown in FIG. 3 and FIG. 5, the relative position between the drawn line and the business data is persistently stored, and when the user starts and displays the interface of the current application, the executed process can be executed. As shown in Figure 7, the following steps are included:
在701中,获取持久化存储的相对位置信息。In 701, relative location information of the persistent storage is obtained.
在702中,依据当前应用界面展示的业务数据以及上述相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标。In 702, according to the business data displayed by the current application interface and the relative position information, the position coordinates of the drawn lines within the current application interface display range are determined.
由于持久化存储的是已绘制线条与业务数据之间的相对位置,那么依据当前应用界面展示的业务数据的位置坐标(在操作***的坐标系中)就可以得到已绘制线条的位置坐标,对于得到的已绘制线条的位置坐标仅取在当前应用界面展示范围内的。Since the persistent storage stores the relative position between the drawn line and the business data, the position coordinates of the drawn line can be obtained according to the position coordinates of the business data displayed in the current application interface (in the coordinate system of the operating system). The position coordinates of the obtained drawn lines are only taken within the scope of the current application interface display.
在703中,将步骤702确定的位置坐标转换为在OpenGL的坐标系的位置坐标。In 703, the position coordinates determined in step 702 are converted to position coordinates in the coordinate system of OpenGL.
在704中,调用OpenGL对在当前应用界面展示范围内的已绘制线条 进行绘制和展示。In 704, call OpenGL to the drawn line within the scope of the current application interface display Draw and display.
通过图7所示流程,当用户完成线条的绘制后,如果下次打开该应用软件,仍可以显示已绘制的线条。Through the flow shown in Figure 7, after the user finishes drawing the line, if the application is opened next time, the drawn lines can still be displayed.
图8为本发明实施例提供的装置结构图,该装置可以设置于具有绘图需求的应用软件中,如图8中所示,该装置可以包括:监听单元01、获取单元02、映射单元03和调用单元04,还可以进一步包括切换单元05、过滤单元06、适配单元07、存储单元08和启动处理单元09。各组成单元的主要功能如下:FIG. 8 is a structural diagram of a device according to an embodiment of the present invention. The device may be disposed in an application software having a drawing requirement. As shown in FIG. 8, the device may include: a listening unit 01, an obtaining unit 02, a mapping unit 03, and The calling unit 04 may further include a switching unit 05, a filtering unit 06, an adaptation unit 07, a storage unit 08, and a startup processing unit 09. The main functions of each component are as follows:
监听单元01负责监听用户的手势操作。The listening unit 01 is responsible for monitoring the gesture operation of the user.
如果监听单元01在绘图模式下监听到有效的绘图手势操作,则获取单元02获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标。其中有效的绘图手势操作可以包括:绘制线条的手势操作、修改已绘制线条的手势操作或删除已绘制线条的手势操作。绘制线条的手势操作包括:以短按开始的滑动手势;修改已绘制线条的手势操作包括:以长按已绘制线条上的点开始的滑动手势。删除已绘制线条的手势操作包括:长按已绘制线条调出子菜单并选择子菜单上的删除选项的手势操作,或者,选中已绘制线条后点击界面上的删除按钮的手势操作。If the monitoring unit 01 monitors the effective drawing gesture operation in the drawing mode, the acquiring unit 02 acquires the position coordinates of the target points corresponding to the drawing gesture operation in the coordinate system adopted by the operating system. The effective drawing gesture operations may include: a gesture operation of drawing a line, a gesture operation of modifying a drawn line, or a gesture operation of deleting a drawn line. The gesture operation of drawing a line includes: a swipe gesture that starts with a short press; a gesture operation of modifying the drawn line includes: a swipe gesture that starts with a long press on a point on the drawn line. Gesture operations for deleting a drawn line include: long-pressing a gesture to call a submenu and selecting a delete option on the submenu, or selecting a gesture operation after the line has been drawn and clicking the delete button on the interface.
其中,绘制线条的手势操作对应的各目标点为以短按开始的滑动手势对应的滑动轨迹上的各点;修改已绘制线条的手势操作对应的各目标点为以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Wherein, each target point corresponding to the gesture operation of drawing a line is a point on the sliding track corresponding to the sliding gesture that starts with a short press; each target point corresponding to the gesture operation of modifying the drawn line is to long press on the drawn line Points obtained by changing the drawn line style or position caused by the swipe gesture at the beginning of the point.
以长按已绘制线条的端点开始的滑动手势引起已绘制线条的倾斜角度或长度的变更;以长按已绘制线条的中部点开始的滑动手势引起已绘 制线条的位置的变更。A swipe gesture that begins with a long press of the endpoint of the drawn line causes a change in the tilt angle or length of the drawn line; a swipe gesture that begins with a long point of the middle point of the drawn line causes the drawn Change the position of the line.
映射单元03负责将各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中。调用单元04负责调用图形绘制工具对各目标点进行绘制和展示。在本发明实施例中采用的图形绘制工具可以是但不限于OpenGL,也就是说,OpenGL可以向图形绘制工具提供接口,供图形绘制工具进行调用,从而完成对目标点的绘制和显示。The mapping unit 03 is responsible for mapping the position coordinates of each target point in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool. The calling unit 04 is responsible for calling the graphics drawing tool to draw and display the target points. The graphic drawing tool used in the embodiment of the present invention may be, but not limited to, OpenGL, that is, OpenGL may provide an interface to the graphic drawing tool for the graphic drawing tool to call, thereby completing the drawing and displaying of the target point.
搭载了本装置的应用软件可以在两种模式之间切换,即绘图模式和非绘图模式之间的切换,该切换由切换单元05完成。具体地,当监听单元01在非绘图模式下监听到切换绘图模式的手势操作时,切换单元05切换至绘图模式;或者,当监听单元01在绘图模式下监听到切换绘图模式的手势操作时,切换单元05切换至非绘图模式。The application software equipped with the device can switch between the two modes, that is, the switching between the drawing mode and the non-plot mode, which is performed by the switching unit 05. Specifically, when the listening unit 01 monitors the gesture operation of switching the drawing mode in the non-drawing mode, the switching unit 05 switches to the drawing mode; or, when the listening unit 01 monitors the gesture operation of switching the drawing mode in the drawing mode, The switching unit 05 switches to the non-drawing mode.
其中,其中切换绘图模式的手势操作可以预先设定,只要与当前应用以及移动终端的操作***已有功能的手势操作相区别即可。例如可以采用点击用户切换绘图模式的功能按键。The gesture operation in which the drawing mode is switched may be preset, as long as it is different from the current application and the gesture operation of the operating system of the mobile terminal. For example, a function button that clicks the user to switch the drawing mode can be used.
过滤单元06负责在绘图模式下对监听单元01监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作;其中过滤可以包括但不限于:过滤掉超出绘制范围的手势,和/或,过滤掉不符合预设绘图手势类型的手势。The filtering unit 06 is responsible for filtering the drawing gesture operation monitored by the monitoring unit 01 in the drawing mode, and only retains the effective drawing gesture operation; wherein the filtering may include, but is not limited to, filtering out the gesture beyond the drawing range, and/or filtering A gesture that does not match the preset drawing gesture type.
如果监听单元01在非绘图模式下监听到有效的手势操作,该有效的手势操作可以包括滑动屏幕操作、放大或缩小操作等,则适配单元07可以依据手势操作所获取的新的业务数据,对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理。相应地,映射单元03将适配处理后已绘制线条上的点在操作***所采用坐标系中的位置坐标映射 到图形绘制工具的坐标系中。调用单元04调用图形绘制工具对适配处理后已绘制线条上的点进行绘制和展示。If the monitoring unit 01 monitors a valid gesture operation in the non-drawing mode, the effective gesture operation may include a sliding screen operation, an enlargement or reduction operation, etc., the adaptation unit 07 may operate the acquired new service data according to the gesture. The position coordinates of the points on the drawn line are adapted in the coordinate system used by the operating system. Correspondingly, the mapping unit 03 will adapt the position coordinate mapping of the points on the drawn line after processing in the coordinate system adopted by the operating system. Go to the coordinate system of the drawing tool. The calling unit 04 calls the graphics drawing tool to draw and display the points on the drawn lines after the adaptation process.
具体地,适配单元07可以利用记录的已绘制线条与业务数据之间的相对位置,在获取新的业务数据后,依据应用界面上业务数据在操作***所采用坐标系中的位置坐标确定已绘制线条在操作***所采用坐标系中的位置坐标。Specifically, the adapting unit 07 can utilize the relative position between the recorded line drawn and the service data, and after acquiring the new service data, determine the position coordinate in the coordinate system adopted by the operating system according to the service data on the application interface. Draws the position coordinates of the line in the coordinate system used by the operating system.
存储单元08负责记录已绘制线条上各目标点与当前应用界面上显示的业务数据之间的相对位置;对记录的相对位置信息进行持久化存储。The storage unit 08 is responsible for recording the relative position between each target point on the drawn line and the business data displayed on the current application interface; and storing the relative position information of the record for persistent storage.
当绘图工具所在的应用被启动时,启动处理单元09可以获取持久化存储的相对位置信息;依据当前应用界面展示的业务数据以及获取的相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标。此时,映射单元03将启动处理单元09确定的位置坐标映射到图形绘制工具所采用的坐标系中。调用单元04调用图形绘制工具对在当前应用界面展示范围内的已绘制线条进行绘制和展示。When the application where the drawing tool is located is started, the startup processing unit 09 may obtain the relative location information of the persistent storage; determine the drawn in the current application interface display range according to the service data displayed by the current application interface and the obtained relative location information. The position coordinates of the line. At this time, the mapping unit 03 maps the position coordinates determined by the startup processing unit 09 to the coordinate system employed by the graphic drawing tool. Calling unit 04 calls the graphics drawing tool to draw and display the drawn lines within the scope of the current application interface display.
由以上描述可以看出,本发明提供的方法和装置可以具备以下优点:As can be seen from the above description, the method and apparatus provided by the present invention can have the following advantages:
1)本发明通过对用户在绘图模式下的有效绘图手势操作的监听,将绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中,并调用图形绘制工具对各目标点进行绘制和展示,从而实现用户通过手势操作方便地在移动设备上进行绘图。1) The present invention maps the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool by monitoring the effective drawing gesture operation of the user in the drawing mode. And call the graphics drawing tool to draw and display each target point, so that the user can conveniently draw on the mobile device through the gesture operation.
2)用户可以在绘图模式下对已经绘制的图形进行修改和删除,使得图形绘制更加灵活和准确。2) The user can modify and delete the already drawn graphics in the drawing mode, making the graphics drawing more flexible and accurate.
3)在非绘图模式下,用户能够通过有效的手势对当前应用界面进行 移动、放大和缩小,并在此基础上进行图形的绘制和修改,使得图形的绘制更加准确。3) In the non-drawing mode, the user can perform the current application interface through effective gestures. Move, zoom in and out, and draw and modify the graphics on this basis, making the drawing of the graphics more accurate.
4)对用户绘制的图形数据进行持久化存储,使得用户再次启动应用软件时,能够根据最新的业务数据适应性地显示已绘制的图形。4) Perpetually storing the graphic data drawn by the user, so that when the user starts the application software again, the drawn graphic can be adaptively displayed according to the latest business data.
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division, and the actual implementation may have another division manner.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。 The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。 The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are made within the spirit and principles of the present invention, should be included in the present invention. Within the scope of protection.

Claims (30)

  1. 一种绘图工具的实现方法,其特征在于,该方法包括:A method for implementing a drawing tool, the method comprising:
    监听用户的手势操作;Listening to the user's gestures;
    如果在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标;If a valid drawing gesture operation is detected in the drawing mode, the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system are acquired;
    将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;Mapping the position coordinates of the target points in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool;
    调用所述图形绘制工具对所述各目标点进行绘制和展示。The graphic drawing tool is called to draw and display the target points.
  2. 根据权利要求1所述的方法,其特征在于,该方法还包括:The method of claim 1 further comprising:
    当在非绘图模式下监听到切换绘图模式的手势操作时,切换至绘图模式;或者,When listening to the gesture operation of switching the drawing mode in the non-drawing mode, switching to the drawing mode; or,
    当在绘图模式下监听到切换绘图模式的手势操作时,切换至非绘图模式。When listening to the gesture operation of switching the drawing mode in the drawing mode, switch to the non-drawing mode.
  3. 根据权利要求2所述的方法,其特征在于,切换绘图模式的手势操作包括:The method according to claim 2, wherein the gesture operation of switching the drawing mode comprises:
    点击用户切换绘图模式的功能按键。Click the function button for the user to switch the drawing mode.
  4. 根据权利要求1所述的方法,其特征在于,该方法还包括:在绘图模式下对监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作;其中所述过滤包括:The method according to claim 1, further comprising: filtering the monitored drawing gesture operation in the drawing mode, leaving only valid drawing gesture operations; wherein the filtering comprises:
    过滤掉超出绘制范围的手势,和/或,过滤掉不符合预设绘图手势类型的手势。Filter out gestures that are out of the drawing range, and/or filter out gestures that do not match the preset drawing gesture type.
  5. 根据权利要求1所述的方法,其特征在于,所述有效的绘图手势操作包括:绘制线条的手势操作或者修改已绘制线条的手势操作。 The method of claim 1 wherein the effective drawing gesture operation comprises a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
  6. 根据权利要求5所述的方法,其特征在于,所述绘制线条的手势操作包括:以短按开始的滑动手势;The method according to claim 5, wherein the gesture operation of drawing a line comprises: a sliding gesture that starts with a short press;
    所述修改已绘制线条的手势操作包括:以长按已绘制线条上的点开始的滑动手势。The gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
  7. 根据权利要求6所述的方法,其特征在于,所述绘制线条的手势操作对应的各目标点为所述以短按开始的滑动手势对应的滑动轨迹上的各点;The method according to claim 6, wherein each target point corresponding to the gesture operation of drawing a line is a point on the sliding track corresponding to the sliding gesture starting with a short press;
    所述修改已绘制线条的手势操作对应的各目标点为所述以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
  8. 根据权利要求7所述的方法,其特征在于,以长按已绘制线条的端点开始的滑动手势引起已绘制线条的倾斜角度或长度的变更;The method according to claim 7, wherein the sliding gesture starting with the long end of the drawn line ends causes a change in the tilt angle or length of the drawn line;
    以长按已绘制线条的中部点开始的滑动手势引起已绘制线条的位置的变更。A swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
  9. 根据权利要求1所述的方法,其特征在于,该方法还包括:The method of claim 1 further comprising:
    如果在非绘图模式下监听到有效的手势操作,则依据所述手势操作所获取的新的业务数据,对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理;If a valid gesture operation is detected in the non-drawing mode, the position coordinates of the points on the drawn line in the coordinate system adopted by the operating system are adapted according to the new service data acquired by the gesture operation;
    将适配处理后已绘制线条上的点在操作***所采用坐标系中的位置坐标映射到图形绘制工具的坐标系中;Mapping the position coordinates of the points on the drawn line after the adaptation process in the coordinate system used by the operating system to the coordinate system of the graphic drawing tool;
    调用所述图形绘制工具对所述适配处理后已绘制线条上的点进行绘制和展示。The graphics drawing tool is invoked to draw and display points on the drawn line after the adaptation process.
  10. 根据权利要求9所述的方法,其特征在于,所述有效的手势操 作包括:滑动屏幕操作、放大或缩小操作。The method of claim 9 wherein said effective gesture operation Includes: sliding screen operations, zooming in or out.
  11. 根据权利要求9所述的方法,其特征在于,所述对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理包括:The method according to claim 9, wherein the adapting the position coordinates of the points on the drawn line in the coordinate system employed by the operating system comprises:
    利用记录的所述已绘制线条与业务数据之间的相对位置,在获取所述新的业务数据后,依据应用界面上业务数据在操作***所采用坐标系中的位置坐标确定已绘制线条在操作***所采用坐标系中的位置坐标。Using the recorded relative position between the drawn line and the business data, after acquiring the new business data, determining the drawn line in operation according to the position coordinates of the business data on the application interface in the coordinate system adopted by the operating system The position coordinates in the coordinate system used by the system.
  12. 根据权利要求1至8任一权项所述的方法,其特征在于,该方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:
    记录所述各目标点与当前应用界面上显示的业务数据之间的相对位置;Recording a relative position between each target point and service data displayed on the current application interface;
    对记录的所述相对位置信息进行持久化存储。The relative position information of the record is persistently stored.
  13. 根据权利要求12所述的方法,其特征在于,该方法还包括:The method of claim 12, further comprising:
    当所述绘图工具所在的应用被启动时,获取持久化存储的相对位置信息;Obtaining relative location information of the persistent storage when the application in which the drawing tool is located is started;
    依据当前应用界面展示的业务数据以及获取的相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标;Determining the position coordinates of the drawn lines within the current application interface display range according to the business data displayed by the current application interface and the obtained relative position information;
    将确定的位置坐标映射到所述图形绘制工具所采用的坐标系中;Mapping the determined position coordinates to a coordinate system used by the graphic drawing tool;
    调用所述图形绘制工具对在当前应用界面展示范围内的已绘制线条进行绘制和展示。The graphic drawing tool is invoked to draw and display the drawn lines within the scope of the current application interface display.
  14. 根据权利要求1至11任一权项所述的方法,其特征在于,所述绘图工具所在的应用包括:股票类应用。The method according to any one of claims 1 to 11, wherein the application in which the drawing tool is located comprises: a stock application.
  15. 一种绘图工具的实现装置,其特征在于,该装置包括:A device for implementing a drawing tool, characterized in that the device comprises:
    监听单元,用于监听用户的手势操作; a listening unit for monitoring a user's gesture operation;
    获取单元,用于如果所述监听单元在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标;An acquiring unit, configured to acquire, when the listening unit monitors a valid drawing gesture operation in the drawing mode, acquire position coordinates of each target point corresponding to the drawing gesture operation in a coordinate system adopted by the operating system;
    映射单元,用于将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;a mapping unit, configured to map position coordinates of the target points in a coordinate system adopted by the operating system to a coordinate system used by the graphic drawing tool;
    调用单元,用于调用所述图形绘制工具对所述各目标点进行绘制和展示。The calling unit is configured to invoke the graphic drawing tool to draw and display the target points.
  16. 根据权利要求15所述的装置,其特征在于,该装置还包括:The device according to claim 15, wherein the device further comprises:
    切换单元,用于当所述监听单元在非绘图模式下监听到切换绘图模式的手势操作时,切换至绘图模式;或者,当所述监听单元在绘图模式下监听到切换绘图模式的手势操作时,切换至非绘图模式。a switching unit, configured to switch to a drawing mode when the monitoring unit monitors a gesture operation of switching the drawing mode in the non-drawing mode; or when the monitoring unit monitors the gesture operation of switching the drawing mode in the drawing mode , switch to non-drawing mode.
  17. 根据权利要求16所述的装置,其特征在于,切换绘图模式的手势操作包括:The apparatus according to claim 16, wherein the gesture operation of switching the drawing mode comprises:
    点击用户切换绘图模式的功能按键。Click the function button for the user to switch the drawing mode.
  18. 根据权利要求15所述的装置,其特征在于,该装置还包括:The device according to claim 15, wherein the device further comprises:
    过滤单元,用于在绘图模式下对所述监听单元监听到的绘图手势操作进行过滤,仅保留有效的绘图手势操作;其中所述过滤包括:a filtering unit, configured to filter the drawing gesture operation monitored by the monitoring unit in the drawing mode, and only retain a valid drawing gesture operation; wherein the filtering comprises:
    过滤掉超出绘制范围的手势,和/或,过滤掉不符合预设绘图手势类型的手势。Filter out gestures that are out of the drawing range, and/or filter out gestures that do not match the preset drawing gesture type.
  19. 根据权利要求15所述的装置,其特征在于,所述有效的绘图手势操作包括:绘制线条的手势操作或者修改已绘制线条的手势操作。The apparatus according to claim 15, wherein said effective drawing gesture operation comprises: a gesture operation of drawing a line or a gesture operation of modifying a drawn line.
  20. 根据权利要求19所述的装置,其特征在于,所述绘制线条的手势操作包括:以短按开始的滑动手势; The device according to claim 19, wherein the gesture operation of drawing a line comprises: a sliding gesture starting with a short press;
    所述修改已绘制线条的手势操作包括:以长按已绘制线条上的点开始的滑动手势。The gesture operation of modifying the drawn line includes: a swipe gesture that begins with a long press on a point on the drawn line.
  21. 根据权利要求20所述的装置,其特征在于,所述绘制线条的手势操作对应的各目标点为所述以短按开始的滑动手势对应的滑动轨迹上的各点;The device according to claim 20, wherein each target point corresponding to the gesture operation of drawing a line is a point on the sliding track corresponding to the sliding gesture starting with a short press;
    所述修改已绘制线条的手势操作对应的各目标点为所述以长按已绘制线条上的点开始的滑动手势所引起的已绘制线条样式或位置变更后得到的各点。Each target point corresponding to the gesture operation of modifying the drawn line is a point obtained by changing the drawn line style or position caused by the sliding gesture starting from a point on the drawn line.
  22. 根据权利要求21所述的装置,其特征在于,以长按已绘制线条的端点开始的滑动手势引起已绘制线条的倾斜角度或长度的变更;The apparatus according to claim 21, wherein the sliding gesture starting with the long end of the drawn line ends causes a change in the tilt angle or length of the drawn line;
    以长按已绘制线条的中部点开始的滑动手势引起已绘制线条的位置的变更。A swipe gesture that begins with a long point of the middle point of the drawn line causes a change in the position of the drawn line.
  23. 根据权利要求15所述的装置,其特征在于,该装置还包括:The device according to claim 15, wherein the device further comprises:
    适配单元,用于如果所述监听单元在非绘图模式下监听到有效的手势操作,则依据所述手势操作所获取的新的业务数据,对已绘制线条上的点在操作***所采用坐标系中的位置坐标进行适配处理;And an adapting unit, configured to: if the monitoring unit monitors a valid gesture operation in the non-drawing mode, according to the new service data acquired by the gesture operation, the coordinates used by the operating system on the point on the drawn line The position coordinates in the system are adapted;
    所述映射单元,还用于将适配处理后已绘制线条上的点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;The mapping unit is further configured to map the position coordinates of the points on the drawn line after the adaptation process in the coordinate system used by the operating system to the coordinate system used by the graphic drawing tool;
    所述调用单元,还用于调用所述图形绘制工具对所述适配处理后已绘制线条上的点进行绘制和展示。The calling unit is further configured to invoke the graphic drawing tool to draw and display points on the drawn line after the adaptation process.
  24. 根据权利要求23所述的装置,其特征在于,所述有效的手势操作包括:滑动屏幕操作、放大或缩小操作。The apparatus according to claim 23, wherein said effective gesture operation comprises: a sliding screen operation, an enlargement or reduction operation.
  25. 根据权利要求23所述的装置,其特征在于,所述适配单元,具 体用于利用记录的所述已绘制线条与业务数据之间的相对位置,在获取所述新的业务数据后,依据应用界面上业务数据在操作***所采用坐标系中的位置坐标确定已绘制线条在操作***所采用坐标系中的位置坐标。The device according to claim 23, wherein said adapting unit has The body is configured to utilize the relative position between the drawn line and the business data of the record, and after obtaining the new service data, determine the drawn according to the position coordinates of the service data in the coordinate system of the operating system according to the service data on the application interface. The position coordinates of the line in the coordinate system used by the operating system.
  26. 根据权利要求15至22任一权项所述的装置,其特征在于,该装置还包括:The device according to any one of claims 15 to 22, further comprising:
    存储单元,用于记录所述各目标点与当前应用界面上显示的业务数据之间的相对位置;对记录的所述相对位置信息进行持久化存储。a storage unit, configured to record a relative position between the target points and service data displayed on the current application interface; and store the relative position information of the record for persistent storage.
  27. 根据权利要求26所述的装置,其特征在于,该装置还包括:The device of claim 26, further comprising:
    启动处理单元,用于当所述绘图工具所在的应用被启动时,获取持久化存储的相对位置信息;依据当前应用界面展示的业务数据以及获取的相对位置信息,确定在当前应用界面展示范围内的已绘制线条的位置坐标;And activating a processing unit, configured to obtain relative location information of the persistent storage when the application where the drawing tool is started; determining, according to the service data displayed by the current application interface and the obtained relative location information, within the current application interface display range The position coordinates of the drawn line;
    所述映射单元,还用于将所述启动处理单元确定的位置坐标映射到所述图形绘制工具所采用的坐标系中;The mapping unit is further configured to map location coordinates determined by the startup processing unit to a coordinate system used by the graphics rendering tool;
    所述调用单元,还用于调用所述图形绘制工具对所述在当前应用界面展示范围内的已绘制线条进行绘制和展示。The calling unit is further configured to invoke the graphic drawing tool to draw and display the drawn lines in the display range of the current application interface.
  28. 根据权利要求15至25任一权项所述的装置,其特征在于,所述图形绘制工具所在的应用包括:股票类应用。The apparatus according to any one of claims 15 to 25, wherein the application of the graphic drawing tool comprises: a stock application.
  29. 一种设备,包括:A device that includes:
    一个或多个处理器;One or more processors;
    存储器;Memory
    一个或多个程序,所述一个或多个程序存储在所述存储器中,当被所述一个或多个处理器执行时,执行以下操作: One or more programs, the one or more programs being stored in the memory, when executed by the one or more processors, performing the following operations:
    监听用户的手势操作;Listening to the user's gestures;
    如果在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标;If a valid drawing gesture operation is detected in the drawing mode, the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system are acquired;
    将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;Mapping the position coordinates of the target points in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool;
    调用所述图形绘制工具对所述各目标点进行绘制和展示。The graphic drawing tool is called to draw and display the target points.
  30. 一种非易失性计算机存储介质,所述计算机存储介质存储有一个或多个程序,当所述一个或多个程序被一个设备执行时,使得所述设备执行以下操作:A non-volatile computer storage medium storing one or more programs that, when executed by a device, cause the device to:
    监听用户的手势操作;Listening to the user's gestures;
    如果在绘图模式下监听到有效的绘图手势操作,则获取该绘图手势操作对应的各目标点在操作***所采用坐标系中的位置坐标;If a valid drawing gesture operation is detected in the drawing mode, the position coordinates of each target point corresponding to the drawing gesture operation in the coordinate system adopted by the operating system are acquired;
    将所述各目标点在操作***所采用坐标系中的位置坐标映射到图形绘制工具所采用的坐标系中;Mapping the position coordinates of the target points in the coordinate system adopted by the operating system to the coordinate system used by the graphic drawing tool;
    调用所述图形绘制工具对所述各目标点进行绘制和展示。 The graphic drawing tool is called to draw and display the target points.
PCT/CN2015/098081 2015-08-18 2015-12-21 Drawing tool implementation method, apparatus, device, and computer storage medium WO2017028436A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510508391.2A CN105068727B (en) 2015-08-18 2015-08-18 A kind of implementation method and device of drawing tool
CN201510508391.2 2015-08-18

Publications (1)

Publication Number Publication Date
WO2017028436A1 true WO2017028436A1 (en) 2017-02-23

Family

ID=54498110

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/098081 WO2017028436A1 (en) 2015-08-18 2015-12-21 Drawing tool implementation method, apparatus, device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN105068727B (en)
WO (1) WO2017028436A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859286A (en) * 2018-12-29 2019-06-07 上海钒兆钛智能科技有限公司 It is a kind of for generating the method and system of trend image
CN110111396A (en) * 2019-05-13 2019-08-09 武汉轻工大学 Image drawing method, equipment, storage medium and the device of cylindrical equation
CN110263310A (en) * 2019-05-15 2019-09-20 平安科技(深圳)有限公司 Data drawing generating method, device and computer readable storage medium
CN110688691A (en) * 2019-08-15 2020-01-14 杭州群核信息技术有限公司 Software design method for freely drawing table top based on Kujiale cloud design platform
CN111489410A (en) * 2019-01-25 2020-08-04 中国石油天然气集团有限公司 Observation system shot point data drawing method and device
CN111538411A (en) * 2020-04-17 2020-08-14 上海迈内能源科技有限公司 Editing and controlling method, system and terminal of irregular closed polygon
CN112506507A (en) * 2020-11-11 2021-03-16 海看网络科技(山东)股份有限公司 Method for displaying timeline by android
CN114327064A (en) * 2021-12-29 2022-04-12 北京淳中科技股份有限公司 Plotting method, system, equipment and storage medium based on gesture control

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068727B (en) * 2015-08-18 2018-09-04 百度在线网络技术(北京)有限公司 A kind of implementation method and device of drawing tool
WO2017128241A1 (en) * 2016-01-28 2017-08-03 刘建兵 Drawing method of mobile terminal, and mobile terminal
CN106971423B (en) * 2017-05-11 2020-11-06 广州视源电子科技股份有限公司 Drawing method, device and equipment of cubic graph and storage medium
CN108255800B (en) * 2018-01-12 2022-03-22 深圳市富途网络科技有限公司 Client platform based on stock tendency
CN110297568A (en) * 2018-03-22 2019-10-01 阿里巴巴集团控股有限公司 Electronic white board realization method, device, equipment and storage medium
CN108711179B (en) * 2018-05-21 2022-07-19 杭州多技教育科技有限公司 Drawing reduction method and system
CN109377536A (en) * 2018-09-19 2019-02-22 广州盖特软件有限公司 A kind of mobile method and device drawn of lines
CN109685663A (en) * 2018-12-14 2019-04-26 北京向上一心科技有限公司 Display methods, device, controller and the medium to draw lines when switching the K line period
CN111475094B (en) * 2020-03-23 2022-03-08 深圳市富途网络科技有限公司 Reference diagram editing method and device for diagram and computer readable storage medium
CN111524210A (en) * 2020-04-10 2020-08-11 北京百度网讯科技有限公司 Method and apparatus for generating drawings
CN113760414B (en) * 2020-06-02 2023-11-28 北京字节跳动网络技术有限公司 Method and device for drawing graph

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976128A (en) * 2010-10-11 2011-02-16 庄永基 Digital calligraphy/painting real-time data acquisition simulation system and acquisition method thereof
CN103164158A (en) * 2013-01-10 2013-06-19 深圳市欧若马可科技有限公司 Method, system and device of creating and teaching painting on touch screen
US8542207B1 (en) * 2011-09-27 2013-09-24 Cosmin Truta Pencil eraser gesture and gesture recognition method for touch-enabled user interfaces
CN103809928A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Display method, device and system for transaction trend chart
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663033A (en) * 2012-03-23 2012-09-12 汉海信息技术(上海)有限公司 Method for searching interest points in designated area of map by hand-drawing way
CN104252340A (en) * 2013-06-26 2014-12-31 昆盈企业股份有限公司 Coordinate corresponding method
CN103605463B (en) * 2013-11-28 2016-06-29 东莞中国科学院云计算产业技术创新与育成中心 Drawing method based on GIS platform and the quick situation plotting system of touch panel device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976128A (en) * 2010-10-11 2011-02-16 庄永基 Digital calligraphy/painting real-time data acquisition simulation system and acquisition method thereof
US8542207B1 (en) * 2011-09-27 2013-09-24 Cosmin Truta Pencil eraser gesture and gesture recognition method for touch-enabled user interfaces
CN103809928A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Display method, device and system for transaction trend chart
CN103164158A (en) * 2013-01-10 2013-06-19 深圳市欧若马可科技有限公司 Method, system and device of creating and teaching painting on touch screen
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859286A (en) * 2018-12-29 2019-06-07 上海钒兆钛智能科技有限公司 It is a kind of for generating the method and system of trend image
CN109859286B (en) * 2018-12-29 2024-01-02 上海钒钛智能科技有限公司 Method and system for generating trend image
CN111489410A (en) * 2019-01-25 2020-08-04 中国石油天然气集团有限公司 Observation system shot point data drawing method and device
CN111489410B (en) * 2019-01-25 2023-11-28 中国石油天然气集团有限公司 Method and device for drawing shot point data of observation system
CN110111396B (en) * 2019-05-13 2023-05-26 武汉轻工大学 Image drawing method, device, storage medium and apparatus for cylindrical equation
CN110111396A (en) * 2019-05-13 2019-08-09 武汉轻工大学 Image drawing method, equipment, storage medium and the device of cylindrical equation
CN110263310A (en) * 2019-05-15 2019-09-20 平安科技(深圳)有限公司 Data drawing generating method, device and computer readable storage medium
CN110263310B (en) * 2019-05-15 2024-05-10 平安科技(深圳)有限公司 Data graph generation method and device and computer readable storage medium
CN110688691A (en) * 2019-08-15 2020-01-14 杭州群核信息技术有限公司 Software design method for freely drawing table top based on Kujiale cloud design platform
CN111538411B (en) * 2020-04-17 2022-03-08 上海迈内能源科技有限公司 Editing and controlling method, system and terminal of irregular closed polygon
CN111538411A (en) * 2020-04-17 2020-08-14 上海迈内能源科技有限公司 Editing and controlling method, system and terminal of irregular closed polygon
CN112506507A (en) * 2020-11-11 2021-03-16 海看网络科技(山东)股份有限公司 Method for displaying timeline by android
CN114327064A (en) * 2021-12-29 2022-04-12 北京淳中科技股份有限公司 Plotting method, system, equipment and storage medium based on gesture control

Also Published As

Publication number Publication date
CN105068727A (en) 2015-11-18
CN105068727B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
WO2017028436A1 (en) Drawing tool implementation method, apparatus, device, and computer storage medium
JP7097991B2 (en) Devices and methods for measuring using augmented reality
US10048859B2 (en) Display and management of application icons
WO2021035884A1 (en) Screen mirroring method and apparatus, terminal, and storage medium
EP3117602B1 (en) Metadata-based photo and/or video animation
US11947791B2 (en) Devices, methods, and systems for manipulating user interfaces
US20220214784A1 (en) Systems and methods for a touchscreen user interface for a collaborative editing tool
US20120174029A1 (en) Dynamically magnifying logical segments of a view
JP6364893B2 (en) Terminal device, electronic whiteboard system, electronic whiteboard input support method, and program
DE112013002409T5 (en) Apparatus, method and graphical user interface for displaying additional information in response to a user contact
US20150253970A1 (en) Method, apparatus and storage medium for adjusting filter list
WO2021203815A1 (en) Page operation method and apparatus, and terminal and storage medium
US9747007B2 (en) Resizing technique for display content
US20180152622A1 (en) Mobile terminal-based photographing method and mobile terminal
US20150009154A1 (en) Electronic device and touch control method thereof
US9658865B2 (en) Method of editing content and electronic device for implementing the same
EP2650797A2 (en) Electronic device and method for annotating data
WO2019101073A1 (en) Toolbar display control method and apparatus, and readable storage medium and computer device
WO2018153232A1 (en) Search component presentation method, electronic device and non-volatile computer storage medium
US20150346973A1 (en) Seamlessly enabling larger ui
WO2016022634A1 (en) Display and management of application icons
KR20170066592A (en) Multiple stage user interface
CN103150116A (en) RDP-based method for magnification display of cloud desktop
WO2018157655A1 (en) Method and device for redefining control display area of screen
US20130205201A1 (en) Touch Control Presentation System and the Method thereof

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: 15901638

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: 15901638

Country of ref document: EP

Kind code of ref document: A1