Handwriting drawing method and device, electronic equipment and storage medium
By obtaining touch sampling point position information in real time and presetting the angle-width relationship of the rules of real paper and pen writing, determining the width of handwriting on electronic devices and drawing handwriting segments, the problem that the prior art cannot achieve the effect of near-real paper and pen writing on existing electronic devices, and achieving universal application on various devices.
Patent Information
- Application Number
- CN202311137077.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2025-03-11
AI Technical Summary
Existing electronic devices cannot achieve the effect of writing near real paper and pen at the hardware and software level, especially the effect of writing brushes, which makes it impossible to achieve universally on existing electronic devices.
By obtaining the position information of touch sampling points in writing mode in real time, confirming the real-time writing direction of the writing operation, and combining the preset angle-width relationship of the general rules of real paper and pen writing, determine the real-time handwriting width during the writing process, and complete the drawing of the corresponding handwriting segments.
Without the need for corresponding hardware improvements or software design for specific types and screen parameters, the effect of near-real paper and pen writing can be generally achieved on various existing electronic devices.
Smart Images

Figure CN119597198A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of touch technology, and in particular to a handwriting drawing method, device, electronic device, and storage medium. Background Art
[0002] With the continuous development of electronic technology, various types of electronic devices have appeared in people's daily scenes, and provide various information auxiliary functions such as information display, information input, and information interaction.
[0003] When the inventor used existing electronic devices to input information, he found that handwriting input based on touch detection can usually only display handwriting lines with unclear line changes. If you want to achieve an effect close to real pen and paper writing, such as the writing effect of a brush, you usually need to make improvements at the hardware and / or software level. Hardware-based improvements are costly and cannot be implemented on existing electronic devices; software-based improvements are highly related to screen parameters, and one software improvement direction cannot be fully used for existing electronic devices with rich and diverse screen parameters. Overall, the existing effects that are close to real pen and paper writing cannot be generally achieved on existing electronic devices. Summary of the invention
[0004] The present invention provides a handwriting drawing method, device, electronic device and storage medium to solve the technical problem that the existing effect close to real paper and pen writing cannot be generally realized on existing electronic devices.
[0005] In a first aspect, an embodiment of the present invention provides a handwriting drawing method, the handwriting drawing method comprising:
[0006] Real-time acquisition of the position information of the touch sampling points generated by the writing operation in the writing mode;
[0007] For the first sampling point currently acquired, confirming the angle between the first direction and the preset direction of the second sampling point pointing to the first sampling point according to the position information, the second sampling point being the previous touch sampling point adjacent to the first sampling point;
[0008] Determining the handwriting width of the handwriting between the first sampling point and the second sampling point according to the preset angle-width relationship and the angle;
[0009] Draw the handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0010] In a second aspect, an embodiment of the present invention provides a handwriting drawing device, the handwriting drawing device comprising:
[0011] A position information acquisition unit, used to acquire in real time the position information of the touch sampling points generated by the writing operation in the writing mode;
[0012] An angle confirmation unit, used to confirm, for the currently acquired first sampling point, an angle between a first direction in which a second sampling point points to the first sampling point and a preset direction according to the position information, wherein the second sampling point is a previous touch sampling point adjacent to the first sampling point;
[0013] A width confirmation unit, for confirming the handwriting width of the handwriting between the first sampling point and the second sampling point according to a preset angle-width relationship and an angle;
[0014] The handwriting segment drawing unit is used to draw the handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When one or more programs are executed by one or more processors, the electronic device implements the handwriting drawing method of the first aspect.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the handwriting drawing method of the first aspect.
[0020] In the above-mentioned handwriting drawing method, device, electronic device and storage medium, the position information of the touch sampling point generated by the writing operation in the writing mode is obtained in real time; for the first sampling point currently obtained, the angle between the first direction of the second sampling point pointing to the first sampling point and the preset direction is confirmed according to the position information, and the second sampling point is the previous touch sampling point adjacent to the first sampling point; according to the preset angle-width relationship and angle, the handwriting width of the handwriting between the first sampling point and the second sampling point is confirmed; and the handwriting segment between the first sampling point and the second sampling point is drawn according to the handwriting width. By confirming the real-time writing direction of the writing operation according to the position information of the touch sampling point, combined with the preset angle-width relationship according to the general rules of real paper and pen writing, the real-time handwriting width in the writing process is obtained and the drawing of the corresponding handwriting segment is completed. The confirmation of the handwriting width can be applicable to electronic devices of various types and screen parameters. Without the need to improve the corresponding hardware and without the need to design software for specific types and screen parameters, the effect close to real paper and pen writing can be generally achieved on various existing electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A method flow chart of a handwriting drawing method provided by an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram of the changes in the thickness of brush strokes.
[0023] Figure 3 A schematic diagram of the angles of touch sampling points provided by an embodiment of the present invention.
[0024] Figure 4 A schematic diagram of an exemplary angle-width relationship provided for an embodiment of the present invention.
[0025] Figure 5 A schematic structural diagram of a handwriting drawing device provided in an embodiment of the present invention.
[0026] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0028] It should be noted that the present application specification does not enumerate all optional implementation modes. After reading the present application specification, those skilled in the art should be able to understand that as long as the technical features do not contradict each other, any combination of the technical features can constitute an optional implementation mode.
[0029] The handwriting drawing method in the embodiment of the present application can be implemented based on various electronic devices with touch modules, and the embodiment of the present application is exemplified based on an interactive tablet. Among them, the interactive tablet is an integrated device that controls the displayed content and realizes human-computer interaction through touch technology, which integrates one or more functions such as a projector, an electronic whiteboard, a screen, a sound system, a television, and a video conferencing terminal.
[0030] The interactive tablet is installed with at least one type of operating system, and the operating system can be an Android system, a Windows system, a Linux system, an IOS system, etc. The interactive tablet can install at least one application under the operating system. Among them, the application can be an application that comes with the operating system, or an application downloaded from a third-party device or server, which is not currently limited. For example, the interactive tablet is installed with a whiteboard application, which refers to an application for users to write, display, etc., which can be used to generate writing handwriting according to the user's writing operation (touch operation) in the interface of the whiteboard application, and can also be used to insert and display multimedia elements in the interface of the whiteboard application. Multimedia elements may include graphics, images, tables, documents, audio files and / or video files. In the interface of the whiteboard application, users can implement operations such as writing, drawing, and erasing similar to physical blackboards, and further have better digital functions such as moving, saving, scaling, inserting pictures, color adjustment, and stroke thickness settings. The whiteboard application can also display and edit file data (including writing handwriting and / or multimedia elements, etc.) created by users in whiteboard applications of other terminals. In actual applications, the whiteboard application can also be named as a writing application, an electronic whiteboard application, a collaborative whiteboard application, etc. No matter how the name changes, as long as the application is used to implement the above functions, it is equivalent to the whiteboard application in the application embodiment. For example, the interactive tablet is installed with a file display application, and the file display application can be used to display files to users. In some scenarios, the interactive display application can also be used for users to edit files, such as for users to create files, edit file contents, add annotations, etc., to achieve real-time display of user editing operations during file display, thereby improving the information display and interaction effects during file display. It can be understood that the interactive tablet can install multiple file display applications, and different file display applications can display different types of files. For example, the interactive tablet is installed with file display applications for displaying documents such as Word documents, PDF documents, PPT documents, Excel documents, etc., and is also installed with file display applications for displaying multimedia files such as pictures (such as bmp, jpg, png, tif, gif, etc.), videos (such as wmv, MP4, avi, rm, etc.), and audio (such as MP3, WMA, etc.). In actual applications, the file display application can be named accordingly according to the type of displayed file. No matter how the name of the file display application changes, as long as it is used to implement the above functions, it is equivalent to the file display application in the embodiment of the present application. For another example, the interactive tablet is installed with a screen projection application, which is mainly used for wireless screen projection. Wireless screen projection is to display the screen (also called screen projection data) of a mobile device (such as a mobile phone, tablet computer, laptop computer, etc.) to the interactive tablet in "real time" through a specific technical method. The displayed content includes various types of media information and real-time operation screens.The screen projection application can also be called a screen transmission application, a flying screen application, or a screen sharing application. No matter how the name of the screen projection application changes, as long as it is an application used to implement the above functions, it is equivalent to the screen projection application in the embodiment of the present application.
[0031] The interactive tablet is also equipped with at least one display screen. For example, the interactive tablet is equipped with a display screen with a touch function, and the display screen can be a capacitive screen, a resistive screen, an infrared screen and / or an electromagnetic screen. The user can control the interactive tablet by touching the display screen with a finger or a stylus. In addition, the interactive tablet can also be connected to external devices such as a mouse and a keyboard, and the user can also control the interactive tablet by operating the external device.
[0032] With the support of the above hardware and software, the interactive tablet can be used in teaching, meetings and other multi-person communication scenarios with good information presentation and interactive effects. For example, through a pressure-sensitive capacitive pen, a pressure-sensitive resistive screen, etc., through hardware, the interactive tablet can have a pressure sensing result when detecting a touch operation, and then determine the thickness of the handwriting to simulate a brush effect. Alternatively, the software application layer can identify the contact area between the user's finger touching the screen and the screen, and then determine the thickness of the handwriting to simulate the brush effect; or determine the thickness of the handwriting by judging the speed of the user's finger movement. Through these methods, the simulation of the brush effect can be realized on the interactive tablet, and then brush teaching can be realized. However, these effects close to real paper and pen writing have a high cost based on hardware improvements and cannot be realized on existing electronic devices; software-based improvements are highly related to screen parameters. One software improvement direction cannot be fully used in existing electronic devices with rich and diverse screen parameters, and cannot be widely implemented on existing electronic devices.
[0033] In response to the above technical problems, the embodiments of the present application confirm the real-time writing direction of the writing operation according to the position information of the touch sampling point, and combine the angle-width relationship preset according to the general rules of real paper and pen writing to obtain the real-time handwriting width during the writing process and complete the drawing of the corresponding handwriting segment. The confirmation of the handwriting width can be applicable to electronic devices of various types and screen parameters. Without the need to improve the corresponding hardware and without the need to design software for specific types and screen parameters, it can generally achieve an effect close to real paper and pen writing on various existing electronic devices.
[0034] Each embodiment is described in detail below.
[0035] Figure 1 A method flow chart of a handwriting drawing method provided by an embodiment of the present invention, the handwriting drawing method, such as Figure 1 As shown, the handwriting drawing method comprises:
[0036] Step S110: acquiring in real time the position information of the touch sampling points generated by the writing operation in the writing mode.
[0037] When the interactive tablet is in operation or standby state, touch operation can be detected by the touch module. The touch operation detects the signal change caused by the touch operation in a sampling manner, and then confirms the position information of the touch sampling point according to the signal change. During the detection process of the touch module, the touch operation may be continuous, but the sampling result is multiple discrete points.
[0038] An exemplary method for acquiring touch sampling points is to monitor the web DOM event "pointerrawupdate". This event is triggered when a user's finger moves on the display screen of the interactive tablet, and the event parameters contain sampling point information.
[0039] There may be many purposes for users to operate on the interactive tablet, such as triggering application icons by clicking, moving files by dragging, adding handwriting by writing, etc. For the touch module, the touch sampling points corresponding to the drag operation and the writing operation are no different. In the embodiment of the present application, for specific application scenarios, the touch sampling points generated by the writing operation are subsequently processed to draw handwriting in the writing mode. The writing mode can specifically be that there are currently handwriting applications, such as whiteboard applications, annotation applications, etc., in the top running state, and the user's current continuous touch operation needs to be responded to as a writing operation.
[0040] Step S120: for the currently acquired first sampling point, confirm the angle between the first direction of the second sampling point pointing to the first sampling point and the preset direction according to the position information, and the second sampling point is the previous touch sampling point adjacent to the first sampling point.
[0041] After extensive analysis of real brush handwriting, it was found that brush handwriting has several general rules: 1. Strokes in the horizontal direction are relatively thin; 2. Strokes in the vertical direction are relatively thick; 3. Strokes in the "left" direction are relatively thin; 4. Strokes in the "right" direction are relatively thick. The above relationship is mapped to the plane coordinate system, such as Figure 2 As shown, the strokes in the OA direction are relatively thick. In the embodiment of the present application, a large number of writing brushes are counted, the above rules are quantified, and the angle-width relationship is obtained.
[0042] According to the above general rules of real pen and paper writing, in the embodiment of the present application, the writing direction is used as a reference factor for handwriting drawing. While acquiring the touch sampling points in real time, the direction of the first sampling point currently acquired is confirmed in real time, that is, the specific direction parameters of the direction from the adjacent previous touch sampling point to the first sampling point are confirmed based on the position information. The position information corresponding to each touch sampling point can be represented as (x, y), which is used to indicate the position of the touch sampling point in the display screen of the interactive flat panel. In a plane coordinate system, the angle between the line connecting two known points and a known straight line can be determined based on trigonometric functions. For example Figure 3 The two adjacent touch sampling points in are sampling point A and sampling point B, and the angle between them and the horizontal direction is β. The distance between A and B in the vertical direction is yB-yA, and the distance in the horizontal direction is xB-xA. According to the mathematical trigonometric function relationship, the value of the angle β can be obtained. Calculating the angle based on trigonometric functions is a common processing process, which will not be explained in detail here.
[0043] What is obtained by trigonometric calculation is only a numerical value. The precise expression of a specific angle also involves the corresponding preset direction and angle change direction as a reference. In an optional specific implementation, the preset direction is a direction parallel to the reference direction in the preset coordinate system with the second sampling point as the origin; the preset direction is marked as the 0° direction; the angle range from the preset direction to the opposite direction of the preset direction counterclockwise around the origin is 0° to -180°, and the angle range from the preset direction to the opposite direction of the preset direction clockwise around the origin is 0° to 180°.
[0044] In another more specific implementation, the preset direction is a horizontal rightward direction with the second sampling point as the origin; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°; the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°. The preset direction and the angle change direction in this more specific implementation can be referred to Figure 2 , where the origin is marked as O, horizontal right is the preset direction, horizontal left is the opposite direction of the preset direction, the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0°~180°, that is, the range shown by the dotted arrow below the x-axis is 0°~180°; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0°~-180°, that is, the range shown by the dotted arrow above the x-axis is 0°~-180°.
[0045] Step S130: confirming the handwriting width of the handwriting between the first sampling point and the second sampling point according to the preset angle-width relationship and the angle.
[0046] On the basis of the preset angle-width relationship, the corresponding width can be obtained according to the angle corresponding to the current touch sampling point, which is used as the handwriting width of the writing between the current touch sampling point and the adjacent previous sampling point. Of course, for the first touch sampling point in a writing operation, the writing handwriting can be not generated first, or the starting point of the writing handwriting can be generated according to the default width.
[0047] The angle-width relationship can be expressed in different ways depending on the statistical object, statistical quantity, and angle confirmation method. Figure 4 An exemplary graphical representation of the angle-width relationship is shown in FIG. Figure 4 In , the angle-width relationship is a number of piecewise functions, where the piecewise functions are linear functions. Figure 4 In the figure, the handwriting in the horizontal direction, that is, 0° and 180°, is given a width of 2; the handwriting in the vertical direction, that is, -90° and 90°, is given a width of 8; the handwriting in the "left" direction, that is, -45° and 135°, is given a width of 4; the handwriting in the "right" direction, that is, 45° and -135°, is given a width of 6, and the above exemplary angles vary linearly. Of course, each piecewise function may also be part of a quadratic function. The unit of width may be a metric unit or a unit of measurement of handwriting size.
[0048] Step S140: drawing a handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0049] In the specific drawing process, the handwriting segment can be directly drawn according to the obtained handwriting width. For example, if the confirmed handwriting width is 6, a handwriting segment with a width of 6 is drawn accordingly. In the writing process, a complete handwriting is formed by connecting the handwriting segments drawn in batches. Two connected touch sampling points correspond to drawing a handwriting segment.
[0050] In another optional embodiment, the process of drawing a handwriting segment may be to first obtain the currently configured handwriting parameters, confirm the drawing width based on the handwriting parameters and the handwriting width; and then draw the handwriting segment with the drawing width between the first sampling point and the second sampling point. In the embodiment of the present application, there may be a prior handwriting configuration operation equivalent to the writing operation for configuring the handwriting parameters regarding the handwriting writing attributes, including the width parameter. The influence of the angle may be different for handwritings of different widths. Therefore, it is necessary to obtain a drawing width based on the configured handwriting parameters and the confirmed handwriting width segment. Drawing the handwriting segment with the drawing width can obtain a more coordinated handwriting as a whole. Through the above processing process, it can be found that the angle-width relationship provided in the embodiment of the present application is independent of the hardware configuration of the electronic device, and the specific width parameter used is not affected by the screen parameters of the display screen of the electronic device, and can be applied to various types and configurations of electronic devices based on touch modules.
[0051] In the above handwriting drawing method, the position information of the touch sampling point generated by the writing operation in the writing mode is obtained in real time; for the first sampling point currently obtained, the angle between the first direction of the second sampling point pointing to the first sampling point and the preset direction is confirmed according to the position information, and the second sampling point is the previous touch sampling point adjacent to the first sampling point; according to the preset angle-width relationship and angle, the handwriting width of the handwriting between the first sampling point and the second sampling point is confirmed; and the handwriting segment between the first sampling point and the second sampling point is drawn according to the handwriting width. By confirming the real-time writing direction of the writing operation according to the position information of the touch sampling point, combined with the preset angle-width relationship according to the general rules of real paper and pen writing, the real-time handwriting width in the writing process is obtained and the drawing of the corresponding handwriting segment is completed. The confirmation of the handwriting width can be applicable to electronic devices of various types and screen parameters. Without the need to improve the corresponding hardware and without the need to design software for specific types and screen parameters, the effect close to real paper and pen writing can be generally achieved on various existing electronic devices.
[0052] Please refer to Figure 5 , which is a structural schematic diagram of a handwriting drawing device provided by an embodiment of the present invention, such as Figure 5 As shown, the handwriting drawing device includes a position information acquiring unit 210 , an angle confirming unit 220 , a width confirming unit 230 and a handwriting segment drawing unit 240 .
[0053] Among them, the position information acquisition unit 210 is used to acquire the position information of the touch sampling point generated by the writing operation in the writing mode in real time; the angle confirmation unit 220 is used to confirm, for the first sampling point currently acquired, the angle between the first direction of the second sampling point pointing to the first sampling point and the preset direction according to the position information, and the second sampling point is the previous touch sampling point adjacent to the first sampling point; the width confirmation unit 230 is used to confirm the handwriting width of the writing handwriting between the first sampling point and the second sampling point according to the preset angle-width relationship and angle; the handwriting segment drawing unit 240 is used to draw the handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0054] On the basis of the above embodiment, the preset direction is a direction with the second sampling point as the origin and parallel to the reference direction in the preset coordinate system; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°, and the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°.
[0055] On the basis of the above embodiment, the preset direction is the horizontal rightward direction with the second sampling point as the origin; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°; the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°.
[0056] Based on the above embodiment, the angle-width relationship is a plurality of piecewise functions.
[0057] Based on the above embodiment, the piecewise function is a linear function.
[0058] Based on the above embodiment, the handwriting drawing unit 240 includes:
[0059] A drawing width confirmation module is used to obtain the currently configured handwriting parameters and confirm the drawing width based on the handwriting parameters and the handwriting width;
[0060] The handwriting segment drawing module is used to draw the handwriting segment between the first sampling point and the second sampling point with a drawing width.
[0061] The handwriting drawing device provided in the embodiment of the present invention is included in an electronic device and can be used to execute any handwriting drawing method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0062] It is worth noting that in the embodiment of the above-mentioned handwriting drawing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0063] Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, the electronic device includes a processor 310 and a memory 320, and may also include an input device 330, an output device 340, and a communication device 350; the number of the processor 310 in the electronic device may be one or more, Figure 6 A processor 310 is taken as an example; the processor 310, the memory 320, the input device 330, the output device 340 and the communication device 350 in the electronic device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0064] The memory 320 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the handwriting drawing method in the embodiment of the present invention. The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 320, that is, implements the above-mentioned handwriting drawing method.
[0065] The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include a memory remotely arranged relative to the processor 310, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0066] The input device 330 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 340 may include a display device such as a display screen.
[0067] The electronic device mentioned above includes a handwriting drawing device, which can be used to execute any handwriting drawing method and has corresponding functions and beneficial effects.
[0068] An embodiment of the present invention also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to perform relevant operations in the handwriting drawing method provided in any embodiment of the present application, and have corresponding functions and beneficial effects.
[0069] Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products.
[0070] Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0071] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0072] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0073] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0074] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A handwriting drawing method, characterized in that: include: Real-time acquisition of the position information of the touch sampling points generated by the writing operation in the writing mode; For the first sampling point currently acquired, confirming, according to the position information, an angle between a first direction in which a second sampling point points to the first sampling point and a preset direction, the second sampling point being a previous touch sampling point adjacent to the first sampling point; Determining the handwriting width of the handwriting between the first sampling point and the second sampling point according to the preset angle-width relationship and the angle; A handwriting segment between the first sampling point and the second sampling point is drawn according to the handwriting width.
2. The handwriting drawing method according to claim 1, characterized in that: The preset direction is a direction with the second sampling point as the origin and parallel to the reference direction in the preset coordinate system; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°, and the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°.
3. The handwriting drawing method according to claim 2, characterized in that: The preset direction is a horizontal rightward direction with the second sampling point as the origin; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°; the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°.
4. The handwriting drawing method according to claim 3, characterized in that: The angle-width relationship is a plurality of piecewise functions.
5. The handwriting drawing method according to claim 4, characterized in that: The piecewise function is a linear function.
6. The handwriting drawing method according to claim 1, characterized in that: The step of drawing the handwriting segment between the first sampling point and the second sampling point according to the handwriting width includes: Acquire the currently configured handwriting parameters, and determine the drawing width based on the handwriting parameters and the handwriting width; A handwriting segment is drawn between the first sampling point and the second sampling point with the drawing width.
7. A handwriting drawing device, characterized in that: include: A position information acquisition unit, used to acquire in real time the position information of the touch sampling points generated by the writing operation in the writing mode; an angle confirmation unit, configured to confirm, for a currently acquired first sampling point, an angle between a first direction in which a second sampling point points to the first sampling point and a preset direction according to the position information, wherein the second sampling point is a previous touch sampling point adjacent to the first sampling point; A width confirmation unit, configured to confirm a handwriting width of the handwriting between the first sampling point and the second sampling point according to a preset angle-width relationship and the angle; A handwriting segment drawing unit is used to draw a handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
8. The handwriting drawing device according to claim 7, characterized in that: The preset direction is a direction with the second sampling point as the origin and parallel to the reference direction in the preset coordinate system; the preset direction is marked as the 0° direction; the angle range from the preset direction around the origin counterclockwise to the opposite direction of the preset direction is 0° to -180°, and the angle range from the preset direction around the origin clockwise to the opposite direction of the preset direction is 0° to 180°.
9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the electronic device implements the handwriting drawing method as described in any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the handwriting drawing method as described in any one of claims 1 to 6 is implemented.