A multi-object pen writing and multi-stroke writing method and system
By rewriting the stylus and static plugins of the electronic whiteboard, pen events are recognized and strokes are constructed, solving the problem that traditional electronic whiteboards cannot write on multiple objects, realizing multi-object pen writing, and improving the user experience.
Patent Information
- Application Number
- CN202211038851.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Traditional electronic whiteboards cannot allow simultaneous drawing on multiple objects, limiting their use cases and impacting user experience.
By overriding the OnStylusDown, OnStylusMove, and OnStylusUp methods, stylus and static plugins for InkCanvas are created. Pen events are recognized, and strokes are constructed based on the four vertices of the object. It is then used to determine whether a finger or pen is on the object and to perform multi-stroke writing or pen writing.
It enables users to freely draw or write on multiple objects on the electronic whiteboard, thus improving the user experience.
Smart Images

Figure CN115617246B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic whiteboard technology, and in particular to a multi-object pen writing and multi-stroke writing method and system. Background Technology
[0002] With the rapid development of computer technology, various multimedia courseware integrating sound, images, text, and video have entered the classroom. Electronic whiteboards, which combine computer technology, display technology, network technology, and photography / videography technology, have emerged in this digital age. However, traditional electronic whiteboards cannot simultaneously write on (annotate) objects (images, videos, tables, etc.) on the whiteboard, or can only write on one object at a time. This greatly limits the usage scenarios of electronic whiteboards and consequently significantly impacts the user experience.
[0003] Therefore, how to provide a method and system for multi-object pen writing and multi-stroke writing, so as to enable free pen writing or multi-stroke writing on multiple objects while writing on an electronic whiteboard, has become a technical problem that urgently needs to be solved. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method and system for multi-object pen writing and multi-stroke writing, so as to enable free pen writing or multi-stroke writing on multiple objects while writing on an electronic whiteboard.
[0005] In a first aspect, the present invention provides a multi-object pen writing and multi-stroke writing method, comprising the following steps:
[0006] Step S10: Pre-store the device IDs of various types of pens, and create the InkCanvas stylus plugin and static plugin based on the overridden OnStylusDown, OnStylusMove and OnStylusUp methods;
[0007] Step S20: Construct strokes based on the four vertices of each object on the electronic whiteboard, and perform matrix transformations on the strokes and objects based on the object's operation instructions;
[0008] Step S30: Determine whether the current user chooses multi-stroke writing or pen writing. If it is multi-stroke writing, proceed to step S40; if it is pen writing, proceed to step S50.
[0009] Step S40: Perform multi-stroke writing operations based on the stylus plugin, static plugin, and stroke.
[0010] Step S50: Perform a pen writing operation based on the static plugin, stroke, and device ID.
[0011] Further, step S10 specifically includes:
[0012] The device IDs of each type of pen are pre-stored, the number of multi-touch points supported by each type of pen is obtained, an initial pen plugin is added to each touch point in the InkCanvas ink display, and the OnStylusDown, OnStylusMove and OnStylusUp methods of each initial pen plugin are overridden to obtain the corresponding pen plugin.
[0013] The OnStylusDown, OnStylusMove, and OnStylusUp methods of the initial static plugin of InkCanvas are overridden to obtain the corresponding static plugin.
[0014] Furthermore, in step S20, the operation command is to move, rotate, or scale.
[0015] Further, step S40 specifically includes:
[0016] The first entry is located within the object:
[0017] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0018] The object corresponding to stroke generates a TouchDown event, which is processed by the object's InkCanvas to write on the object; the electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the first stroke that is inside the object.
[0019] The second stroke is not located within the object:
[0020] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is not within the rectangle formed by the stroke, the first press event is called, and the second press event generated by the stylus plugin is called.
[0021] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0022] The first entry is not located within the object:
[0023] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the stroke, the first press event is called, but the second press event generated by the stylus plugin is not called.
[0024] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0025] The second stroke is located within the object:
[0026] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0027] The entire whiteboard generates a TouchDown event. When the first touch point is not on the object, a stroke is generated according to the TouchDown event and saved to the stroke set. The entire whiteboard first generates a TouchMove event and collects the strokes generated by the TouchMove event into the stroke set. The entire whiteboard then generates a TouchUp event and displays each stroke in the stroke set on the entire whiteboard through the TouchUp event.
[0028] Further, step S50 specifically includes:
[0029] The first entry is located within the object:
[0030] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0031] Determine if the first stroke is within the rectangle formed by the strokes. If it is, do not call the first press event; otherwise, generate the StylusDown event.
[0032] Based on whether the strokes generated by the StylusDown event are within the rectangle formed by the strokes, the object's canvas or the entire canvas is invoked to perform the pen writing operation.
[0033] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0034] The first entry is not located within the object:
[0035] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0036] When the first stroke is not within the rectangle formed by the strokes, the first press event is invoked, the entire canvas performs the pen writing operation, and a StylusDown event is generated;
[0037] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0038] Secondly, the present invention provides a multi-object pen writing and multi-stroke writing system, comprising the following modules:
[0039] The plugin creation module is used to pre-store the device IDs of various types of pens and create InkCanvas stylus plugins and static plugins based on the overridden OnStylusDown, OnStylusMove, and OnStylusUp methods.
[0040] The stroke construction module is used to construct strokes based on the four vertices of each object on the electronic whiteboard, and to perform matrix transformations on the strokes and objects based on the object's operation instructions.
[0041] The input selection module is used to determine whether the current user chooses multi-stroke writing or pen writing. If it is multi-stroke writing, the user will enter the multi-stroke writing operation module; if it is pen writing, the user will enter the pen writing operation module.
[0042] A multi-stroke writing operation module is used to perform multi-stroke writing operations based on the stylus plugin, static plugin, and stroke.
[0043] The pen writing operation module is used to perform pen writing operations based on the static plugin, stroke, and device ID.
[0044] Furthermore, the plugin creation module is specifically used for:
[0045] The device IDs of each type of pen are pre-stored, the number of multi-touch points supported by each type of pen is obtained, an initial pen plugin is added to each touch point in the InkCanvas ink display, and the OnStylusDown, OnStylusMove and OnStylusUp methods of each initial pen plugin are overridden to obtain the corresponding pen plugin.
[0046] The OnStylusDown, OnStylusMove, and OnStylusUp methods of the initial static plugin of InkCanvas are overridden to obtain the corresponding static plugin.
[0047] Furthermore, in the stroke construction module, the operation command is to move, rotate, or scale.
[0048] Furthermore, the multi-stroke writing operation module is specifically used for:
[0049] The first entry is located within the object:
[0050] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0051] The object corresponding to stroke generates a TouchDown event, which is processed by the object's InkCanvas to write on the object; the electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the first stroke that is inside the object.
[0052] The second stroke is not located within the object:
[0053] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is not within the rectangle formed by the stroke, the first press event is called, and the second press event generated by the stylus plugin is called.
[0054] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0055] The first entry is not located within the object:
[0056] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the stroke, the first press event is called, but the second press event generated by the stylus plugin is not called.
[0057] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0058] The second stroke is located within the object:
[0059] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0060] The entire whiteboard generates a TouchDown event. When the first touch point is not on the object, a stroke is generated according to the TouchDown event and saved to the stroke set. The entire whiteboard first generates a TouchMove event and collects the strokes generated by the TouchMove event into the stroke set. The entire whiteboard then generates a TouchUp event and displays each stroke in the stroke set on the entire whiteboard through the TouchUp event.
[0061] Furthermore, the pen writing operation module is specifically used for:
[0062] The first entry is located within the object:
[0063] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0064] Determine if the first stroke is within the rectangle formed by the strokes. If it is, do not call the first press event; otherwise, generate the StylusDown event.
[0065] Based on whether the strokes generated by the StylusDown event are within the rectangle formed by the strokes, the object's canvas or the entire canvas is invoked to perform the pen writing operation.
[0066] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0067] The first entry is not located within the object:
[0068] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0069] When the first stroke is not within the rectangle formed by the strokes, the first press event is invoked, the entire canvas performs the pen writing operation, and a StylusDown event is generated;
[0070] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0071] The advantages of this invention are:
[0072] By overriding the OnStylusDown, OnStylusMove, and OnStylusUp methods, stylus and static plugins for InkCanvas are created. These plugins can recognize the StylusDown, StylusMove, and StylusUp events triggered by the pen. A stroke is constructed based on the four vertices of the object. Whether the finger or pen is writing within the rectangle formed by the strokes is checked to determine if the finger or pen is currently on the object. Based on this, the corresponding stylus or static plugin is called to perform multi-stroke or pen writing. Ultimately, this allows for free pen or pen writing on multiple objects while writing on the electronic whiteboard, greatly improving the user experience. Attached Figure Description
[0073] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0074] Figure 1 This is a flowchart of a multi-object pen writing and multi-stroke writing method according to the present invention.
[0075] Figure 2 This is a schematic diagram of the structure of a multi-object pen writing and multi-stroke writing system according to the present invention. Detailed Implementation
[0076] Please refer to Figures 1 to 2 As shown, a preferred embodiment of the multi-object pen writing and multi-stroke writing method of the present invention includes the following steps:
[0077] Step S10: Pre-store the device IDs of various types of pens, and create the InkCanvas stylus plugin and static plugin based on the overridden OnStylusDown, OnStylusMove and OnStylusUp methods;
[0078] Step S20: Construct strokes based on the four vertices of each object on the electronic whiteboard, and perform matrix transformations on the strokes and objects based on the operation instructions of the objects; a stroke is a trajectory composed of a set of planar coordinate points, from the beginning of a stroke to the end of a stroke; each object corresponds to an InkCanvas (a control used to collect and display ink marks, that is, to collect the coordinate sequence of the pen during the sliding process on the electronic whiteboard and display it according to the set style);
[0079] Step S30: Determine whether the current user chooses multi-stroke writing or pen writing. If it is multi-stroke writing, proceed to step S40; if it is pen writing, proceed to step S50. Multi-stroke writing is for finger input, while pen writing is for pen input.
[0080] Step S40: Perform multi-stroke writing operations based on the stylus plugin, static plugin, and stroke.
[0081] Step S50: Perform a pen writing operation based on the static plugin, stroke, and device ID.
[0082] Step S10 specifically involves:
[0083] The device IDs of various pen types are pre-stored, and the number of multi-touch points supported by each pen type is obtained. In the InkCanvas ink display, an initial pen plugin is added for each touch point. The OnStylusDown, OnStylusMove, and OnStylusUp methods of each initial pen plugin are overridden to obtain the corresponding pen plugin. For example, if the current pen supports 10-point touch, 10 initial pen plugins are added. If the device IDs do not match, the OnStylusDown, OnStylusMove, and OnStylusUp methods do not perform any processing. If they match, the base class operation is called directly.
[0084] The OnStylusDown, OnStylusMove, and OnStylusUp methods of the initial static plugin of InkCanvas are overridden to obtain the corresponding static plugin.
[0085] In step S20, the operation command is to move, rotate, or scale.
[0086] Step S40 mainly enables simultaneous writing on the overall canvas and objects when writing multiple strokes at the same time. The following explanation is based on two cases of writing two strokes at a time: Case 1: The first point of the first stroke is located in the object, and the first point of the second stroke is located on the overall canvas; Case 2: The first point of the first stroke is located in the overall canvas, and the first point of the second stroke is located in the object.
[0087] Step S40 specifically involves:
[0088] The first entry is located within the object:
[0089] When the finger presses down on the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called because it is the first stroke. To avoid redrawing, the second press event generated by the stylus plugin is not called.
[0090] The object corresponding to stroke generates a TouchDown event, which is then processed by the object's InkCanvas to write on the object; the electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the first stroke within the object; StrokeCollected is the pen collection.
[0091] The second stroke is not located within the object:
[0092] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the strokes, the first press event is called, and the second press event generated by the stylus plugin is called. That is, by determining whether the current touch point is within the rectangle formed by the strokes, it is determined whether the current touch point is on the object.
[0093] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0094] The first entry is not located within the object:
[0095] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the stroke, the first press event is called, but the second press event generated by the stylus plugin is not called.
[0096] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0097] The second stroke is located within the object:
[0098] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0099] The entire whiteboard generates a TouchDown event. When the first touch point is not on the object, a stroke is generated according to the TouchDown event and saved to the stroke set (this stroke is not displayed at this time; the display is handled by the stylus plugin). The entire whiteboard first generates a TouchMove event, collecting the strokes generated by the TouchMove event into the stroke set. The entire whiteboard then generates a TouchUp event, displaying each stroke in the stroke set onto the entire whiteboard through the TouchUp event.
[0100] Step S50 mainly implements the writing of objects on the overall canvas, and handles two cases: the first case: the first point of the first stroke is located in the object; the second case: the first point of the first stroke is located in the overall canvas.
[0101] Step S50 specifically involves:
[0102] The first entry is located within the object:
[0103] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0104] Determine if the first stroke is within the rectangle formed by the strokes. If it is, do not call the first press event; otherwise, generate the StylusDown event.
[0105] Based on whether the strokes generated by the StylusDown event are within the rectangle formed by the strokes, the object's canvas or the entire canvas is invoked to perform the pen writing operation.
[0106] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0107] The first entry is not located within the object:
[0108] When the pen is pressed for the first stroke, the static plugin generates a first press event. It checks whether the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the input first point to a preset second coordinate value, for example, adjusting the first coordinate value to (-9999, -9999), and thus does not call the first press event; if yes, then:
[0109] When the first stroke is not within the rectangle formed by the strokes, the first press event is invoked, the entire canvas performs the pen writing operation, and a StylusDown event is generated;
[0110] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0111] A preferred embodiment of the multi-object pen writing and multi-stroke writing system of the present invention includes the following modules:
[0112] The plugin creation module is used to pre-store the device IDs of various types of pens and create InkCanvas stylus plugins and static plugins based on the overridden OnStylusDown, OnStylusMove, and OnStylusUp methods.
[0113] The stroke construction module is used to construct strokes based on the four vertices of each object on the electronic whiteboard, and to perform matrix transformations on the strokes and objects based on the operation instructions of the objects. A stroke is a trajectory composed of a set of planar coordinate points, from the beginning of a stroke to the end of a stroke. Each object corresponds to an InkCanvas (a control used to collect and display ink marks, that is, to collect the coordinate sequence of the pen during the sliding process on the electronic whiteboard and display it according to the set style).
[0114] The input selection module is used to determine whether the current user chooses multi-stroke writing or pen writing. If it is multi-stroke writing, the multi-stroke writing operation module is entered; if it is pen writing, the pen writing operation module is entered. Multi-stroke writing is for finger input, and pen writing is for pen input.
[0115] A multi-stroke writing operation module is used to perform multi-stroke writing operations based on the stylus plugin, static plugin, and stroke.
[0116] The pen writing operation module is used to perform pen writing operations based on the static plugin, stroke, and device ID.
[0117] The plugin creation module is specifically used for:
[0118] The device IDs of various pen types are pre-stored, and the number of multi-touch points supported by each pen type is obtained. In the InkCanvas ink display, an initial pen plugin is added for each touch point. The OnStylusDown, OnStylusMove, and OnStylusUp methods of each initial pen plugin are overridden to obtain the corresponding pen plugin. For example, if the current pen supports 10-point touch, 10 initial pen plugins are added. If the device IDs do not match, the OnStylusDown, OnStylusMove, and OnStylusUp methods do not perform any processing. If they match, the base class operation is called directly.
[0119] The OnStylusDown, OnStylusMove, and OnStylusUp methods of the initial static plugin of InkCanvas are overridden to obtain the corresponding static plugin.
[0120] In the stroke construction module, the operation command is to move, rotate, or scale.
[0121] The multi-stroke writing module mainly enables simultaneous writing on the overall canvas and objects when writing multiple strokes at the same time. The following describes two cases of writing two strokes at a time: Case 1: The first point of the first stroke is located in the object, and the first point of the second stroke is located on the overall canvas; Case 2: The first point of the first stroke is located in the overall canvas, and the first point of the second stroke is located in the object.
[0122] The multi-stroke writing operation module is specifically used for:
[0123] The first entry is located within the object:
[0124] When the finger presses down on the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called because it is the first stroke. To avoid redrawing, the second press event generated by the stylus plugin is not called.
[0125] The object corresponding to stroke generates a TouchDown event, which is then processed by the object's InkCanvas to write on the object; the electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the first stroke within the object; StrokeCollected is the pen collection.
[0126] The second stroke is not located within the object:
[0127] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the strokes, the first press event is called, and the second press event generated by the stylus plugin is called. That is, by determining whether the current touch point is within the rectangle formed by the strokes, it is determined whether the current touch point is on the object.
[0128] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0129] The first entry is not located within the object:
[0130] When the finger presses the first stroke, the static plugin generates the first press event. If the first stroke is not within the rectangle formed by the stroke, the first press event is called, but the second press event generated by the stylus plugin is not called.
[0131] The electronic whiteboard generates a TouchDown event, and a stroke is generated and saved based on the TouchDown event; the electronic whiteboard generates a TouchMove event, and the stroke generated by the pen is collected into the stroke generated by the TouchDown event through the TouchMove event; the electronic whiteboard generates a TouchUp event, and the pen generated by the TouchDown and TouchMove events is displayed based on the TouchUp event.
[0132] The second stroke is located within the object:
[0133] When the finger presses the first stroke, the static plugin generates the first press event. When the first stroke is within a rectangle composed of strokes, the first press event is not called, and the second press event generated by the stylus plugin is not called.
[0134] The entire whiteboard generates a TouchDown event. When the first touch point is not on the object, a stroke is generated according to the TouchDown event and saved to the stroke set (this stroke is not displayed at this time; the display is handled by the stylus plugin). The entire whiteboard first generates a TouchMove event, collecting the strokes generated by the TouchMove event into the stroke set. The entire whiteboard then generates a TouchUp event, displaying each stroke in the stroke set onto the entire whiteboard through the TouchUp event.
[0135] The brush writing operation module mainly implements writing on the entire canvas and objects, and handles two cases: the first case is when the first point of the first stroke is located in the object; the second case is when the first point of the first stroke is located in the entire canvas.
[0136] The pen writing operation module is specifically used for:
[0137] The first entry is located within the object:
[0138] When the pen is pressed for the first stroke, the static plugin generates a first press event. It then checks if the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the first input point to a preset second coordinate value, and thus does not invoke the first press event; if yes, then:
[0139] Determine if the first stroke is within the rectangle formed by the strokes. If it is, do not call the first press event; otherwise, generate the StylusDown event.
[0140] Based on whether the strokes generated by the StylusDown event are within the rectangle formed by the strokes, the object's canvas or the entire canvas is invoked to perform the pen writing operation.
[0141] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0142] The first entry is not located within the object:
[0143] When the pen is pressed for the first stroke, the static plugin generates a first press event. It checks whether the device ID of the pen that generated the first press event matches a pre-stored device ID. If not, it adjusts the first coordinate value of the input first point to a preset second coordinate value, for example, adjusting the first coordinate value to (-9999, -9999), and thus does not call the first press event; if yes, then:
[0144] When the first stroke is not within the rectangle formed by the strokes, the first press event is invoked, the entire canvas performs the pen writing operation, and a StylusDown event is generated;
[0145] The electronic whiteboard generates a StrokeCollected event, which collects the strokes written by the pen and deletes the strokes whose first point is within the rectangle formed by the stroke.
[0146] In summary, the advantages of this invention are as follows:
[0147] By overriding the OnStylusDown, OnStylusMove, and OnStylusUp methods, stylus and static plugins for InkCanvas are created. These plugins can recognize the StylusDown, StylusMove, and StylusUp events triggered by the pen. A stroke is constructed based on the four vertices of the object. Whether the finger or pen is writing within the rectangle formed by the strokes is checked to determine if the finger or pen is currently on the object. Based on this, the corresponding stylus or static plugin is called to perform multi-stroke or pen writing. Ultimately, this allows for free pen or pen writing on multiple objects while writing on the electronic whiteboard, greatly improving the user experience.
[0148] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A multi-object brush writing and multi-pen writing method, characterized by: The method comprises the following steps: Step S10, storing the device ID of each type of brush in advance, and creating the stylus plug-in and the static plug-in of the InkCanvas based on the rewritten OnStylusDown method, OnStylusMove method and OnStylusUp method; Step S20, constructing a stroke based on the four vertices of each object on the electronic whiteboard, and performing matrix transformation on the stroke and the object based on the operation instruction of the object; Step S30, judging whether the current user selects multi-pen writing or brush writing, if multi-pen writing, entering step S40; If brush writing, entering step S50; Step S40, performing multi-pen writing operation based on the stylus plug-in, the static plug-in and the stroke; The step S40 is specifically: The first pen is in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, when the first pen is in a certain rectangle composed of strokes, the first press-down event is not called, and the second press-down event generated by the stylus plug-in is not called; The object corresponding to the stroke generates a TouchDown event, the TouchDown event is processed by the InkCanvas of the object, and writing is performed on the object; the electronic whiteboard generates a StrokeCollected event, the stroke is collected through the StrokeCollected event when the brush writes, and the stroke in which the first point is in the object is deleted; The second pen is not in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, when the first pen is not in the rectangle composed of strokes, the first press-down event is called, and the second press-down event generated by the stylus plug-in is called; The electronic whiteboard generates a TouchDown event, and generates a stroke based on the TouchDown event and saves it; The electronic whiteboard generates a TouchMove event, and collects the stroke generated by the brush through the TouchMove event into the stroke generated by the TouchDown event; The electronic whiteboard generates a TouchUp event, and displays the brush generated by the TouchDown event and the TouchMove event based on the TouchUp event; The first pen is not in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, when the first pen is not in the rectangle composed of strokes, the first press-down event is called, and the second press-down event generated by the stylus plug-in is not called; The second pen is in the object: The whole drawing board of the electronic whiteboard generates a TouchDown event, when the first touch point is not on the object, generates a stroke based on the TouchDown event and saves it to the stroke set; the whole drawing board generates a TouchMove event first, and collects the stroke generated by the TouchMove event into the stroke set; The whole drawing board generates a TouchUp event again, and displays each stroke in the stroke set on the whole drawing board through the TouchUp event; Step S50, performing a pen writing operation based on the static plug-in, stroke and device ID.
2. The multi-object pen writing and multi-pen writing method according to claim 1, characterized by: The step S10 is specifically: Storing the device ID of each type of pen in advance, obtaining the number of points supported by each type of pen for multi-touch, adding an initial stylus plug-in to each touch point in the InkCanvas ink display, and rewriting the OnStylusDown method, OnStylusMove method and OnStylusUp method of each initial stylus plug-in to obtain the corresponding stylus plug-in. Rewriting the OnStylusDown method, OnStylusMove method and OnStylusUp method of the initial static plug-in of InkCanvas to obtain the corresponding static plug-in.
3. The multi-object pen writing and multi-pen writing method according to claim 1, characterized by: In the step S20, the operation instruction is moving, rotating or zooming.
4. The multi-object pen writing and multi-pen writing method of claim 1, wherein: The step S50 is specifically: When the pen is pressed for the first time, the static plug-in generates a first press event, and determines whether the device ID of the pen generating the first press event matches the pre-stored device ID. If not, the first coordinate value of the input first point is adjusted to a preset second coordinate value, and the first press event is not called. If yes, then: Determine whether the first pen is located within the rectangle composed of stroke. If yes, the first press event is not called. If not, a StylusDown event is generated. Based on whether the stroke generated by the StylusDown event is within the rectangle composed of stroke, the drawing board of the object or the overall drawing board is called to perform a pen writing operation. The electronic whiteboard generates a StrokeCollected event to collect the strokes during pen writing through the StrokeCollected event, and deletes the strokes with the first point within the rectangle composed of stroke. When the first pen is not located within the rectangle composed of stroke, the first press event is called, the overall drawing board performs a pen writing operation, and a StylusDown event is generated. The electronic whiteboard generates a StrokeCollected event to collect the strokes during pen writing through the StrokeCollected event, and deletes the strokes with the first point within the rectangle composed of stroke.
5. A multi-object-pen writing and multi-pen writing system, characterized by: Comprise the following modules: The plug-in creation module is used to pre-store the device ID of each type of pen, and create the stylus plug-in and static plug-in of InkCanvas based on the rewritten OnStylusDown method, OnStylusMove method and OnStylusUp method; The stroke construction module is used to construct stroke based on the four vertices of each object on the electronic whiteboard, and perform matrix transformation on the stroke and the object based on the operation instruction of the object; The input selection module is used to determine whether the current user selects multi-pen writing or pen writing. If it is multi-pen writing, enter the multi-pen writing operation module. If it is pen writing, enter the pen writing operation module. The multi-pen writing operation module is configured to perform a multi-pen writing operation based on the stylus plug-in, the static plug-in and the stroke. The multi-pen writing operation module is specifically configured to: The first pen is located in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, and when the first pen is located in a certain rectangle composed of strokes, the first press-down event is not called, and a second press-down event generated by the stylus plug-in is not called; The object corresponding to the stroke generates a TouchDown event, and the TouchDown event is processed through the InkCanvas of the object to write on the object; the electronic whiteboard generates a StrokeCollected event, and the stroke is collected through the StrokeCollected event when the pen writes, and the stroke in which the first point is located in the object is deleted; The second pen is not located in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, and when the first pen is not located in a rectangle composed of strokes, the first press-down event is called, and a second press-down event generated by the stylus plug-in is called; The electronic whiteboard generates a TouchDown event, and generates a stroke based on the TouchDown event and saves it; The electronic whiteboard generates a TouchMove event, and collects the stroke generated by the pen through the TouchMove event into the stroke generated by the TouchDown event; The electronic whiteboard generates a TouchUp event, and displays the pen generated by the TouchDown event and the TouchMove event based on the TouchUp event; The first pen is not located in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, and when the first pen is not located in a rectangle composed of strokes, the first press-down event is called, and a second press-down event generated by the stylus plug-in is not called; The electronic whiteboard generates a TouchDown event, and generates a stroke based on the TouchDown event and saves it; The electronic whiteboard generates a TouchMove event, and collects the stroke generated by the pen through the TouchMove event into the stroke generated by the TouchDown event; The electronic whiteboard generates a TouchUp event, and displays the pen generated by the TouchDown event and the TouchMove event based on the TouchUp event; The second pen is located in the object: When the finger presses the first pen, the static plug-in generates a first press-down event, and when the first pen is located in a certain rectangle composed of strokes, the first press-down event is not called, and a second press-down event generated by the stylus plug-in is not called; The whole drawing board of the electronic whiteboard generates a TouchDown event, and when the first touch point is not on the object, generates a stroke based on the TouchDown event and saves it to the stroke set; the whole drawing board generates a TouchMove event first, and collects the stroke generated by the TouchMove event into the stroke set; The whole drawing board generates a TouchUp event, through which each stroke in the stroke set is displayed on the whole drawing board; The brush writing operation module is configured to perform a brush writing operation based on the static plug-in, the stroke, and the device ID.
6. A multi-object pen writing and multi-pen writing system as claimed in claim 5, characterized in that: The plug-in creation module is specifically configured to: Pre-store device IDs of various types of brushes, obtain the number of points supported by each type of brush for multi-point touch control, add an initial stylus plug-in to each touch point in the InkCanvas ink display, and rewrite the OnStylusDown method, the OnStylusMove method, and the OnStylusUp method of each initial stylus plug-in to obtain a corresponding stylus plug-in; Rewrite the OnStylusDown method, the OnStylusMove method, and the OnStylusUp method of the initial static plug-in of the InkCanvas to obtain a corresponding static plug-in.
7. A multi-object pen writing and multi-pen writing system as claimed in claim 5, characterized in that: In the stroke construction module, the operation instruction is movement, rotation, or scaling.
8. A multi-object pen writing and multi-pen writing system as claimed in claim 5, characterized in that: The brush writing operation module is specifically configured to: The first pen is located in the object: When the brush presses the first pen, the static plug-in generates a first press-down event, determines whether the device ID of the brush generating the first press-down event matches the pre-stored device ID, if not, adjusts the first coordinate value of the input first point to a preset second coordinate value, and then does not call the first press-down event; if yes, then: Determine whether the first pen is located in the rectangle composed of the stroke, if yes, do not call the first press-down event; if not, generate a StylusDown event; Based on whether the stroke generated by the StylusDown event is within the rectangle composed of the stroke, call the drawing board of the object or the whole drawing board to perform a brush writing operation; The electronic whiteboard generates a StrokeCollected event, through which strokes during brush writing are collected, and strokes with the first point within the rectangle composed of the stroke are deleted; The first pen is not located in the object: When the brush presses the first pen, the static plug-in generates a first press-down event, determines whether the device ID of the brush generating the first press-down event matches the pre-stored device ID, if not, adjusts the first coordinate value of the input first point to a preset second coordinate value, and then does not call the first press-down event; if yes, then: When the first pen is not located in the rectangle composed of the stroke, call the first press-down event, and the whole drawing board performs a brush writing operation and generates a StylusDown event; The electronic whiteboard generates a StrokeCollected event, through which strokes during brush writing are collected, and strokes with the first point within the rectangle composed of the stroke are deleted.
Citation Information
Patent Citations
A multi-end drawing board synchronization method based on a state machine and a terminal
CN109726015A
Writing interaction method, intelligent interaction display device and writing interaction system
CN111352570A