Handwriting adjustment method, device and electronic device
By adjusting the remaining amount of pigment for handwriting on the electronic whiteboard in real time, the problem of poor simulation results caused by the failure to consider pigment changes in the existing technology is solved, and a more realistic writing simulation effect is achieved.
Patent Information
- Application Number
- CN202110373206.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-04-07
AI Technical Summary
Existing electronic whiteboards fail to effectively consider changes in the amount of pigment during real writing when simulating handwriting, resulting in poor simulation results.
By obtaining the remaining amount of paint in the writing pen in real time during the writing process, the display properties of the handwriting, including color transparency and pen tip deformation, are adjusted to simulate the impact of ink consumption on the handwriting effect.
The simulation level of handwriting on the electronic whiteboard is improved, making it closer to the real writing effect, and enhancing the authenticity and credibility of the simulation.
Smart Images

Figure CN115185427B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of handwriting simulation, and in particular to a method, a device and an electronic device for adjusting handwriting. Background Art
[0002] In order to simulate the pen tip effect of real writing, electronic whiteboards provide a variety of pen types and pen tip effects. However, in the relevant products currently on the market, the simulation of the pen tip often depends on the following factors: writing speed, pressure sensitivity, contact area, etc. The simulated handwriting is either the same color or the color is taken from the map.
[0003] However, in real scenes, the writing effect of some pen types also depends on the amount of pigment stained by the pen. For example, as the ink is consumed in the real writing process of a brush, the handwriting will become lighter and lighter, and even when there is a serious lack of ink, the handwriting will have a split effect.
[0004] However, the products currently on the market do not have the function of taking pigment factors into account in writing effect factors, and the simulation effect of the products needs to be further improved.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a method, device and electronic device for adjusting handwriting, so as to at least solve the technical problem that the handwriting simulation effect of an electronic whiteboard is poor due to failure to consider the influence of the change of the amount of pigment in the actual writing process on the writing effect.
[0007] According to one aspect of an embodiment of the present invention, a method for adjusting writing handwriting is provided, comprising: displaying an electronic whiteboard for writing; performing a writing operation on the electronic whiteboard in response to a writing instruction of a target object to the electronic whiteboard; during the writing operation, obtaining a remaining amount of pigment of the writing pen, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process; during the writing process, adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment.
[0008] Optionally, the display attributes of the handwriting during the writing process are adjusted according to the remaining amount of pigment, including: during the writing process, comparing the remaining amount of pigment with a first threshold; when the remaining amount of pigment is not less than the first threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the first threshold, adjusting the color attributes in the display attributes of the handwriting during subsequent writing operations, so that the color of the handwriting gradually becomes lighter as the remaining amount of pigment decreases, wherein the subsequent writing process is a state where the remaining amount of pigment is less than the first threshold.
[0009] Optionally, the color attribute in the display attribute of the handwriting includes color transparency.
[0010] Optionally, the color attributes in the display attributes are adjusted, including: when the remaining amount of pigment is less than a first threshold value, according to the remaining amount of pigment in each segment of the handwriting in the subsequent writing process, the color gradient information of each segment of the handwriting is determined, and the gradient effect of each segment is set according to the color gradient information; according to the gradient effect of each part of the handwriting, the color attributes of each part of the handwriting are determined, and the handwriting is rendered according to the color attributes.
[0011] Optionally, determining the color information of each part of the handwriting includes determining the transparency of each part of the handwriting.
[0012] Optionally, adjusting the display attributes of handwriting during the writing process based on the remaining amount of pigment includes: during the writing process, comparing the remaining amount of pigment with a second threshold; when the remaining amount of pigment is not less than the second threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the second threshold, deforming the tip of the handwriting based on the remaining amount of pigment.
[0013] Optionally, the tip of the handwriting is deformed according to the type of pen and the remaining amount of paint, including: determining the specific deformation effect of the deformation according to the type of pen; when the remaining amount of paint is less than a second threshold, determining the coverage area change information of each segment of the handwriting according to the remaining amount of paint and the specific deformation effect of each segment of the handwriting in the subsequent writing process, and setting the coverage area information of each segment after the deformation processing according to the coverage area change information; processing the tip of the handwriting according to the coverage area information after the deformation processing of each segment of the handwriting.
[0014] Optionally, the pen tip of the handwriting is processed based on the coverage area information of each segment of the handwriting after the deformation processing, including: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; filling the coverage area of each segment with paint, wherein, after the coverage area is filled with paint, the color attribute in the display attribute of the coverage area is the same as the color attribute of the coverage area corresponding to each segment before the deformation processing.
[0015] Optionally, the pen tip of the handwriting is processed based on the coverage area information of each segment of the handwriting after the deformation processing, including: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; comparing the coverage area with the coverage area of each segment before the deformation processing, and determining the area in the coverage area before the deformation processing that is not included in the coverage area after the deformation processing; setting the area to colorless or the same color as the background color of the electronic whiteboard.
[0016] Optionally, during the writing operation, the electronic whiteboard can modify the remaining amount of paint of the writing pen in response to the target object's instruction to modify the remaining amount of paint of the electronic whiteboard, including increasing the remaining amount of paint of the writing pen or reducing the remaining amount of paint of the writing pen.
[0017] According to another aspect of an embodiment of the present invention, a handwriting display method is also provided, including: displaying an electronic whiteboard for writing; displaying the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the handwriting amount is the coverage area of the handwriting during the writing process; and displaying the handwriting after adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment.
[0018] Optionally, the handwriting display method also includes an interactive interface, which can also respond to the user's operating instructions, select a part of handwriting from existing handwriting, and process the part of handwriting, including: the interactive interface responds to the user's operating instructions to determine the type of pen and the change in the remaining amount of paint in the pen; based on the type of pen and the change in the remaining amount of paint in the pen, determine the display attributes of a part of handwriting.
[0019] Optionally, during the writing operation, the interactive interface can modify the remaining amount of paint of the writing pen in response to the target object's instruction to modify the remaining amount of paint of the electronic whiteboard, including increasing the remaining amount of paint of the writing pen or decreasing the remaining amount of paint of the writing pen.
[0020] According to another aspect of an embodiment of the present invention, a writing handwriting simulation device is also provided, including: a display module for displaying an electronic whiteboard for writing; a writing module for performing writing operations on the electronic whiteboard in response to a writing instruction of a target object to the electronic whiteboard; an acquisition module for acquiring a remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the handwriting amount is the coverage area of the handwriting during the writing process; and a processing module for adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment.
[0021] According to another aspect of an embodiment of the present invention, there is also provided an electronic device comprising: a memory for storing programs; a processor for running the programs stored in the memory, and performing the following functions when running the programs: performing a writing operation on the electronic whiteboard in response to a writing instruction from a target object to the electronic whiteboard; obtaining a remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process; during the writing process, adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment; a display device for displaying the electronic whiteboard and the handwriting during the writing process; an input device for receiving a writing instruction from the target object and generating handwriting corresponding to the writing instruction.
[0022] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method for adjusting the handwriting.
[0023] In an embodiment of the present invention, an electronic whiteboard for writing is displayed; in response to a writing instruction of a target object to the electronic whiteboard, a writing operation is performed on the electronic whiteboard; during the writing operation, the remaining amount of pigment of the writing pen is obtained, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the handwriting amount is the coverage area of the handwriting during the writing process; during the writing process, the display properties of the handwriting during the writing process are adjusted according to the remaining amount of pigment, and the purpose of improving the handwriting simulation degree is achieved by increasing the factor of the remaining amount of pigment, thereby achieving the technical effect of making the handwriting on the electronic whiteboard closer to the real writing effect, thereby solving the technical problem of poor handwriting simulation effect on the electronic whiteboard due to failure to consider the influence of the change of the amount of pigment in the real writing process on the writing effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 is a flow chart of a method for adjusting handwriting according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of an interactive interface according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of the principle of processing the deformation of a pen tip according to an embodiment of the present invention;
[0028] Figure 4is a schematic diagram of a handwriting effect after processing according to an embodiment of the present invention;
[0029] Figure 5 is a structural schematic diagram of a writing handwriting adjustment device according to an embodiment of the present invention;
[0030] Figure 6 is a flow chart of a handwriting display method according to an embodiment of the present invention;
[0031] Figure 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] Example 1
[0035] According to an embodiment of the present invention, a method embodiment of a handwriting adjustment method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] Figure 1 is a handwriting adjustment method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0037] Step S102, displaying an electronic whiteboard for writing;
[0038] In some embodiments of the present application, the user can personalize the electronic whiteboard, such as setting the background color of the electronic whiteboard to a different color, or setting the background of the electronic whiteboard to a pre-stored variety of writing background templates, such as grid paper, horizontal lined letter paper, etc.
[0039] Step S104, in response to the target object's writing instruction on the electronic whiteboard, performing a writing operation on the electronic whiteboard;
[0040] It should be noted that when the target object performs a writing operation on the electronic whiteboard, the electronic whiteboard can respond to the target object's operation instruction and set the type of writing pen and the writing effect. The types of writing pens include writing brushes, fountain pens, ballpoint pens, paintbrushes, etc.; the writing effects include handwriting width, pigment color, etc.
[0041] In some embodiments of the present application, when the electronic device running the electronic whiteboard is an electronic device with pressure sensitivity, the electronic whiteboard can respond to the operation instruction of the target object and adjust the writing effect during the writing process of the target object. For example, in response to the pressure of the target object on the electronic device during the writing process, the width of the handwriting is adjusted, and the width of the handwriting is positively correlated with the pressure.
[0042] Step S106, during the writing operation, obtaining the remaining amount of pigment of the writing pen, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process;
[0043] It should be noted that the writing pen in the electronic whiteboard may be in the form of a virtual pen, a touch point, or a cursor.
[0044] In some embodiments of the present application, parameters that need to be clarified during the writing operation include: the pigment storage capacity K of the pen tip, that is, the maximum amount of pigment that can be stored; the remaining pigment amount P of the pen tip, that is, the current remaining amount of pigment; the pigment consumption coefficient k of the pen tip, which represents the speed of pigment use when writing. The larger k is, the more pigment is used for the same handwriting area, and the faster the pigment is consumed; the handwriting color transparency α, which takes values 0 to 1, 0 is opaque, and 1 is fully transparent; the pigment amount threshold β when the color changes, that is, the first threshold mentioned above. When the remaining pigment amount P<β, the color of the handwriting begins to gradually fade; the pigment amount threshold θ when the pen tip effect changes, that is, the second threshold. When the remaining pigment amount P<θ, the pen tip of the handwriting begins to deform.
[0045] Specifically, the relationship between the amount of handwriting and the above parameters is: the remaining amount of pigment gradually decreases with the amount of handwriting Q. The amount of handwriting can be measured by the area covered by the handwriting, or it can be roughly measured by factors such as the writing time and the default handwriting width (the handwriting width may change during the writing process). That is, the remaining amount of handwriting can be represented by the following formula: P = P 0 -KQ. Where P 0 Initial value of the remaining amount of pigment, when full of pigment P 0 =K. As can be seen from the above formula, P is proportional to -Q, and there is no limit on the proportional relationship k. The size of k can be adjusted according to the specific effect, or k can be made a dynamic variable.
[0046] Step S108, during the writing process, adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment.
[0047] In some embodiments of the present application, the display attributes of the handwriting during the writing process are adjusted according to the remaining amount of pigment, including: during the writing process, comparing the remaining amount of pigment with a first threshold; when the remaining amount of pigment is not less than the first threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the first threshold, adjusting the color attributes in the display attributes of the handwriting during subsequent writing operations, so that the color of the handwriting gradually becomes lighter as the remaining amount of pigment decreases, wherein the subsequent writing process is a state where the remaining amount of pigment is less than the first threshold, and the color attributes include transparency.
[0048] In some embodiments of the present application, adjusting the color attributes in the display attributes means that when the remaining amount of pigment is less than the first threshold, based on the remaining amount of pigment in each segment of the handwriting in the subsequent writing process, the color gradient information of each segment of the handwriting is determined, and the gradient effect of each segment is set according to the color gradient information; based on the gradient effect of each part of the handwriting, the color attributes of each part of the handwriting are determined, and the handwriting is rendered according to the color attributes.
[0049] Wherein, determining the color information of each part of the handwriting includes determining the transparency of each part of the handwriting.
[0050] For example, when the remaining amount of pigment P≥β, the color of the handwriting does not change with the change of P, and is displayed with the current color of the pigment. When the remaining amount of pigment P<β, the color of the handwriting begins to gradually become lighter as the subsequent handwriting amount Q' increases.
[0051] The color change formula is as follows:
[0052]
[0053] It can be seen from the above formula that when P<β, α is inversely proportional to P+1, but the proportional relationship is not limited. The change ratio can be added according to the specific effect, or the dynamic change ratio can be added.
[0054] In some embodiments of the present application, as the amount of remaining pigment decreases, the method for achieving lighter handwriting may adopt the following scheme:
[0055] The small path between adjacent touch points (and the segmentation of the handwriting mentioned above) can be obtained through the above calculation. The α (transparency) value of each path can be set from the direction from the previous touch point to the current touch point. The gradient effect of Paint is set from α n-1 to α n Use LinearGradient to set the brush Paint's Shader for gradient. The Android code is as follows
[0056]
[0057] Among them, point_before_x, point_before_y, point_current_x, point_current_y represent the positions of the two points before and after, colorStart, colorEnd color gradient range, colorStart transparency is α n-1 , the transparency of colorEnd is α n .
[0058] The above-mentioned touch points refer to points obtained from the handwriting to be processed.
[0059] In some embodiments of the present application, adjusting the display attributes of the handwriting during the writing process based on the remaining amount of pigment also includes: during the writing process, comparing the remaining amount of pigment with a second threshold; when the remaining amount of pigment is not less than the second threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the second threshold, deforming the tip of the handwriting based on the remaining amount of pigment.
[0060] For example, when the remaining amount of pigment P≥θ, the pen tip of the handwriting adopts the normal pen tip effect. When the remaining amount of pigment P<θ, the pen tip is set to start deformation, and the specific deformation effect is determined by the remaining amount of pigment and the type of pen, among which the type of pen determines which specific deformation occurs. For example, when the brush is short of pigment, the pen tip will have a split phenomenon. Common deformation processing includes adjusting the width of the pen tip, not closing the pen tip, increasing the gap between handwriting, etc.
[0061] It should be noted that the above-mentioned first threshold and second threshold can be set by the target object itself, and the first threshold and the second threshold can be the same or different; and when a section of handwriting needs to be processed with both color attributes adjustment and pen tip deformation, the color attributes adjustment or pen tip deformation processing can be performed first, or the color attributes adjustment and pen tip deformation processing can be performed at the same time, that is, deformation and color change are two independent processes.
[0062] Specifically, the steps of deforming the tip of the handwriting according to the type of the pen and the remaining amount of paint are as follows: when the remaining amount of paint is less than the second threshold, determine the coverage area change information of each segment of the handwriting according to the remaining amount of paint of each segment of the handwriting and the type of the pen during the subsequent writing process, and set the coverage area information of each segment after deformation processing according to the coverage area change information; process the tip of the handwriting according to the coverage area information of each segment of the handwriting after deformation processing.
[0063] In some embodiments of the present application, the pen tip of the handwriting is processed based on the coverage area information of each segment of the handwriting after the deformation processing, including: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; filling the coverage area of each segment with paint, wherein, after the coverage area is filled with the paint, the color attribute in the display attribute of the coverage area is the same as the color attribute of the coverage area corresponding to each segment before the deformation processing.
[0064] Processing the pen tip of the handwriting based on the coverage area information of each segment of the handwriting after the deformation processing also includes the following steps: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; comparing the coverage area with the coverage area of each segment before the deformation processing, and determining the area in the coverage area before the deformation processing that is not included in the coverage area after the deformation processing; setting the area to colorless or the same color as the background color of the electronic whiteboard.
[0065] For example, when the deformation processing is to increase or reduce the handwriting width, it is necessary to determine the handwriting width of each part of the handwriting after the deformation processing based on the type of the pen and the remaining amount of the pigment; when the handwriting width of a part of each part of the handwriting is greater than the handwriting width of the part of the handwriting before the deformation processing, select an area near the part of the handwriting, and fill the area with the same color as the handwriting color of the part of the handwriting, wherein the nearby area is the coverage area after the deformation of the part of the handwriting, which is an area that increases relative to the coverage area before the deformation of the part of the handwriting; when the handwriting width of a part of each part of the handwriting is less than the handwriting width of the part of the handwriting before the deformation processing, select a partial area in the part of the handwriting, and set the color in the partial area to colorless, wherein the partial area is the coverage area after the deformation of the part of the handwriting, which is an area that decreases relative to the coverage area before the deformation of the part of the handwriting.
[0066] In some embodiments of the present application, when the pen tip of the handwriting is processed to increase the space between the handwritings, the path formed by the two touch points can be drawn first, and then a thinner pen width is set with the same path, and the background color is used as the pen color, and drawn on it with a set offset to simulate the handwriting cracking, such as Figure 3 shown. Figure 3 The left side shows the handwriting before deformation, and the right side shows the handwriting after deformation.
[0067] In some embodiments of the present application, during the writing operation, the electronic whiteboard can modify the remaining amount of paint of the writing pen in response to the target object's instruction to modify the remaining amount of paint of the electronic whiteboard, including increasing the remaining amount of paint of the writing pen or decreasing the remaining amount of paint of the writing pen.
[0068] Through the above steps, it is possible to better simulate the actual writing effect in the electronic whiteboard, such as Figure 4 As shown. Figure 4 As can be seen, as the writing process progresses, the amount of remaining pigment decreases, first the tip of the brush deforms, and then the color changes from dark to light, which well restores the effect of writing with a brush.
[0069] In some embodiments of the present application, there is also provided a Figure 6 The handwriting display method shown includes:
[0070] S602, showing an electronic whiteboard for writing;
[0071] S604, displaying the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process;
[0072] S606, displaying the handwriting during the writing process after adjusting the display attributes of the handwriting during the writing process according to the remaining amount of the pigment.
[0073] In addition, in some embodiments of the present application, the display method also includes a display interface, and the interactive interface can also respond to the user's operating instructions, select a part of handwriting from the existing handwriting, and process the part of handwriting, including: the interactive interface responds to the user's operating instructions to determine the type of the pen and the change in the remaining amount of paint in the pen; determine the display attributes of the part of handwriting based on the type of the pen and the change in the remaining amount of paint in the pen.
[0074] In some embodiments of the present application, the interactive interface is as follows: Figure 2 As shown, Figure 2 The left half is the handwriting display and writing area, and the right half is the corresponding setting area. The color palette can be used to replenish the paint for the stylus. Specifically, the user can point the tip of the stylus to the color palette for a period of time to replenish the paint.
[0075] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0076] Example 2
[0077] According to an embodiment of the present invention, a device embodiment of a handwriting adjustment device is also provided, such as Figure 5 As shown, it includes: a display module 50, used for displaying an electronic whiteboard for writing; a writing module 52, used for performing writing operations in the electronic whiteboard in response to a writing instruction of a target object to the electronic whiteboard; an acquisition module 54, used for acquiring the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process; a processing module 56, used for adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment during the writing process.
[0078] In some embodiments of the present application, the display module 50 allows the user to personalize the electronic whiteboard, such as setting the background color of the electronic whiteboard to a different color, or setting the background of the electronic whiteboard to a pre-stored variety of writing background templates, such as grid paper, horizontal lined letter paper, etc.
[0079] It should be noted that when the target object performs a writing operation on the electronic whiteboard, the electronic whiteboard can respond to the target object's operation instruction and set the type of writing pen and the writing effect. The types of writing pens include writing brushes, fountain pens, ballpoint pens, paintbrushes, etc.; the writing effects include handwriting width, pigment color, etc.
[0080] In some embodiments of the present application, when the electronic device running the electronic whiteboard is an electronic device with pressure sensitivity, the writing module of the electronic whiteboard can respond to the operation instruction of the target object and adjust the writing effect during the writing process of the target object. For example, in response to the pressure of the target object on the electronic device during the writing process, the width of the handwriting is adjusted, and the width of the handwriting is positively correlated with the pressure.
[0081] In some embodiments of the present application, parameters that need to be clarified during the writing operation include: the pigment storage capacity K of the pen tip, that is, the maximum amount of pigment that can be stored; the remaining pigment amount P of the pen tip, that is, the current remaining amount of pigment; the pigment consumption coefficient k of the pen tip, which represents the speed of pigment use when writing. The larger k is, the more pigment is used for the same handwriting area, and the faster the pigment is consumed; the handwriting color transparency α, which takes values 0 to 1, 0 is opaque, and 1 is fully transparent; the pigment amount threshold β when the color changes, that is, the first threshold mentioned above. When the remaining pigment amount P<β, the color of the handwriting begins to gradually fade; the pigment amount threshold θ when the pen tip effect changes, that is, the second threshold. When the remaining pigment amount P<θ, the pen tip of the handwriting begins to deform.
[0082] Specifically, the relationship between the amount of handwriting and the above parameters is: the remaining amount of pigment gradually decreases with the amount of handwriting Q. The amount of handwriting can be measured by the area covered by the handwriting, or it can be roughly measured by factors such as the writing time and the default handwriting width (the handwriting width may change during the writing process). That is, the remaining amount of handwriting can be represented by the following formula: P = P 0 -KQ. Where P 0 Initial value of the remaining amount of pigment, when full of pigment P 0 =K. As can be seen from the above formula, P is proportional to -Q, and there is no limit on the proportional relationship k. The size of k can be adjusted according to the specific effect, or k can be made a dynamic variable.
[0083] In some embodiments of the present application, the display attributes of the handwriting during the writing process are adjusted according to the remaining amount of pigment, including: during the writing process, comparing the remaining amount of pigment with a first threshold; when the remaining amount of pigment is not less than the first threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the first threshold, adjusting the color attributes in the display attributes of the handwriting during subsequent writing operations, so that the color of the handwriting gradually becomes lighter as the remaining amount of pigment decreases, wherein the subsequent writing process is a state where the remaining amount of pigment is less than the first threshold, and the color attributes include transparency.
[0084] In some embodiments of the present application, adjusting the color attributes in the display attributes means that when the remaining amount of pigment is less than the first threshold, based on the remaining amount of pigment in each segment of the handwriting in the subsequent writing process, the color gradient information of each segment of the handwriting is determined, and the gradient effect of each segment is set according to the color gradient information; based on the gradient effect of each part of the handwriting, the color attributes of each part of the handwriting are determined, and the handwriting is rendered according to the color attributes.
[0085] Wherein, determining the color information of each part of the handwriting includes determining the transparency of each part of the handwriting.
[0086] For example, when the remaining amount of pigment P≥β, the color of the handwriting does not change with the change of P, and is displayed with the current color of the pigment. When the remaining amount of pigment P<β, the color of the handwriting begins to gradually become lighter as the subsequent handwriting amount Q' increases.
[0087] The color change formula is as follows:
[0088]
[0089] It can be seen from the above formula that when P<β, α is inversely proportional to P+1, but the proportional relationship is not limited. The change ratio can be added according to the specific effect, or the dynamic change ratio can be added.
[0090] In some embodiments of the present application, as the amount of remaining pigment decreases, the method for achieving lighter handwriting may adopt the following scheme:
[0091] The small path between adjacent touch points (and the segmentation of the handwriting mentioned above) can be obtained through the above calculation. The α (transparency) value of each path can be set from the direction from the previous touch point to the current touch point. The gradient effect of Paint is set from α n-1 to α n To make a gradient, use LinearGradient to set the Shader of the brush Paint. The Android code is as follows:
[0092]
[0093] Among them, point_before_x, point_before_y, point_current_x, point_current_y represent the positions of the two points before and after, colorStart, colorEnd color gradient range, colorStart transparency is α n-1 , the transparency of colorEnd is α n .
[0094] The above-mentioned touch points refer to points obtained from the handwriting to be processed.
[0095] In some embodiments of the present application, adjusting the display attributes of the handwriting during the writing process based on the remaining amount of pigment also includes: during the writing process, comparing the remaining amount of pigment with a second threshold; when the remaining amount of pigment is not less than the second threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the second threshold, deforming the tip of the handwriting based on the remaining amount of pigment.
[0096] For example, when the remaining amount of pigment P≥θ, the pen tip of the handwriting adopts the normal pen tip effect. When the remaining amount of pigment P<θ, the pen tip is set to start deformation. The specific deformation effect is determined by the remaining amount of pigment and the type of pen. For example, when the brush is short of pigment, the pen tip will have a split phenomenon. Common deformation processing includes adjusting the width of the pen tip, not closing the pen tip, and increasing the space between handwriting.
[0097] It should be noted that the above-mentioned first threshold and second threshold can be set by the target object itself, and the first threshold and the second threshold can be the same or different; and when a section of handwriting needs to be processed with both color attributes adjustment and pen tip deformation, the color attributes adjustment or the pen tip deformation can be performed first, or the color attributes adjustment and the pen tip deformation can be performed at the same time.
[0098] Specifically, the steps of deforming the tip of the handwriting according to the type of the pen and the remaining amount of paint are as follows: when the remaining amount of paint is less than the second threshold, determine the coverage area change information of each segment of the handwriting according to the remaining amount of paint of each segment of the handwriting and the type of the pen during the subsequent writing process, and set the coverage area information of each segment after deformation processing according to the coverage area change information; process the tip of the handwriting according to the coverage area information of each segment of the handwriting after deformation processing.
[0099] In some embodiments of the present application, the pen tip of the handwriting is processed based on the coverage area information of each segment of the handwriting after the deformation processing, including: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; filling the coverage area of each segment with paint, wherein, after the coverage area is filled with the paint, the color attribute in the display attribute of the coverage area is the same as the color attribute of the coverage area corresponding to each segment before the deformation processing.
[0100] Processing the pen tip of the handwriting based on the coverage area information of each segment of the handwriting after the deformation processing also includes the following steps: determining the coverage area of each segment of the handwriting after the deformation processing based on the coverage area information of each segment after the deformation processing; comparing the coverage area with the coverage area of each segment before the deformation processing, and determining the area in the coverage area before the deformation processing that is not included in the coverage area after the deformation processing; setting the area to colorless or the same color as the background color of the electronic whiteboard.
[0101] For example, when the deformation processing is to increase or reduce the handwriting width, it is necessary to determine the handwriting width of each part of the handwriting after the deformation processing based on the type of the pen and the remaining amount of the pigment; when the handwriting width of a part of each part of the handwriting is greater than the handwriting width of the part of the handwriting before the deformation processing, select an area near the part of the handwriting, and fill the area with the same color as the handwriting color of the part of the handwriting, wherein the nearby area is the coverage area after the deformation of the part of the handwriting, which is an area that increases relative to the coverage area before the deformation of the part of the handwriting; when the handwriting width of a part of each part of the handwriting is less than the handwriting width of the part of the handwriting before the deformation processing, select a partial area in the part of the handwriting, and set the color in the partial area to colorless, wherein the partial area is the coverage area after the deformation of the part of the handwriting, which is an area that decreases relative to the coverage area before the deformation of the part of the handwriting.
[0102] In some embodiments of the present application, when the pen tip of the handwriting is processed to increase the space between the handwritings, the path formed by the two touch points can be drawn first, and then a thinner pen width is set with the same path, and the background color is used as the pen color, and drawn on it with a set offset to simulate the handwriting cracking, such as Figure 3 shown. Figure 3 The left side shows the handwriting before deformation, and the right side shows the handwriting after deformation.
[0103] In some embodiments of the present application, during the writing operation, the electronic whiteboard can modify the remaining amount of paint of the writing pen in response to the target object's instruction to modify the remaining amount of paint of the electronic whiteboard, including increasing the remaining amount of paint of the writing pen or decreasing the remaining amount of paint of the writing pen.
[0104] Example 3
[0105] According to an embodiment of the present invention, there is also provided a Figure 7 The electronic device shown includes: a memory for storing programs and data; a processor for running the programs stored in the memory and performing the following functions when running the programs: performing writing operations on the electronic whiteboard in response to writing instructions from a target object to the electronic whiteboard; obtaining the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing process, and the amount of handwriting is the coverage area of the handwriting during the writing process; during the writing process, adjusting the display properties of the handwriting during the writing process according to the remaining amount of pigment; a display device for displaying the electronic whiteboard and the handwriting during the writing process; an input device for receiving the writing instructions of the target object and generating handwriting corresponding to the writing instructions.
[0106] In some embodiments of the present application, the display device may also display the interactive interface described above. The input device may also respond to the user's operation instructions to personalize the electronic whiteboard.
[0107] Example 4
[0108] According to an embodiment of the present invention, a non-volatile storage medium is further provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method for adjusting the handwriting.
[0109] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0111] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0112] 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-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0113] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0114] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for adjusting handwriting, It is characterized in that include: Display an electronic whiteboard for writing; In response to a writing instruction from a target object to the electronic whiteboard, performing a writing operation on the electronic whiteboard; During the writing operation, the remaining amount of pigment of the writing pen is obtained, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing operation, and the amount of handwriting is the coverage area of the handwriting during the writing operation; During the writing operation, comparing the remaining amount of pigment with a first threshold value; When the remaining amount of the pigment is not less than the first threshold, continue to draw the handwriting according to the current display attribute; When the remaining amount of pigment is less than the first threshold value, the color attributes in the display attributes of the handwriting during the subsequent writing operation are adjusted, wherein the color attributes in the display attributes of the handwriting include color transparency. Adjusting the color attributes in the display attributes of the handwriting during the writing operation includes: adjusting the color transparency of the handwriting so that the color transparency of the handwriting gradually becomes lighter as the remaining amount of pigment decreases.
2. The method according to claim 1, It is characterized in that Adjust the color attributes in the display attributes, including: When the remaining amount of the pigment is less than the first threshold, according to the remaining amount of the pigment of each segment of the handwriting in the subsequent writing operation, the color gradient information of each segment of the handwriting is determined, and the gradient effect of each segment is set according to the color gradient information; According to the gradient effect of each part of the handwriting, the color attribute of each part of the handwriting is determined, and the handwriting is rendered according to the color attribute.
3. The method according to claim 1, It is characterized in that Adjusting the display attribute of the handwriting during the writing operation according to the remaining amount of the pigment includes: During the writing operation, comparing the remaining amount of pigment with a second threshold value; When the remaining amount of the pigment is not less than the second threshold, continue to draw the handwriting according to the current display attribute; When the remaining amount of the pigment is less than a second threshold, the tip of the handwriting is deformed according to the remaining amount of the pigment.
4. The method according to claim 3, It is characterized in that According to the type of the pen and the amount of the remaining pigment, the tip of the pen handwriting is deformed, including: Determining a specific deformation effect of the deformation according to the type of the pen; When the remaining amount of the pigment is less than the second threshold, according to the remaining amount of the pigment of each segment of the handwriting and the specific deformation effect during the writing operation, determining the coverage area change information of each segment of the handwriting, and setting the coverage area information of each segment after the deformation processing according to the coverage area change information; The pen tip of the handwriting is processed according to the coverage area information of each segment of the handwriting after deformation processing.
5. The method according to claim 4, It is characterized in that Processing the pen tip of the handwriting according to the coverage area information of each segment of the handwriting after deformation processing, including: Determining the coverage area of each segment of the handwriting after the deformation processing according to the coverage area information of each segment after the deformation processing; Fill the coverage area of each segment with paint, wherein after the coverage area is filled with the paint, the color attribute in the display attribute of the coverage area is the same as the color attribute of the coverage area corresponding to each segment before the deformation processing.
6. The method according to claim 4, It is characterized in that Processing the pen tip of the handwriting according to the coverage area information of each segment of the handwriting after deformation processing, including: Determining the coverage area of each segment of the handwriting after the deformation processing according to the coverage area information of each segment after the deformation processing; Compare the coverage area with the coverage area of each segment before deformation processing, and determine the area in the coverage area before deformation processing that is not included in the coverage area after deformation processing; Set the area to the same color as the background color of the electronic whiteboard.
7. The method according to claim 1, It is characterized in that The method also includes: during the writing operation, in response to the target object's instruction to modify the remaining amount of paint of the electronic whiteboard, modifying the remaining amount of paint of the writing pen, wherein the modification includes: increasing the remaining amount of paint of the writing pen or reducing the remaining amount of paint of the writing pen.
8. A handwriting display method, It is characterized in that include: Display an electronic whiteboard for writing; Displaying the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing operation, and the amount of handwriting is the coverage area of the handwriting during the writing operation; Displaying handwriting after adjusting the display attributes of the handwriting during the writing operation according to the remaining amount of pigment during the writing operation, wherein the display attributes of the handwriting are adjusted in the following manner: during the writing operation, comparing the remaining amount of pigment with a first threshold; when the remaining amount of pigment is not less than the first threshold, continuing to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the first threshold, adjusting the color attributes in the display attributes of the handwriting during the subsequent writing operation, wherein the color attributes in the display attributes of the handwriting include color transparency, and adjusting the color attributes in the display attributes of the handwriting during the writing operation includes: adjusting the color transparency of the handwriting so that the color transparency of the handwriting gradually becomes lighter as the remaining amount of pigment decreases.
9. A writing handwriting adjustment device, It is characterized in that include: A display module, used for displaying an electronic whiteboard for writing; A writing module, used for performing a writing operation on the electronic whiteboard in response to a writing instruction of a target object to the electronic whiteboard; An acquisition module, used for acquiring the remaining amount of pigment of the writing pen during the writing operation, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing operation, and the amount of handwriting is the coverage area of the handwriting during the writing operation; A processing module is used to compare the remaining amount of pigment with a first threshold value during a writing operation; when the remaining amount of pigment is not less than the first threshold value, continue to draw the handwriting according to the current display attributes; when the remaining amount of pigment is less than the first threshold value, adjust the color attributes in the display attributes of the handwriting during the subsequent writing operation, wherein the color attributes in the display attributes of the handwriting include color transparency, and adjusting the color attributes in the display attributes of the handwriting during the subsequent writing operation includes: adjusting the color transparency of the handwriting so that the color transparency of the handwriting gradually becomes lighter as the remaining amount of pigment decreases.
10. An electronic device, It is characterized in that include: Memory, used to store programs; A processor, for running a program stored in the memory, and performing the following functions when running the program: in response to a writing instruction of a target object to an electronic whiteboard, performing a writing operation on the electronic whiteboard; during the writing operation, obtaining a remaining amount of pigment of the writing pen, wherein the remaining amount of pigment decreases as the amount of handwriting increases during the writing operation, and the amount of handwriting is the coverage area of the handwriting during the writing operation; during the writing operation, comparing the remaining amount of pigment with a first threshold; when the remaining amount of pigment is not less than the first threshold, continuing to draw the handwriting according to the current display attribute; when the remaining amount of pigment is less than the first threshold, adjusting the color attribute in the display attribute of the handwriting during the writing operation, wherein the color attribute in the display attribute of the handwriting includes color transparency, and adjusting the color attribute in the display attribute of the handwriting during the subsequent writing operation includes: adjusting the color transparency of the handwriting so that the color transparency of the handwriting gradually becomes lighter as the remaining amount of pigment decreases; A display device, used to display the electronic whiteboard and the handwriting during the writing operation; The input device is used to receive the writing instruction of the target object and generate handwriting corresponding to the writing instruction.
11. A non-volatile storage medium, It is characterized in that The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the handwriting adjustment method according to any one of claims 1 to 7.
