Handwriting drawing method and apparatus, electronic device, and storage medium
By obtaining the position information of touch sampling points and the preset angle-width relationship in real time, confirming the writing direction and handwriting width on the electronic device, solving the problem that the prior art is difficult to achieve the writing effect close to the real paper and pen, and achieving efficient writing simulation on diverse electronic devices.
Patent Information
- Application Number
- PCT/CN2024/114195
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-04
- Filing Date
- 2024-08-23
- Publication Date
- 2025-03-13
AI Technical Summary
Existing electronic devices are difficult to achieve near-real pen writing effects at the hardware and software level, especially brush writing effects. Due to the high cost of hardware improvement, software improvements are difficult to apply to diverse screen parameters.
By obtaining the position information of touch sampling points in writing mode in real time, combining the preset angle-width relationship of the general rules of real paper and pen writing, confirm the real-time writing direction and handwriting width of the writing operation, and then draw the handwriting segment.
Without the need to improve hardware or software design for specific screen parameters, the effect of near-real paper and pen writing can be generally achieved on various existing electronic devices.
Smart Images

Figure CN2024114195_13032025_PF_FP_ABST
Abstract
Description
Handwriting drawing method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 4, 2023, with application number 202311137077.9 and invention name “Handwriting drawing method, device, electronic device and storage medium”. The entire contents of the application are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of touch technology, and in particular to a handwriting drawing method, device, electronic device, and storage medium. Background Art
[0003] With the continuous development of electronic technology, various types of electronic devices have appeared in people's daily scenes, and provide various information assistance functions such as information display, information input, and information interaction.
[0004] 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 close to real pen and paper writing cannot be widely achieved on existing electronic devices.
[0005] Application Contents
[0006] The present application provides a handwriting drawing method, device, electronic device and storage medium to solve the technical problem that the existing effect of close to real paper and pen writing cannot be widely realized on existing electronic devices.
[0007] In a first aspect, an embodiment of the present application provides a handwriting drawing method, the handwriting drawing method comprising:
[0008] Real-time acquisition of the position information of the touch sampling points generated by the writing operation in writing mode;
[0009] For the currently acquired first sampling point, determining, based on the position information, an angle between a first direction and a preset direction pointing to a second sampling point, wherein the second sampling point is a previous touch sampling point adjacent to the first sampling point;
[0010] Determining the handwriting width of the handwriting between the first sampling point and the second sampling point based on a preset angle-width relationship and the angle;
[0011] Draw the handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0012] In a second aspect, an embodiment of the present application provides a handwriting drawing device, comprising:
[0013] A position information acquisition unit, configured to acquire in real time the position information of the touch sampling points generated by the writing operation in the writing mode;
[0014] 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 based on the position information, where the second sampling point is a previous touch sampling point adjacent to the first sampling point;
[0015] a width confirmation unit, configured to confirm a handwriting width of the handwriting between the first sampling point and the second sampling point based on a preset angle-width relationship and an angle;
[0016] 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.
[0017] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0018] one or more processors;
[0019] a memory for storing one or more programs;
[0020] When one or more programs are executed by one or more processors, the electronic device implements the handwriting drawing method of the first aspect.
[0021] In a fourth aspect, an embodiment of the present application 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.
[0022] In the above-mentioned handwriting drawing method, device, electronic device, and storage medium, the position information of the touch sampling points generated by the writing operation in the writing mode is obtained in real time; for the currently obtained first sampling point, the angle between the first direction and the preset direction of the second sampling point pointing to the first sampling point is determined based on the position information, and the second sampling point is the previous touch sampling point adjacent to the first sampling point; the handwriting width of the handwriting between the first sampling point and the second sampling point is determined based on the preset angle-width relationship and the angle; and the handwriting segment between the first sampling point and the second sampling point is drawn based on the handwriting width. By determining the real-time writing direction of the writing operation based on the position information of the touch sampling points, combined with the preset angle-width relationship based on the general rules of real paper and pen writing, the real-time handwriting width during the writing process is obtained and the corresponding handwriting segment is drawn. The handwriting width determination is applicable to electronic devices of various types and screen parameters. Without the need for corresponding hardware improvements or software design for specific types and screen parameters, an effect close to real paper and pen writing can be universally achieved on various existing electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a flow chart of a handwriting drawing method provided in an embodiment of the present application.
[0024] Figure 2 is a schematic diagram of the changes in the thickness of brush strokes.
[0025] FIG3 is a schematic diagram of angles of touch sampling points provided by an embodiment of the present application.
[0026] FIG4 is a schematic diagram of an exemplary angle-width relationship provided in an embodiment of the present application.
[0027] FIG5 is a schematic structural diagram of a handwriting drawing device provided in an embodiment of the present application.
[0028] FIG6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended to explain the present application, not to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present application, not all structures.
[0030] It should be noted that this application specification does not enumerate all optional implementation methods. After reading this 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 technical features can constitute an optional implementation method.
[0031] The handwriting drawing method in the embodiments of this application can be implemented on various electronic devices equipped with touch modules. The embodiments of this application are exemplified using an interactive tablet. An interactive tablet is an integrated device that uses touch technology to control displayed content and implement human-computer interaction. It integrates one or more functions such as a projector, electronic whiteboard, screen, audio system, television, and video conferencing terminal.
[0032] 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, and 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, and other operations. It can be used to generate handwriting based on 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 perform operations such as writing, drawing, and erasing similar to those of a physical blackboard, 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 handwriting and / or multimedia elements, etc.) created by users in whiteboard applications on 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. Regardless of how the name is changed, as long as it is an application 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 the user. In some scenarios, the interactive display application can also be used for users to edit files, such as allowing users to create files, edit file contents, add annotations, etc., to achieve real-time display of user editing operations during the file display process, thereby improving the information display and interactive effect during the file display process. It is understandable that the interactive tablet can be installed with 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 an application 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 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.
[0033] The interactive tablet is also equipped with at least one display screen. For example, the interactive tablet may be equipped with a touch screen, which may be a capacitive screen, a resistive screen, an infrared screen, and / or an electromagnetic screen. Users can control the interactive tablet by touching the display screen with their fingers or a stylus. Furthermore, the interactive tablet can be connected to external devices such as a mouse and keyboard, allowing users to control the interactive tablet by operating the external devices.
[0034] With the support of the above hardware and software, interactive tablets can be used in multi-person communication scenarios such as teaching and conferencing, providing excellent information presentation and interactive effects. For example, through hardware methods such as pressure-sensitive capacitive pens and pressure-sensitive resistive screens, the interactive tablet can detect a pressure-sensing result when a touch operation is performed, 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 a brush effect; or determine the thickness of the handwriting based on the speed of the user's finger movement. These methods can simulate the effect of a brush on the interactive tablet, and thus enable brush teaching. However, these effects that are close to real paper and pen writing are costly to achieve through hardware improvements and cannot be implemented on existing electronic devices. Software-based improvements are highly dependent on screen parameters. A single software improvement direction cannot be fully applied to existing electronic devices with rich and diverse screen parameters and cannot be widely implemented on existing electronic devices.
[0035] In response to the above technical problems, the embodiments of the present application confirm the real-time writing direction of the writing operation based on 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 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.
[0036] Each embodiment is described in detail below.
[0037] FIG1 is a flow chart of a handwriting drawing method provided by an embodiment of the present application. The handwriting drawing method, as shown in FIG1 , includes:
[0038] Step S110: acquiring in real time the position information of the touch sampling points generated by the writing operation in the writing mode.
[0039] When the interactive tablet is in operation or standby state, touch operations can be detected by the touch module. The touch operation detects the signal changes caused by the touch operation in a sampling manner, and then confirms the location information of the touch sampling point based on the signal changes. During the detection process of the touch module, the touch operation may be continuous, but the sampling results are multiple discrete points.
[0040] 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 an interactive tablet, and the event parameters contain sampling point information.
[0041] A user may have various purposes for operating an interactive tablet, such as triggering an application icon by clicking, moving a file by dragging, adding handwriting by writing, etc. For the touch module, the touch sampling points corresponding to the dragging operation and the writing operation are the same. In the embodiment of the present application, the touch sampling points generated by the writing operation are subsequently processed to draw handwriting in the writing mode for specific application scenarios. The writing mode can specifically be when a handwriting application, such as a whiteboard application or an annotation application, is currently in a top-level running state, and the user's current continuous touch operation needs to be responded to as a writing operation.
[0042] 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.
[0043] After extensive analysis of real brush handwriting, we found that brush handwriting has several general patterns: 1. Strokes in the horizontal direction are relatively thin; 2. Strokes in the vertical direction are relatively thick; 3. Strokes in the "left-falling" direction are relatively thin; 4. Strokes in the "right-falling" direction are relatively thick. The above relationship is mapped to a plane coordinate system, as shown in Figure 2, where the strokes in the OA direction are relatively thick. In the embodiments of the present application, a large number of brush handwritings are counted to quantify the above patterns and obtain the angle-width relationship.
[0044] According to the general rules of real paper and pen writing mentioned above, 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 represent the position of the touch sampling point on 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, the two adjacent touch sampling points in Figure 3 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. Then, based on 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 and will not be explained in detail here.
[0045] The trigonometric calculation yields only a numerical value; the precise expression of a specific angle also involves a reference to a preset direction and the direction of the angle change. In one optional 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 0° to -180°, measured counterclockwise around the origin, is the opposite of the preset direction. The angle range from 0° to 180°, measured clockwise around the origin, is the opposite of the preset direction.
[0046] 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 in a counterclockwise direction to the opposite direction of the preset direction is 0° to -180°; the angle range from the preset direction around the origin in a clockwise direction 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 in Figure 2, where the origin is marked as O, the horizontal right is the preset direction, and the horizontal left is the opposite direction of the preset direction. The angle range from the preset direction around the origin in a clockwise direction to the opposite direction of the preset direction is 0° to 180°, that is, the range indicated by the dotted arrow below the x-axis is 0° to 180°; the angle range from the preset direction around the origin in a counterclockwise direction to the opposite direction of the preset direction is 0° to -180°, that is, the range indicated by the dotted arrow above the x-axis is 0° to -180°.
[0047] Step S130: 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.
[0048] Based on the preset angle-width relationship, the corresponding width can be obtained according to the angle corresponding to the current touch sampling point, and this is used as the handwriting width 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 handwriting can be not generated first, or the starting point of the handwriting can be generated according to the default width.
[0049] Depending on the statistical object, the statistical quantity and the angle confirmation method, the angle-width relationship can be expressed in different ways. Figure 4 shows a graphical expression of an exemplary angle-width relationship. In Figure 4, the angle-width relationship is a plurality of piecewise functions, wherein the piecewise functions are linear functions. In Figure 4, the horizontal direction, that is, the handwriting in the 0° and 180° directions is assigned a width of 2; the vertical direction, that is, the handwriting in the -90° and 90° directions is assigned a width of 8; the "left-falling" direction, that is, the handwriting in the -45° and 135° directions is assigned a width of 4; the "right-falling" direction, that is, the handwriting in the 45° and -135° directions is assigned a width of 6. 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 for handwriting size.
[0050] Step S140: drawing a handwriting segment between the first sampling point and the second sampling point according to the handwriting width.
[0051] During the drawing process, you can directly draw a handwriting segment based on the obtained handwriting width. For example, if the confirmed handwriting width is 6, a handwriting segment with a width of 6 will be drawn accordingly. During the writing process, a complete handwriting is formed by connecting the handwriting segments drawn in batches. Two connected touch sampling points correspond to the drawing of a handwriting segment.
[0052] 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 between the first sampling point and the second sampling point with the drawing width. In the embodiment of the present application, there may be a previous handwriting configuration operation equivalent to the writing operation for configuring the handwriting parameters regarding the handwriting writing attributes, including the width parameter. The angle may be affected differently 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. 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 not related to the hardware configuration of the electronic device, and the specific width parameters used are not affected by the screen parameters of the display screen of the electronic device. It can be applied to electronic devices based on touch modules of various types and configurations.
[0053] In the handwriting drawing method described above, the position information of the touch sampling points 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 and the preset direction of the second sampling point pointing to the first sampling point is determined based on the position information, where the second sampling point is the previous touch sampling point adjacent to the first sampling point; the handwriting width of the handwriting between the first sampling point and the second sampling point is determined based on the preset angle-width relationship and the angle; and the handwriting segment between the first sampling point and the second sampling point is drawn based on the handwriting width. By determining the real-time writing direction of the writing operation based on the position information of the touch sampling points, combined with the preset angle-width relationship based on the general rules of real paper and pen writing, the real-time handwriting width during the writing process is obtained and the corresponding handwriting segment is drawn. The handwriting width determination is applicable to electronic devices of various types and screen parameters. Without the need for corresponding hardware improvements or software design for specific types and screen parameters, an effect close to real paper and pen writing can be universally achieved on various existing electronic devices.
[0054] Please refer to Figure 5, which is a structural diagram of a handwriting drawing device provided in an embodiment of the present application. As shown in Figure 5, the handwriting drawing device includes a position information acquisition unit 210, an angle confirmation unit 220, a width confirmation unit 230 and a handwriting segment drawing unit 240.
[0055] Among them, the position information acquisition unit 210 is used to obtain 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 currently acquired first sampling point, the angle between the first direction of the second sampling point pointing to the first sampling point and the preset direction based on the position information, where 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 between the first sampling point and the second sampling point based on the preset angle-width relationship and the angle; and the handwriting segment drawing unit 240 is used to draw the handwriting segment between the first sampling point and the second sampling point based on the handwriting width.
[0056] Based on 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°.
[0057] Based on the above embodiment, 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 in a counterclockwise direction to the opposite direction of the preset direction is 0° to -180°; the angle range from the preset direction around the origin in a clockwise direction to the opposite direction of the preset direction is 0° to 180°.
[0058] Based on the above embodiment, the angle-width relationship is a plurality of piecewise functions.
[0059] Based on the above embodiment, the piecewise function is a linear function.
[0060] Based on the above embodiment, the handwriting drawing unit 240 includes:
[0061] 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;
[0062] 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.
[0063] The handwriting drawing device provided in the embodiments of the present application is included in an electronic device and can be used to execute any of the handwriting drawing methods provided in the above embodiments, and has corresponding functions and beneficial effects.
[0064] 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 this application.
[0065] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 6, 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 processors 310 in the electronic device can be one or more, and Figure 6 uses one processor 310 as an example. The processor 310, memory 320, input device 330, output device 340, and communication device 350 in the electronic device can be connected via a bus or other means, and Figure 6 uses bus connection as an example.
[0066] Memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the handwriting drawing method in the embodiments of the present application. Processor 310 executes the software programs, instructions, and modules stored in memory 320 to execute various functional applications and data processing of the electronic device, thereby implementing the handwriting drawing method described above.
[0067] 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 and at least one application required for a function; the data storage area may store data created based on 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 located 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.
[0068] 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.
[0069] 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.
[0070] An embodiment of the present application 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.
[0071] Those skilled in the art should understand that the embodiments of the present application may provide methods, systems, or computer program products.
[0072] Therefore, the application can adopt the form of complete hardware embodiment, complete software embodiment, or the embodiment in combination with software and hardware. Moreover, the application can adopt 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.) that contain computer-usable program code. The application is described with reference to the flow chart and / or block diagram of the method, equipment (system) and computer program product according to the embodiment of the application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow chart and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instruction executed by the processor of the computer or other programmable data processing device produces a device for realizing the function specified in one flow chart flow chart or multiple flow processes and / or one block or multiple blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device that implements the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes of the flowchart and / or one or more blocks of the block diagram.
[0073] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0074] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The 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 disc read-only memory (CD-ROM), digital versatile disc (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 transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0075] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0076] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application 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 application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.
Claims
1. A handwriting drawing method, wherein: 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, wherein: 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, wherein: 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, wherein: The angle-width relationship is a plurality of piecewise functions.
5. The handwriting drawing method according to claim 4, wherein: The piecewise function is a linear function.
6. The handwriting drawing method according to claim 1, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: When the program is executed by a processor, the handwriting drawing method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Handwriting processing method, handwriting processing device and non-instantaneous storage medium
CN113589999A
Handwriting generation method and related device
CN116027954A
Image processing apparatus for converting image in characteristic region of original image into image of brushstroke patterns
US20130028471A1
Handwriting processing method, handwriting processing apparatus, and storage medium
WO2021218445A1