The present disclosure relates to the field of screen writing technologies, and in particular, to a method for implementing a brush stroke of an electronic whiteboard marker, a storage medium, and an electronic whiteboard.
In order to enhance writing experience of a whiteboard and meet needs of different writing enthusiasts, various handwriting modes are usually set up in the whiteboard, but widths of handwritings are usually consistent. Start and end strokes are completed with a round-head brush stroke, which is similar to a handwriting of a round-head watercolor pen.
With the increasing popularity of an electronic whiteboard, a user has a higher requirement for beauty of a written character. A brush stroke added during writing can improve beauty of a typeface to a certain extent. In existing technologies, a pressure sensitive pen is used to write a character with a brush stroke, but this requires a writing pen to have a pressure sensor, which is costly and can easily damage the writing pen due to too many presses.
In order to simulate an application scenario of an electronic whiteboard marker in daily life and meet needs of more users, it is required to provide a method for implementing a brush stroke of an electronic whiteboard marker, to make horizontal, vertical line, left-falling, and right-falling strokes have different widths and start and end strokes have a square-head brush stroke. Therefore, the following disclosure is proposed:
A method for implementing a brush stroke of an electronic whiteboard marker includes following steps:
Further, the constructing a parallelogram in the handwriting unit specifically includes following steps:
Further, a distance between the handwriting units obtained through the division is one fourth of a current handwriting width.
Further, the handwriting unit is a rectangle.
A computer-readable storage medium stores a computer program, where the computer program is executed by a processor to implement the foregoing method for implementing a brush stroke of an electronic whiteboard marker.
An electronic whiteboard includes:
The present disclosure divides a writing trajectory into a plurality of small handwriting units for displaying, such that different superposition effects can be presented in each handwriting unit during drawing, forming different brush strokes such as horizontal, vertical line, left-falling, and right-falling strokes. In addition, compensation points of adjacent handwriting units are calculated, connected, and relevant colors are filled based on the compensation points, which can effectively cover a toothed border formed by superposition of the handwriting units, making a boundary contour smoother.
The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
The implementations of the present disclosure are described below through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present disclosure. The present disclosure can also be implemented or applied through other different specific implementations. Based on different viewpoints and applications, various modifications or amendments can be made to various details of this specification without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments may be combined with each other provided that no conflict occurs. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts should fall within the protection scope of the present disclosure.
As shown in
Step S1: Obtain touchpoint coordinates in a writing process, and construct a Bézier curve equation based on the touchpoint coordinates.
In a specific implementation process of the present disclosure, the electronic whiteboard marker may be a regular paintbrush, a finger of a user, or a pressure sensitive pen. The writing process is carried out in a touch screen of an electronic whiteboard 1. The touch screen may be a capacitive touch screen, an infrared touch screen, or another touch screen. A coordinate system is constructed on the touch screen. When the electronic whiteboard marker moves to write on the touch screen of the electronic whiteboard 1, the electronic whiteboard 1 collects, by using the touch screen, each coordinate value of each coordinate point that the electronic whiteboard marker passes through in the touch screen, in other words, values of a coordinate point (x, y).
Step S2: Divide a handwriting curve into continuous handwriting units equidistantly based on the Bézier curve equation.
A Bézier curve is a mathematical curve applied to a two-dimensional graphics application, and is used by general vector graphics software to accurately draw a curve. The Bézier curve is composed of a line segment and a node. The node is a draggable fulcrum, and the line segment is like a stretchable rubber band. As shown in
Step S3: Construct the parallelogram in the handwriting unit and obtain a midpoint of the parallelogram formed in the handwriting unit.
Usually, the handwriting unit 2 is represented as a rectangle. An upper-left vertex of a top edge of the rectangle is connected to a point located at ½ of a bottom edge, and a point located at ½ of the top edge of the rectangle is connected to a lower-right vertex of the bottom edge, to form an oblique quadrilateral.
Step S4: Connect a midpoint of each parallelogram to form a midpoint connection line.
Step S5: Calculate directed area of a vector cross product of the midpoint connection line and a diagonal of the parallelogram, and determine a compensation point of the handwriting unit based on the directed area of the vector cross product.
Step S6: If the directed area of the vector cross product is greater than 0, select an upper-left vertex and a lower-right vertex of the parallelogram as compensation points; or if the directed area of the vector cross product is less than 0, select an upper-right vertex and a lower-left vertex of the parallelogram as compensation points.
As shown in
As shown in
Further, referring to
As shown in
Further, in a preferred embodiment of the present disclosure, the handwriting unit 2 is a rectangle.
Further, in a preferred embodiment of the present disclosure, the step S3 specifically includes following steps:
Step S7: Connect adjacent ones of the handwriting units to form a closed compensation zone.
Regardless of which direction the curve is facing, the handwriting unit 2 preserves quadrilaterals in a same direction. Therefore, during extension in different directions, a cross-section of a curve generated by unit superposition has different widths, achieving different superposition effects.
Step S8: Fill the compensation zone with a handwriting-related color.
Further, in a preferred embodiment of the present disclosure, a distance between the handwriting units obtained through the division is one fourth of a current handwriting width.
As shown in
A computer-readable storage medium stores a computer program. The computer program is executed by a processor to implement the foregoing method for implementing a brush stroke of an electronic whiteboard marker.
An electronic whiteboard includes:
The embodiments of the present disclosure also provide an electronic whiteboard 1, as shown in
The input unit 30 is configured to receive an input signal and receive a keyword input by a user. The input unit 30 may include a touch panel and another input device. The touch panel can collect a touch operation performed by the user on or near the touch panel (such as an operation performed by the user on or near the touch panel by using any suitable object such as a finger or a stylus), and drive a corresponding connection apparatus according to a preset program. The another input device may include but is not limited to one or more of a physical keyboard, a function key (such as a volume control key or a switch key), a trackball, a mouse, a joystick, and the like. The display unit 40 can be configured to display information input by or provided to the user and various menus of the electronic whiteboard 1. The display unit 40 may be in a form of a liquid crystal display (LCD), an organic light emitting diode (OLED), or the like. The processor 10 is a control center of the electronic whiteboard 1, and various parts of the whole electronic whiteboard 1 are connected by using various interfaces and lines. By running or executing the software programs and/or modules stored in the memory 20 and invoking data stored in the memory 20, the processor 10 implements various functions and processes data. A person skilled in the art can clearly understand that, for convenience and brevity of description, reference may be made to corresponding processes in the foregoing method embodiments for specific working processes of the foregoing systems, apparatuses, and units. Details are not described herein again.
In a specific implementation process of the present disclosure, values of each coordinate point that a paintbrush (which may be a regular paintbrush or a finger of the user) passes through in a touch screen are collected, and corresponding time is obtained. The collected coordinate point values and the obtained time are stored in the memory together, and two coordinate point values of last time are extracted to predict coordinates of an end point of a brush stroke. Then based on a distance between coordinate point values at a last time point and the predicted coordinates of the end point, filling is performed according to a preset handwriting filling rule. In this way, a beautiful brush stroke can be written without using a touch sensitive pen. In addition, there is no high requirement for a touch screen, and a regular infrared touch screen is sufficient. The paintbrush may not be a pressure sensitive pen, but may be the regular paintbrush or the finger of the user. This reduces a hardware cost of the user without worrying about damage to the paintbrush, thereby providing the user with good user experience.
In several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiments are merely examples. For example, division into the units is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electrical, mechanical, or other forms.
The units described as separate parts may be or may not be physically separate, and parts displayed as units may be or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The above integrated unit may be implemented either in a form of hardware or in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions in the present disclosure essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the operations of the methods described in the embodiments of the present disclosure. The foregoing storage medium includes a USB flash disk, a mobile hard disk, a ROM, a RAM, a magnetic disk, an optical disk, or the like, which can store program code.
Number | Date | Country | Kind |
---|---|---|---|
202111017255.5 | Sep 2021 | CN | national |
The present application is a Continuation-In-Part Application of PCT Application No. PCT/CN2022/101355 filed on Jun. 27, 2022, which claims the benefit of Chinese Patent Application No. 202111017255.5 filed on Sep. 1, 2021. All the above are hereby incorporated by reference in their entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/101355 | Jun 2022 | WO |
Child | 18592552 | US |