Electronic whiteboard marker pen nib implementation method and device
By responding to the user's input pen path and adjusting the path effect using parallelogram primitives, the problem of computational complexity and large error in existing technologies is solved, achieving simplified marker pen stroke simulation and improving realism and fluency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LANGYUAN TECH CO LTD
- Filing Date
- 2022-11-09
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies are complex, computationally intensive, and prone to errors when simulating marker pen strokes, resulting in slow execution speeds.
By responding to the user's input of the brush path, the first path effect is obtained, and the second path effect is adjusted according to the preset parallelogram primitive. The marker pen strokes are displayed using the built-in interface of the brush object, reducing the calculation process of the brush path.
It simplifies the process of creating marker pen strokes, reduces computational load and errors, and improves the realism and smoothness of the simulation effect.
Smart Images

Figure CN115826796B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic whiteboards, and more particularly to a method and apparatus for achieving marker strokes on an electronic whiteboard. Background Technology
[0002] Currently, in the field of electronic whiteboards, to meet diverse writing experiences, markers are needed for marking or writing in certain scenarios. Data models and practical experience have shown that piecing together multiple identical parallelogram units can simulate the effect of a marker pen with varying widths for horizontal, vertical, and diagonal strokes.
[0003] In existing technical solutions, the general approach is to first obtain the path of the touch movement, then divide this path into multiple graphic units of equal width, and finally draw multiple graphic units in sequence to display the effect of a marker pen stroke.
[0004] The drawbacks of existing technical solutions include the need to calculate the location information of the path to obtain the touch movement path, and the need to calculate the location information of the formed graphic elements when the path is broken down into graphic elements. This implementation method is relatively complex, has a large amount of calculation, has certain errors, and is theoretically slower. Summary of the Invention
[0005] This invention provides a method and apparatus for simulating marker strokes on an electronic whiteboard, in order to solve the technical problems of complex simulation methods, large computational load, and certain errors in marker stroke simulation.
[0006] To address the aforementioned technical problems, this invention provides a method for implementing marker strokes on an electronic whiteboard, comprising the following steps:
[0007] Responding to the brush path input by the user through the brush object, obtain the first path effect corresponding to the brush path;
[0008] Based on the preset parallelogram primitives, adjust the effect of the first path to obtain the effect of the second path;
[0009] The second path effect is retrieved through the built-in interface of the brush object, and then displayed on the brush path of the electronic whiteboard.
[0010] This invention provides a method for displaying marker pen strokes on an electronic whiteboard. Responding to a user's input of a pen path via a pen object, the method obtains a first path effect corresponding to the pen path, adjusts the first path effect according to preset parallelogram primitives, obtains a second path effect, and displays the second path effect on the pen path, thus achieving the display of marker pen strokes on the electronic whiteboard. Compared to existing methods that obtain a pen path and then break it down into several parallelogram primitives, this invention adjusts the first path effect based on preset parallelogram primitives. Therefore, this invention eliminates the need to obtain the pen movement path to achieve the marker pen stroke effect, reducing a significant amount of calculation related to the pen path, simplifying the implementation, and lowering the possibility of errors.
[0011] As a preferred example, adjusting the first path effect based on a preset parallelogram primitive to obtain the second path effect specifically involves:
[0012] The preset parallelogram primitive is retrieved, and the fill object and specific position of the first path effect are adjusted according to the parallelogram primitive to obtain the second path effect;
[0013] The preset parallelogram primitive is obtained from the attribute data of the pen object.
[0014] This invention provides specific operations for adjusting the path effect based on the parallelogram primitive. By setting the fill object and specific position of the path effect, a marker pen stroke effect is achieved. Compared with the prior art, which cuts the acquired pen path into parallelogram primitives, the amount of calculation is significantly reduced and the implementation method is more simplified.
[0015] This invention also provides the specific parameter source for the preset parallelogram primitive, which is provided by the attribute data of the brush object, thereby increasing the realism of the brush path displayed when the user draws the brush path using the brush object.
[0016] As a preferred example, the preset parallelogram primitive is obtained from the attribute data of the brush object, specifically:
[0017] The attribute data of the brush object includes: brush width;
[0018] Based on the brush width, a rectangular primitive is generated, and the inscribed parallelogram of the rectangular primitive is used as the preset parallelogram primitive.
[0019] In this embodiment of the invention, the attribute data of the pen object, namely the pen width, is combined with the rectangular primitive, and the inscribed parallelogram of the rectangular primitive is used as the parallelogram primitive, which improves the realism of the simulated marker pen handwriting.
[0020] As a preferred example, the step of using the inscribed parallelogram of the rectangular primitive as the preset parallelogram primitive specifically means:
[0021] Adjust the left vertex of the parallelogram to the left vertex of the rectangular primitive;
[0022] Adjust the right vertex of the parallelogram primitive to the midpoint of the top edge of the rectangle primitive;
[0023] Adjust the right bottom point of the parallelogram primitive to the right bottom point of the rectangle primitive;
[0024] Adjust the left bottom point of the parallelogram primitive to the midpoint of the bottom edge of the rectangle primitive.
[0025] This invention provides a method for setting parallelogram primitives. Based on the general writing habits of real users using markers, i.e., the pen stroke direction is downward to the right, the parallelogram is set to tilt downward to the right, which further improves the realism of simulating marker pen strokes. Users can also modify the relevant parameters as needed.
[0026] As a preferred example, adjusting the fill object and specific position of the first path effect based on the parallelogram primitive specifically involves:
[0027] The filling object includes: filling shape and connection method;
[0028] The parallelogram primitive is filled with the filled graphic, and the connection method is adjusted to translation connection; the center point of the filled object is adjusted to be centered relative to the corresponding point.
[0029] In this embodiment of the invention, the parallelogram primitive is set as the fill graphic of the path effect. Then, the parallelogram is displayed in response to the corresponding point formed by the user through the brush object. The connection method between the graphics is set to translation link, which makes the brush path display formed by touch response smoother. There is no gap between the previous parallelogram primitive and the next parallelogram primitive, reducing the possibility of discontinuity affecting the user experience.
[0030] As a preferred example, the center point of the filling object is adjusted to be displayed vertically centered relative to the corresponding point, and the left midpoint of the filling object is adjusted to coincide with the corresponding point.
[0031] In this embodiment of the invention, the graphic elements are centered relative to the corresponding points, which enhances the realism for users when using this technical solution to simulate marker pen strokes.
[0032] As a preferred example, the step of retrieving the second path effect through the built-in interface of the brush object specifically involves:
[0033] Based on the relevant information of the brush path input by the brush object, the second path effect is retrieved through the built-in interface of the brush object, and the second path effect is displayed on the brush path.
[0034] Accordingly, this invention also provides a display device for the pen strokes of an electronic whiteboard marker, comprising the following modules: a path effect acquisition module, a path effect adjustment module, and a pen stroke implementation module;
[0035] The path effect acquisition module is used to respond to the brush path input by the user through the brush object and acquire the first path effect corresponding to the brush path.
[0036] The path effect adjustment module is used to adjust the first path effect according to the preset parallelogram primitive to obtain the second path effect;
[0037] The brush stroke implementation module is used to retrieve the second path effect through the built-in interface of the brush object, so that the second path effect is displayed on the brush path of the electronic whiteboard.
[0038] This invention provides an apparatus that can implement the above methods. It can be set automatically without manual user setup, and users can also modify it themselves if needed later. Attached Figure Description
[0039] Figure 1 : A flowchart illustrating an embodiment of a method for displaying marker strokes on an electronic whiteboard provided by the present invention;
[0040] Figure 2 This is a flowchart illustrating an embodiment of a method for obtaining parallelogram primitives provided by the present invention.
[0041] Figure 3 : A flowchart illustrating an embodiment of a method for adjusting the effect of a first path provided by the present invention;
[0042] Figure 4 : A schematic diagram of an embodiment of an electronic whiteboard marker pen tip display device provided by the present invention;
[0043] Figure 5This is a schematic diagram illustrating the structure of an embodiment of a rectangular primitive and a parallelogram primitive provided by the present invention.
[0044] Figure 6 This is a schematic diagram of a structure in which graphic elements are connected by translation to form straight lines and curves, as provided by the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Example 1
[0047] Please refer to Figure 1 This is a flowchart illustrating an embodiment of a method for displaying marker strokes on an electronic whiteboard according to an embodiment of the present invention. The method includes steps 101 to 103, each step of which is as follows:
[0048] Step 101: Respond to the brush path input by the user through the brush object and obtain the first path effect corresponding to the brush path.
[0049] In this embodiment, compared with the existing technology that obtains the brush path, breaks it down into several parallelogram primitives, and then displays marker strokes on the electronic whiteboard, the technical solution provided in this embodiment does not require calculating the specific coordinates of the brush path. Instead, it obtains a first path effect by responding to the brush path input by the user, adjusts the first path effect according to preset parallelogram primitives to obtain a second path effect, and displays the second path effect using the brush path information of the brush object, thus displaying marker strokes on the electronic whiteboard. This process not only reduces the calculation of a large number of coordinates of the brush path, but also simplifies the display scheme and reduces the possibility of errors due to a large amount of calculation.
[0050] In this embodiment, the first path effect corresponding to the brush path input by the brush object is the original path effect, that is, the path effect that has not been adjusted, and the brush path is composed of several corresponding points, which are the position basis for the later retrieval operation of the second path effect.
[0051] Step 102: Adjust the first path effect according to the preset parallelogram primitive to obtain the second path effect.
[0052] In this embodiment, the preset parallelogram primitive can be created by the user or an existing parallelogram primitive can be directly called. The first path effect is adjusted according to the parallelogram primitive to obtain the second path effect. The adjustment process can be modified by the user as needed. The path effect includes, but is not limited to, the first path effect and the second path effect.
[0053] Step 103: Retrieve the second path effect through the built-in interface of the brush object, and display the second path effect on the brush path of the electronic whiteboard.
[0054] In this embodiment, the built-in interface of the paint object is the application programming interface (API) of the Paint pen. This embodiment uses parameter passing to display the second path effect on the paint path, achieving a marker pen stroke effect. The passed parameters are relevant data of the second path effect, and the passed tool is the built-in interface. The relevant data of the second path effect is combined with several corresponding points forming the paint path to create a marker pen stroke effect on the electronic whiteboard.
[0055] As another example in the embodiments of the present invention, see [link to relevant documentation]. Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of a method for obtaining parallelogram primitives provided by the present invention, including the following steps:
[0056] Step 201: The preset parallelogram primitive is obtained from the attribute data of the pen object, and the attribute data of the pen object includes: pen width.
[0057] In this example, the attribute data of the brush object includes, but is not limited to, the brush width. The brush width serves as the reference basis for various data of the later graphic elements. Since the horizontal stroke width of a real marker is the same as the width of the marker tip, the brush width needs to be used as a reference when setting graphic element data later.
[0058] Step 202: Generate a rectangular primitive based on the brush width, and use the inscribed parallelogram of the rectangular primitive as the preset parallelogram primitive.
[0059] In this example, the width and height of the generated rectangular primitive are both derived from the brush width as the basic data reference. The primitive height is the same as the brush width to ensure that the path width of the brush path formed by the second path effect is the same as the horizontal stroke width of a real marker pen, both derived from the pen tip width, i.e., the brush width. The primitive width is half of the brush width, i.e., the primitive height. Since the vertical strokes of a real marker pen are thinner and longer than the horizontal strokes, the specific value of the primitive width must be smaller than the specific value of the primitive height.
[0060] Similarly, in this example, the method for obtaining the inscribed parallelogram of the rectangular primitive can be set by the user as needed. In this example, in order to simulate general writing habits, that is, the pen stroke direction is lower right, this rule is set as a reference point when adjusting the position of the four vertices of the inscribed parallelogram.
[0061] Step 203: Adjust the left vertex of the parallelogram to the left vertex of the rectangle; adjust the right vertex of the parallelogram to the midpoint of the top edge of the rectangle; adjust the right bottom point of the parallelogram to the right bottom point of the rectangle; adjust the left bottom point of the parallelogram to the midpoint of the bottom edge of the rectangle.
[0062] In this example, in order to simulate the writing habit of the general pen stroke direction being to the lower right and the width of the vertical stroke being less than the width of the horizontal stroke, the inscribed parallelogram of the rectangular primitive is adjusted as described above to achieve a more realistic simulation of the marker pen stroke.
[0063] To better illustrate the method of obtaining the parallelogram primitive from the rectangular primitive, see [link to documentation]. Figure 5 , Figure 5 This is a schematic diagram of a structural embodiment of a rectangular primitive and a parallelogram primitive provided by the present invention.
[0064] In this example, the four vertices of the rectangular primitive ABCD are: left vertex A, right vertex B, right base point C, and left base point D. The four vertices of the parallelogram primitive AECF are: the left vertex A of the parallelogram primitive coincides with the left vertex A of the rectangular primitive, i.e., the left vertex A; the right vertex E of the parallelogram primitive is located at the midpoint of the upper base AB of the rectangular primitive, i.e., the right midpoint E; the right base point C of the parallelogram primitive coincides with the right base point C of the rectangular primitive, i.e., the right base point C; and the left base point F of the parallelogram primitive is located at the midpoint of the lower base CD of the rectangular primitive, i.e., the left midpoint F.
[0065] As another example in the embodiments of the present invention, see [link to relevant documentation]. Figure 3 , Figure 3 This is a flowchart illustrating an embodiment of a method for adjusting the effect of a first path provided by the present invention. It includes the following steps:
[0066] Step 301: Retrieve the preset parallelogram primitive, and adjust the fill object and specific position of the first path effect according to the parallelogram primitive.
[0067] In this example, the tool used to retrieve the parallelogram primitive and adjust the effect of the first path based on the parallelogram primitive is PathDashPathEffect. This tool is specifically used to fill the current path, i.e., the brush path, using the Path graphic, i.e., the parallelogram primitive.
[0068] Step 302: The filling object includes: filling shape and connection method. The parallelogram primitive is filled with the filling shape, and the connection method is adjusted to translation connection.
[0069] In this example, to fill the current path using the parallelogram primitive, the specific operation is to use the parallelogram primitive as the fill shape, i.e., the path shape, for the fill object of the first path effect. Passing the parallelogram primitive into the Path allows for automatic filling. When the Path automatically fills the parallelogram primitive, the connection between the previous and next parallelogram primitives is set to a translation connection to ensure a smooth and fluid brush path.
[0070] The connection method, or Style, includes the following three types: ROTATE, MORPH, and TRANSLATE. ROTATE means that the graphic at the connection point of the line segment is rotated to an angle consistent with the direction of movement of the next segment. MORPH means that the graphic is connected to the next segment by means of stretching or compression. TRANSLATE is the translational connection, that is, the graphic is connected to the next segment by means of positional translation.
[0071] In this example, in addition to the aforementioned fill shape and connection style, the fill object also includes: shape interval Advance and offset distance Phase; wherein, the shape interval Advance is the interval between each shape; and the offset distance Phase is the distance the shape is offset to the left when the first shape is drawn. In this example, both of these values are set to 0 to ensure the continuity and smoothness of the brush path.
[0072] Accordingly, for a better illustration of the connections between the graphics, see [link to relevant documentation]. Figure 6 , Figure 6 This invention provides a schematic diagram of a structure in which graphic elements are connected by translation to form straight lines and curves.
[0073] In this example, the straight line formed by the translation connection is as follows: Figure 6 As shown, there is no gap between the two primitives, and the first primitive does not shift to the left. Several primitives are arranged as follows: Figure 6The connections are made in the manner shown to simulate the straight lines formed by marker pen strokes. If it is a curve, there is a slight misalignment between the connections between the preceding and following primitives, and several primitives are combined to form a curved stroke, thus simulating the curves formed by marker pen strokes.
[0074] Step 303: Adjust the center point of the filling object to be displayed vertically centered relative to the corresponding point, and adjust the left midpoint of the filling object to coincide with the corresponding point.
[0075] In this example, the specific position of the filling object and the corresponding point are adjusted accordingly, so that when the user inputs the brush path using the brush object, the marker stroke effect simulated by the second path effect is more realistic and closer to real marker handwriting.
[0076] Accordingly, see Figure 4 , Figure 4 This is a schematic diagram of an embodiment of an electronic whiteboard marker pen stroke display device provided by the present invention. The device includes the following modules: a path effect acquisition module 401, a path effect adjustment module 402, and a pen stroke implementation module 403;
[0077] The path effect acquisition module 401 is used to respond to the brush path input by the user through the brush object and acquire the first path effect corresponding to the brush path.
[0078] The path effect adjustment module 402 is used to adjust the first path effect according to the preset parallelogram primitive to obtain the second path effect;
[0079] The brush stroke implementation module 403 is used to retrieve the second path effect through the built-in interface of the brush object, so that the second path effect is displayed on the brush path of the electronic whiteboard.
[0080] In summary, the present invention provides a method and apparatus for displaying marker strokes on an electronic whiteboard. The method adjusts the effect of the first path based on preset parallelogram primitives, reducing a large amount of calculation process related to the pen path, simplifying the implementation scheme and reducing the possibility of errors.
[0081] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for displaying marker strokes on an electronic whiteboard, characterized in that, Includes the following steps: Responding to the brush path input by the user through the brush object, obtain the first path effect corresponding to the brush path; Based on the preset parallelogram primitives, adjust the effect of the first path to obtain the effect of the second path; The second path effect is retrieved through the built-in interface of the brush object, and the second path effect is displayed on the brush path of the electronic whiteboard. Specifically, adjusting the first path effect based on a preset parallelogram primitive to obtain a second path effect involves: retrieving the preset parallelogram primitive and adjusting the fill object and specific position of the first path effect based on the parallelogram primitive to obtain the second path effect; wherein the preset parallelogram primitive is obtained from the attribute data of the brush object. Specifically, adjusting the fill object and specific position of the first path effect based on the parallelogram primitive includes: the fill object includes: a fill graphic and a connection method; filling the parallelogram primitive with the fill graphic, adjusting the connection method to a translation connection; and adjusting the center point of the fill object to be centered relative to the corresponding point.
2. The method for displaying marker strokes on an electronic whiteboard as described in claim 1, characterized in that, The preset parallelogram primitive is obtained from the attribute data of the brush object, specifically: The attribute data of the brush object includes: brush width; Based on the brush width, a rectangular primitive is generated, and the inscribed parallelogram of the rectangular primitive is used as the preset parallelogram primitive.
3. The method for displaying marker strokes on an electronic whiteboard as described in claim 2, characterized in that, The step of using the inscribed parallelogram of the rectangular primitive as the preset parallelogram primitive specifically means: Adjust the left vertex of the parallelogram primitive to the left vertex of the rectangle primitive; Adjust the right vertex of the parallelogram primitive to the midpoint of the top edge of the rectangle primitive; Adjust the right bottom point of the parallelogram primitive to the right bottom point of the rectangle primitive; Adjust the left bottom point of the parallelogram primitive to the midpoint of the bottom edge of the rectangle primitive.
4. The method for displaying marker strokes on an electronic whiteboard as described in claim 1, characterized in that, The step of adjusting the center point of the filled object to be centered relative to the corresponding point specifically includes: Adjust the center point of the filled object to be displayed vertically centered relative to the corresponding point, and adjust the left midpoint of the filled object to coincide with the corresponding point.
5. The method for displaying marker strokes on an electronic whiteboard as described in claim 1, characterized in that, The step of retrieving the second path effect through the built-in interface of the brush object is as follows: Based on the relevant information of the brush path input by the brush object, the second path effect is retrieved through the built-in interface of the brush object, and the second path effect is displayed on the brush path.
6. A display device for the pen tip of an electronic whiteboard marker, characterized in that, It includes the following modules: path effect acquisition module, path effect adjustment module, and stroke implementation module; The path effect acquisition is used to respond to the brush path input by the user through the brush object and acquire the first path effect corresponding to the brush path. The path effect adjustment module is used to adjust the first path effect according to the preset parallelogram primitive to obtain the second path effect; The brush stroke implementation module is used to retrieve the second path effect through the built-in interface of the brush object, so that the second path effect is displayed on the brush path of the electronic whiteboard; Specifically, adjusting the first path effect based on a preset parallelogram primitive to obtain a second path effect involves: retrieving the preset parallelogram primitive and adjusting the fill object and specific position of the first path effect based on the parallelogram primitive to obtain the second path effect; wherein the preset parallelogram primitive is obtained from the attribute data of the brush object. Specifically, adjusting the fill object and specific position of the first path effect based on the parallelogram primitive includes: the fill object includes: a fill graphic and a connection method; filling the parallelogram primitive with the fill graphic, adjusting the connection method to a translation connection; and adjusting the center point of the fill object to be centered relative to the corresponding point.