Control display method and electronic device
By combining UWP and WPF controls in handwriting applications and dynamically switching ink canvas controls, the problems of handwriting delay and single function in the existing technology are solved, achieving a high-performance and multi-functional handwriting experience, improving user experience and Operational fluency.
Patent Information
- Application Number
- PCT/CN2024/070778
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-02
- Filing Date
- 2024-01-05
- Publication Date
- 2024-09-06
AI Technical Summary
Existing handwriting applications either focus on functionality, resulting in significant handwriting delays, or focus on performance, resulting in single functions, failing to take into account high performance and multi-function, affecting user experience.
Provide a control display method that combines the UWP-based first ink canvas control and the WPF-based second ink canvas control, dynamically switches according to user operations, improves handwriting and chirality and functional richness, and realizes the display and control of controls through the host container Synchronize and use animated transitions to avoid interface flickering.
It achieves a handwriting experience that combines high performance and multi-function on electronic devices, improves user experience and operational fluency, and avoids performance degradation caused by frequent data synchronization.
Smart Images

Figure CN2024070778_06092024_PF_FP
Abstract
Description
Control display method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 2, 2023, with application number 202310195847.9 and invention name “Control Display Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] Embodiments of the present application relate to the field of human-computer interaction technology, and more specifically, to a control display method and electronic device. Background Art
[0003] To facilitate handwriting input on electronic devices, various handwriting applications have emerged. A handwriting application is a program that supports handwriting input using a finger, mouse, stylus, etc. and converts it into ink for display.
[0004] With the widespread use of handwriting applications, users are demanding an increasingly sophisticated handwriting experience. However, currently developed handwriting applications either focus too much on functionality, resulting in significant hand tracking delays, or too much on performance, resulting in limited functionality. These applications fail to meet users' demands for both high performance and multi-functionality, significantly impacting the user experience.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a control display method and electronic device that can take into account the user's demand for high performance and multi-function of handwriting applications, thereby improving the user experience.
[0007] In a first aspect, a control display method is provided, which is applied to an electronic device, the electronic device including a first application developed based on the window rendering foundation WPF, the first application including a first ink canvas control and a second ink canvas control, the first ink canvas control being a universal window platform UWP control, and the second ink canvas control being a window rendering foundation WPF control, the method including: when it is detected that a user performs an operation of drawing handwriting in the first application, displaying the first ink canvas control in the user interface of the first application; when it is detected that the user performs an operation of erasing handwriting or lassoing handwriting in the first application, displaying the second ink canvas control in the user interface of the first application.
[0008] In an embodiment of the present application, a first application program simultaneously utilizes a first ink canvas control based on UWP and a second ink canvas control based on WPF. When a user draws, erases, or lassoes, the appropriate ink canvas control is presented to the user. This allows the user to use the first ink canvas control when drawing to improve hand tracking, and to use the second ink canvas control when erasing or lassoing to enrich the functionality of the first application program. Because the first application combines the excellent hand tracking of the first ink canvas control with the rich functionality of the second ink canvas control, it can meet the user's demand for high-performance and multi-functional handwriting experience, thereby enhancing the user experience.
[0009] In a possible implementation, the first ink canvas control is laid out in the first application through a host container.
[0010] The first ink canvas control can be displayed and run in the first application through the host container.
[0011] In one possible implementation, the host container is used to use UWP controls in an application developed based on WPF.
[0012] The host container provides the first ink canvas control with the capability of being displayed and called in the first application.
[0013] In one possible implementation, when the first ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is visible, and the first ink canvas control covers the second ink canvas control; when the second ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is collapsed, and the first ink canvas control does not block the display of the second ink canvas control.
[0014] In this embodiment of the present application, the first ink canvas control and the second ink canvas control can occupy the same canvas area. By setting the visibility property of the first ink canvas control, the user interface of the first application can display different ink canvas controls. In this way, when the user needs to perform different operations, the first application can display the appropriate canvas control to facilitate the user to use the corresponding canvas control to perform the corresponding operation.
[0015] In one possible implementation, when a first ink canvas control is displayed in the user interface of a first application, the transparency property of the first ink canvas control is opaque, and the first ink canvas control covers a second ink canvas control; when a second ink canvas control is displayed in the user interface of the first application, the transparency property of the first ink canvas control is transparent, and the first ink canvas control does not block the display of the second ink canvas control.
[0016] When a user draws ink in the first application, the second ink canvas control is completely covered by the first, allowing the user to see the results of the operation on the first. When a user erases or lassoes ink in the first application, the first application's user interface can display the contents of the second ink canvas control, allowing the user to see the results of the operation on the second.
[0017] In a possible implementation, when the transparency property of the first ink canvas control is opaque, the transparency property value of the first ink canvas control is 1; when the transparency property of the first ink canvas control is transparent, the transparency property value of the first ink canvas control is 0.
[0018] In a possible implementation, the method further includes: in a process in which the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control, first setting the transparency of the first ink canvas control to gradually change from opaque to transparent, and then changing the visibility property of the first ink canvas control from visible to collapsed; in a process in which the user interface of the first application switches from displaying the second ink canvas control to displaying the first ink canvas control, first changing the visibility property of the first ink canvas control from collapsed to visible, and then setting the transparency of the first ink canvas control to gradually change from transparent to opaque.
[0019] In the embodiment of the present application, during the process of switching between displaying the first ink canvas control and the second ink canvas control in the user interface of the first application, animation transition is used to reduce or avoid interface flickering and achieve user-unaware switching.
[0020] In a possible implementation, when the transparency of the first ink canvas control gradually changes from opaque to transparent or from transparent to opaque, the transparency property value of the first ink canvas control changes linearly.
[0021] The transparency gradient of the first ink canvas control is achieved through the linear change of the transparency property value, so that the transparency gradient process is smooth and natural, and maintains visual continuity.
[0022] In one possible implementation, the transparency gradient time of the first ink canvas control is less than or equal to 0.2 seconds.
[0023] The animation duration of switching between the two ink canvas controls is short, which can avoid interface flickering, jumping, and other phenomena during the switching process, and achieve user-imperceptible switching.
[0024] In a possible implementation, the first ink canvas control is laid out in the first application via a host container, and the transparency property of the first ink canvas control is set by setting the transparency property of the host container.
[0025] In a possible implementation, handwriting data of the first ink canvas control is synchronized with handwriting data of the second ink canvas control.
[0026] In this way, even if the first application switches the ink canvas control, the user sees the same handwriting, and the user can continue to perform operations such as drawing, erasing, and lassoing based on the completed handwriting without affecting the user's use.
[0027] In one possible implementation, synchronizing handwriting data of a first ink canvas control with handwriting data of a second ink canvas control includes: synchronizing first handwriting data corresponding to the first ink canvas control to the second ink canvas control when the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control; and synchronizing second handwriting data corresponding to the second ink canvas control to the first ink canvas control when the user interface of the first application switches from displaying the second ink canvas control to displaying the first ink canvas control.
[0028] In an embodiment of the present application, data synchronization is performed when the user switches from a drawing operation to an erasing (or lasso) operation or from an erasing (or lasso) operation to a drawing operation. This can not only avoid frequent data synchronization and performance degradation, but also ensure the timeliness of data synchronization and avoid functional errors.
[0029] In one possible implementation, the second handwriting data includes a first handwriting set, the first handwriting set includes at least one handwriting point, and synchronizing the second handwriting data corresponding to the second ink canvas control to the first ink canvas control includes: converting the first handwriting set into a second handwriting set, the second handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more consecutive handwriting points in at least one handwriting point; and synchronizing the second handwriting set to the first ink canvas control.
[0030] By changing the data structure or organization of the handwriting data, handwriting data synchronization between the first ink canvas control and the second ink canvas control can be achieved based on the relevant data of the handwriting points.
[0031] In one possible implementation, converting a first handwriting set into a second handwriting set includes: reading the coordinates of each handwriting point in at least one handwriting point from the first handwriting set through a predefined model; based on the model, dividing the at least one handwriting point into at least one handwriting object according to the coordinates of each handwriting point in the at least one handwriting point; and combining the at least one handwriting object to form a second handwriting set.
[0032] The predefined model can obtain which handwriting points are continuous according to the coordinates of the handwriting points, thereby forming the continuous handwriting points into a handwriting object, thereby changing the organization method of the handwriting data.
[0033] In a possible implementation, the attributes of the first handwriting point in at least one handwriting object include the coordinates of the first handwriting point and a handwriting object identifier, where the handwriting object identifier is used to identify the handwriting object to which the first handwriting point belongs.
[0034] In one possible implementation, the model is in dictionary form.
[0035] In a possible implementation, the handwriting object identifier is a hash value.
[0036] In a possible implementation, the model is used to convert the data format of the second handwriting data.
[0037] In one possible implementation, the first handwriting data includes a third handwriting set, the third handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more continuous handwriting points, and synchronizing the first handwriting data corresponding to the first ink canvas control to the second ink canvas control includes: synchronizing the coordinates of each of the one or more handwriting points corresponding to each handwriting object in the at least one handwriting object to the second ink canvas control.
[0038] In a possible implementation, the first application is a handwriting program, which supports the user to draw handwriting by at least one of a mouse, a stylus, a finger, and the like.
[0039] In a possible implementation, the electronic device is equipped with a Windows operating system.
[0040] In a second aspect, a device is provided. The device is included in an electronic device, and the device has the function of implementing the behaviors involved in the above-mentioned first aspect and any possible implementation manner of the first aspect.
[0041] This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a display module or unit, an acquisition module or unit, a receiving module or unit, a processing module or unit, etc.
[0042] In a third aspect, an electronic device is provided, comprising: one or more processors; one or more memories; one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the electronic device to execute the method in the above-mentioned first aspect and any possible implementation of the first aspect.
[0043] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method in the above-mentioned first aspect and any possible implementation manner of the first aspect.
[0044] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method in the first aspect and any possible implementation of the first aspect.
[0045] In a sixth aspect, a chip is provided, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface and executes the method in the above-mentioned first aspect and any possible implementation of the first aspect.
[0046] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in the above-mentioned first aspect and any possible implementation method of the first aspect.
[0047] The above chip may specifically be a field programmable gate array or a dedicated integrated circuit.
[0048] The beneficial effects of the devices in aspects 2 to 6 can refer to the beneficial effects of the method described in aspect 1, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0050] FIG2 is a schematic flowchart of a control display method provided in an embodiment of the present application.
[0051] FIG3 is a schematic diagram of the development process of the first application in an embodiment of the present application.
[0052] FIG4 is a schematic diagram of an interface effect of the control display method provided in an embodiment of the present application.
[0053] FIG5 is a schematic flowchart of switching display of an ink canvas control in a control display method provided in an embodiment of the present application.
[0054] FIG6 is a schematic flowchart of handwriting data synchronization in the control display method provided in an embodiment of the present application.
[0055] FIG7 is a schematic flowchart of handwriting data synchronization in the control display method provided in an embodiment of the present application.
[0056] FIG8 is a schematic structural block diagram of a device provided in an embodiment of the present application.
[0057] FIG9 is a schematic structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0059] It should be noted that, in the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two, and “at least one” and “one or more” refer to one, two or more. The singular expressions “a”, “an”, “said”, “the” and “this” are intended to also include expressions such as “one or more” unless there is a clear indication to the contrary in the context.
[0060] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0061] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0062] To facilitate understanding, the technical terms involved in the embodiments of this application are first introduced below.
[0063] The Windows operating system is an operating system developed based on a graphical user interface, mainly used in computers, smart phones, tablet computers and other devices.
[0064] Windows Presentation Foundation (WPF) is a user interface (UI) framework for Windows and is part of the .NET Framework 3.0. WPF provides a unified programming model, language, and framework, effectively separating the work of interface designers from developers while providing a new multimedia interactive graphical user interface. In the embodiments of this application, applications developed based on the WPF user interface framework are referred to as WPF applications.
[0065] The Universal Windows Platform (UWP) is a user interface framework based on Windows. Compared to WPF, UWP is a universal application platform for Windows. That is, applications developed for this platform are not designed for a specific terminal, but can run on a variety of different types of devices such as mobile phones, tablets, personal computers, game consoles, mixed reality head-mounted displays, Internet of Things (IoT) devices, etc. In the embodiments of this application, applications developed based on the UWP user interface framework are called UWP applications.
[0066] The InkCanvas control is used to receive and display ink input. Essentially, it's a canvas that defines the area where ink input is received and displayed. In practice, when the application to which the InkCanvas belongs is running, the InkCanvas control initially displays nothing. However, once the user enters the InkCanvas control's data (i.e., ink) using a finger, stylus, or mouse, it recognizes the data and presents the result to the user. In other words, the InkCanvas control is primarily used to capture and display handwriting.
[0067] The InkCanvas control can include at least one of the following functions (or modes): drawing, erasing, and selecting (or lassoing) ink. The drawing function supports writing and drawing on the canvas. The erasing function allows you to erase ink displayed on the canvas, including point-by-point erasing (erasing one ink point at a time) and stroke-by-stroke erasing (erasing an uninterrupted stroke at a time). The selecting function allows you to select a section of ink on the canvas for actions such as moving, scaling, and deleting.
[0068] A handwriting program (i.e., a handwriting application), or a stylus program, refers to a program that supports handwriting input using fingers, a mouse, a stylus, etc. For example, the handwriting program can recognize the content input by the user using a finger, a mouse, or a stylus and convert it into ink for display.
[0069] The method provided in the embodiment of the present application is applied to electronic devices, including but not limited to electronic devices equipped with Mobile phones, tablet computers, in-vehicle devices, wearable devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart screens, and other electronic devices with display screens that use the operating system. The embodiments of this application do not impose any restrictions on the specific types of electronic devices.
[0070] For example, FIG1 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0071] As shown in Figure 1, the electronic device 100 may include a memory 120 and a processor 110. The memory 120 is used to store computer programs, which include an operating system program 122 and an application program 121. The processor 110 is used to read the computer program in the memory 120 and then execute the method defined by the computer program. For example, the processor 110 reads the operating system program 122 to run the operating system on the electronic device 100 and implement various functions of the operating system, or reads one or more application programs 121 to run applications on the electronic device 100. Specifically, the computer program includes instructions, and the processor 110 can execute the above instructions stored in the memory 120 to enable the electronic device 100 to perform the methods provided in this application, as well as various functional applications and data processing.
[0072] The processor 110 may include one or more processors (or processing units). For example, the processor 110 may include one or more central processing units (CPUs), graphics processing units (GPUs), application processors (APs), image signal processors (ISPs), modem processors, digital signal processors (DSPs), baseband processors, neural network processing units (NPUs), and / or video codecs. When the processor 110 includes multiple processors, the multiple processors may be integrated on the same chip or may be independent chips. A processor may include one or more processing cores.
[0073] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory, avoiding repeated accesses, reducing processor 110 latency, and improving system efficiency.
[0074] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0075] For example, the processor 110 and the touch sensor can communicate via an I2C bus interface to implement the touch function of the electronic device 100. The processor 110 and the camera can communicate via a camera serial interface (CSI) in MIPI to implement the shooting function of the electronic device 100. The processor 110 and the display can communicate via a display serial interface (DSI) in MIPI to implement the display function of the electronic device 100.
[0076] It is understood that the interface connection relationship between the modules described in the above examples is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0077] In addition, the memory 120 may also store other data 123 besides computer programs. The other data 123 may include data generated after the operating system program 122 or the application program 121 is run, including system data (such as configuration parameters of the operating system) and user data.
[0078] The memory 120 may include internal memory (or internal memory) and external memory (or external memory). The memory may be random access memory (RAM), read-only memory (ROM), and cache, etc. It may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, universal flash storage (UFS), etc. The external memory may be a hard disk, an optical disk, a universal serial bus (USB) disk, a floppy disk, or a tape drive, etc. The external memory may communicate with the processor 110 through an external memory interface to implement a data storage function. Computer programs such as application programs 121 may be stored in the external memory, and the processor may load the computer program from the external memory to the internal memory before executing the processing. The operating system program 122 may be stored in the internal memory. In this way, the internal memory may store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory. Exemplarily, the internal memory may include a program storage area and a data storage area. The program storage area may store an operating system, and may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data (such as images, contacts, etc.) created during the use of the electronic device 100.
[0079] The application 121 includes a computer program that can implement the control display method provided in the embodiment of the present application, such as a handwriting program, so that after the processor 110 reads and runs the application, the application can have the function of the control display method provided in the embodiment of the present application. The handwriting program involved in this application refers to a program that can support the user to use fingers, mice, styluses, etc. for handwriting input. For example, the handwriting program can recognize the content input by the user using fingers, mice or styluses and convert it into ink for display.
[0080] The operating system program 122 may be The operating system enables the processor 110 to support the implementation of the control display method provided in the embodiment of the present application after reading the operating system program 122 and running the operating system.
[0081] The electronic device 100 may further include an input device 130 for receiving input digital information, character information or contact touch operation / contactless gesture, and generating signal input related to the user settings and function control of the electronic device 100. Specifically, in an embodiment of the present application, the input device 130 may include a touch panel 131. The touch panel 131, also known as a touch screen, can collect the user's touch operations on or near it (such as the user using any suitable object or accessory such as a finger, stylus, etc. on the touch panel 131 or on the touch panel 131) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 110, and can receive commands sent by the processor 110 and execute them.
[0082] The touch panel 131 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 131, the input device 130 can also include other input devices 132, which can include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, and a joystick.
[0083] The electronic device 100 may further include a display device 140, such as a display screen, for displaying information input by the user or information provided to the user, as well as various menu interfaces of the electronic device 100. For example, the display device 140 can be used to display handwriting input by the user through fingers, a mouse, a stylus, etc. The display device 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), a flexible light-emitting diode (FLED), a quantum dot light emitting diode (QLED), etc. In some other embodiments, the touch panel 131 may be covered on the display panel 141 to form a touch display screen. Alternatively, a touch sensor may be provided in the display panel 141 to form a touch display screen.
[0084] Electronic device 100 can implement display functions through a GPU, display device 140, and an application processor. A GPU is a microprocessor for image processing that connects display device 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 includes one or more GPUs, which execute program instructions to generate or modify display information.
[0085] In addition to the above, the electronic device 100 may also include a power supply 150 for powering other modules, a camera 160 for taking photos or videos, an audio device 170 for receiving or sending audio signals, one or more sensors 180, a mobile communication module 191, a wireless communication module 192, etc.
[0086] The power supply 150 may be a battery, which may receive charging input from a charger via the charging management module and may power the electronic device 100 via the power management module. The power management module may also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status.
[0087] Camera 160 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 160, where N is a positive integer greater than 1. Electronic device 100 can implement the capture function through an ISP, camera 160, video codec, GPU, display device 140, and application processor. The ISP processes data fed back by camera 160. The video codec compresses or decompresses digital video.
[0088] The audio device 170 may include a speaker, a receiver, a microphone, an earphone interface, and an audio processing module to implement audio functions of the electronic device 100, such as audio playback and recording.
[0089] The sensor 180 may include a pressure sensor, a gyro sensor, an acceleration sensor, a fingerprint sensor, a touch sensor, etc., and may also include other sensors, which are only illustrated here.
[0090] The pressure sensor is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor can be provided on the display screen. When a touch operation is applied to the display screen, the electronic device 100 can detect the intensity of the touch operation using the pressure sensor and can also calculate the location of the touch based on the detection signal of the pressure sensor.
[0091] The gyroscope sensor can be used to determine the motion posture of the electronic device 100. In some embodiments, the gyroscope sensor can be used to determine the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes). The gyroscope sensor can be used for image stabilization, navigation, and somatosensory gaming scenarios.
[0092] The acceleration sensor can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
[0093] The fingerprint sensor is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0094] A touch sensor, also known as a "touch control device," can be provided on a display screen, with the touch sensor and the display screen forming a touch display screen. The touch sensor is used to detect touch operations applied on or near the touch sensor. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided through the display screen. In other embodiments, the touch sensor can also be provided on the surface of the electronic device 100, in a location different from that of the display screen.
[0095] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 191, the wireless communication module 192, the modem processor and the baseband processor.
[0096] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0097] The mobile communication module 191 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 191 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 191 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 191 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 191 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 191 can be set in the same device as at least some of the modules of the processor 110.
[0098] The wireless communication module 192 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 192 can be one or more devices that integrate at least one communication processing module. The wireless communication module 192 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 192 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0099] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0100] For ease of understanding, the following embodiments of the present application will take an electronic device having the structure shown in FIG1 as an example, and combine the accompanying drawings and application scenarios to specifically illustrate the control display method provided in the embodiments of the present application.
[0101] Both the WPF user interface framework and the UWP user interface framework provide the InkCanvas control. The WPF InkCanvas control (or the InkCanvas control based on the WPF user interface framework) supports drawing on the canvas through the mouse, stylus (such as a stylus), touch screen, etc., and provides handwriting erasure (such as point-by-point erasing) and lasso functions, but there is a significant handwriting tracking delay when drawing on electronic devices. The UWP InkCanvas control (or the InkCanvas control based on the UWP user interface framework) also supports drawing on the canvas through the mouse, stylus (such as a stylus), touch screen, etc., and has excellent performance when drawing on electronic devices, with almost no handwriting tracking delay, but it does not provide handwriting erasure and lasso functions.
[0102] Usually equipped with When developing programs that include the InkCanvas control (such as handwriting applications) on electronic devices with an operating system, you can either sacrifice performance and use the WPF InkCanvas control to ensure rich functionality; or sacrifice functionality and use the UWP InkCanvas control to ensure hand tracking of the handwriting.
[0103] With the widespread use of handwriting applications, users are demanding an increasingly sophisticated handwriting experience. However, currently developed handwriting applications either focus too much on functionality, resulting in significant hand tracking delays, or too much on performance, resulting in limited functionality. These applications fail to meet users' demands for both high performance and multi-functionality, impacting the user experience.
[0104] Therefore, an embodiment of the present application provides a control display method that can take into account the user's demand for high performance and multi-function of handwriting programs, thereby improving the user experience.
[0105] Figure 2 shows a schematic flow chart of a control display method provided in an embodiment of the present application. The method 200 shown in Figure 2 is applied to an electronic device, which electronic device may be, for example, the electronic device 100 shown in Figure 1. In an embodiment of the present application, the electronic device includes a first application developed based on WPF, wherein the first application includes a first ink canvas control and a second ink canvas control. In some embodiments, the electronic device is equipped with a Windows operating system. The method 200 includes steps S210 to S220, which are described in detail below in conjunction with the accompanying drawings.
[0106] S210: When it is detected that the user performs a handwriting drawing operation in the first application, a first ink canvas control is displayed in the user interface of the first application.
[0107] The first ink canvas control belongs to a UWP control, or in other words, the first ink canvas control is an ink canvas control under the UWP user interface framework. More specifically, in an embodiment of the present application, the first ink canvas control is an InkCanvas control of UWP.
[0108] S220: When it is detected that the user performs an operation of erasing handwriting or lassoing handwriting in the first application, a second ink canvas control is displayed in the user interface of the first application.
[0109] The second ink canvas control belongs to a WPF control, or in other words, the second ink canvas control is an ink canvas control under the WPF user interface framework. More specifically, in the embodiment of the present application, the second ink canvas control is a WPF InkCanvas control.
[0110] It should be noted that the "display" involved in steps S210 and S220 can be understood as being operable. That is, in step S210, when the user draws in the first application, the first ink canvas control can be operated, or the user draws on the first ink canvas control. In step S220, when the user erases or lassoes in the first application, the second ink canvas control can be operated, or the user erases or lassoes on the second ink canvas control.
[0111] In the embodiment of the present application, the first application is developed based on the WPF user interface framework, so the first application is a WPF application. The method provided in the present application is based on the WPF application and introduces (or bridges) UWP controls.
[0112] In an embodiment of the present application, a first application includes a first ink canvas control and a second ink canvas control. Thus, the first application can receive handwriting input data from a user, such as data input by a finger, stylus, or mouse, and display it to the user. Exemplarily, the first application is a handwriting application that supports user handwriting drawing using at least one of a mouse, stylus, and finger.
[0113] In an embodiment of the present application, a first application program simultaneously utilizes a first ink canvas control based on UWP and a second ink canvas control based on WPF. When a user draws, erases, or lassoes, the appropriate ink canvas control is presented to the user. This allows the user to use the first ink canvas control when drawing to improve hand tracking, and to use the second ink canvas control when erasing or lassoing to enrich the functionality of the first application program. Because the first application combines the excellent hand tracking of the first ink canvas control with the rich functionality of the second ink canvas control, it can meet the user's demand for high-performance and multi-functional handwriting experience, thereby enhancing the user experience.
[0114] It should be noted that the embodiments of the present application do not limit the order in which steps S210 and S220 are executed. In some embodiments, if the user only performs a drawing operation, then only step S210 may be executed; in some embodiments, if the user only performs an erasing or lassoing operation, then only step S220 may be executed; in some embodiments, if the user first performs a drawing operation and then an erasing (or lassoing) operation, then step S210 may be executed first and then step S220; in some embodiments, if the user first performs an erasing (or lassoing) operation and then a drawing operation, then step S220 may be executed first and then step S210.
[0115] In some embodiments, in step S220, the erasing operation performed by the user may be a point-by-point erasing operation.
[0116] In some embodiments, when the first application is launched, the user interface of the first application displays the first ink canvas control by default.
[0117] In some embodiments, the first ink canvas control is laid out (or compiled) in the first application via a host container.
[0118] Typically, a host container is used to provide encapsulated information (such as controls, interface elements, etc.) with the ability to be displayed and / or called in an application. The host container involved in the embodiment of the present application is used to use UWP controls in applications developed based on WPF. That is, UWP controls can be presented in WPF applications through the host container as a host. Here, the first ink canvas control is presented in the first application through the host container as a host.
[0119] In some embodiments, the host container can be a XAML host for a WPF user interface. Specifically, it can be the class WindowsXamlHost in the class library Microsoft.Toolkit.Wpf.UI.XamlHost provided by the Windows Community Toolkit. In a specific implementation, the first ink canvas control can be encapsulated in WindowsXamlHost, and then the WindowsXamlHost encapsulating the first ink canvas control can be placed in the first application. In this way, the first ink canvas control can be presented in the WPF application, that is, in the first application, through WindowsXamlHost.
[0120] It should be noted that the controls encapsulated in the host container include but are not limited to the first ink canvas control. In other words, the UWP controls that need to be presented in the first application can be encapsulated in the host container, so that they can be presented in the first application through the host container as a host. For the convenience of description, in this embodiment of the application, the UWP controls encapsulated in the host container can be collectively referred to as UWP user controls, where the UWP user controls include the first ink canvas control.
[0121] For ease of understanding, Figure 3 shows a schematic diagram of the development process of the first application in an embodiment of the present application. As shown in Figure 3, an operating system is running on the electronic device used to develop the first application, and the operating system is specifically a Windows operating system. Based on the support of the Windows operating system, in the process of developing the first application, the UWP user control encapsulating the first ink canvas control can be first encapsulated in a host container, and then the host container encapsulating the UWP user control can be laid out in a WPF application including a second ink canvas control. In this way, the UWP user control can be bridged into the WPF application to form the first application in an embodiment of the present application. The WPF application includes the second ink canvas control, and the host container includes the first ink canvas control. Therefore, the first application formed includes the first ink canvas control and the second ink canvas control.
[0122] In the embodiment of the present application, full access support of the .NET framework can be obtained through the host container, thereby enabling the display and operation of the first ink canvas control in the first application.
[0123] In some embodiments, the canvas range of the first ink canvas control is the same as the canvas range of the second ink canvas control. In other words, the first ink canvas control and the second ink canvas control occupy the same canvas range (or area). The canvas range involved here includes the size and position of the canvas (i.e., the ink control).
[0124] The canvas range occupied by the first ink canvas control and the second ink canvas control may be a portion of the display screen of the electronic device, or the entire display screen, which is not limited in this embodiment of the present application.
[0125] It should be noted that when the first ink canvas control is placed in the first application via a host container, the canvas area of the first ink canvas control is consistent with the area occupied by the host container. Still using Figure 3 as an example, when developing the first application, the first ink canvas control and the second ink canvas control are implemented by simultaneously placing the second ink canvas control and the host container encapsulating the first ink canvas control in the same canvas area.
[0126] In some embodiments, when the first ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is visible (such as indicated as visible), and the first ink canvas control is overlaid on the second ink canvas control.
[0127] That is, when the user performs the operation of drawing handwriting in the first application, the first ink canvas control is located above the second ink canvas control and the first ink canvas control is visible (i.e., occupies the canvas area), so that the user can draw handwriting on the first ink canvas control and the user can see the drawing results.
[0128] In some embodiments, when the second ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is collapsed (such as expressed as collapsed), and the first ink canvas control does not obstruct the display of the second ink canvas control.
[0129] That is, when the user performs an operation of erasing or lassoing in the first application, the first ink canvas control is folded (for example, folded into a line), and the first ink canvas control does not occupy or almost does not occupy the canvas area, so that the second ink canvas control is displayed in the user interface, so that the user can erase or lasso on the second ink canvas control, and the user can see the erasing result or lassoing result.
[0130] In some embodiments, when a first ink canvas control is placed in a first application via a host container, the visibility property of the first ink canvas control is set by setting the visibility property of the host container. In other words, the visibility property of the first ink canvas control is consistent with the visibility property of the host container. By setting the visibility property of the host container to Visible, the visibility property of the first ink canvas control can be set to Visible; by setting the visibility property of the host container to Collapsed, the visibility property of the first ink canvas control can be set to Collapsed.
[0131] It should be noted that when the second ink canvas control is displayed in the user interface of the first application, the embodiment of the present application sets the visibility property of the first ink canvas control to collapsed rather than hidden (such as expressed as hidden). This is because, when the first ink canvas control is placed in the first application via a host container, the host container will forcibly render the area in which it is located, and this area can only display controls encapsulated by the host container. Therefore, even if the visibility property of the first ink canvas control is set to hidden, this area cannot display other UIs, nor can it display the second ink canvas control. However, if the visibility property of the first ink canvas control is set to collapsed, the collapsed first ink canvas control can display other UIs without affecting the display of other UIs in this area, so the second ink canvas control can be displayed in this area.
[0132] For ease of understanding, Figure 4 shows a schematic diagram of the interface effect of the control display method provided in an embodiment of the present application. As shown in (a) of Figure 4, when the first ink canvas control is displayed in the user interface of the first application, the first ink canvas control covers the second ink canvas control, wherein the first ink canvas control is visible and the second ink canvas control is obscured. As shown in (b) of Figure 4, when the second ink canvas control is displayed in the user interface of the first application, the first ink canvas control is located above the second ink canvas control, wherein the first ink canvas control is folded and the second ink canvas control is visible.
[0133] In an embodiment of the present application, a first ink canvas control and a second ink canvas control can occupy the same canvas area, with the first ink canvas control positioned above the second ink canvas control. By setting the visibility property of the first ink canvas control, the user interface of the first application can display different ink canvas controls. In this way, when a user needs to perform different operations, the first application can display the appropriate canvas control to facilitate the user to perform the corresponding operation using the corresponding canvas control. In other words, a user can use the first ink canvas control to perform drawing operations on the canvas area of the first ink canvas control, and use the second ink canvas control to perform erasing or lasso operations on the canvas area of the second ink canvas control.
[0134] In some embodiments, when the first ink canvas control is displayed in the user interface of the first application, the transparency property of the first ink canvas control is opaque, and the first ink canvas control is covered on the second ink canvas control.
[0135] That is, when the user performs a handwriting drawing operation in the first application, the first ink canvas control is covered on the second ink canvas control and the first ink canvas control is opaque, so that the second ink canvas control is completely covered and the user can see the result of the operation performed on the first ink canvas control.
[0136] In some embodiments, when the second ink canvas control is displayed in the user interface of the first application, the transparency property of the first ink canvas control is transparent, and the first ink canvas control does not obstruct the display of the second ink canvas control.
[0137] That is, when the user performs an operation of erasing or lassoing ink in the first application, the first ink canvas control is transparent, the user interface of the first application can present the content of the second ink canvas control, and the user can see the result of the operation performed on the second ink canvas control.
[0138] As an example but not a limitation, the transparency attribute may be represented by an Opacity attribute, where the value of the Opacity attribute may range from 0.0 to 1.0, and the smaller the value, the more transparent it is.
[0139] In some embodiments, when the transparency property of the first ink canvas control is opaque, the transparency property value of the first ink canvas control may be 1. In this way, the elements below the first ink canvas control (such as the second ink canvas control) are covered to the greatest extent.
[0140] In some embodiments, when the transparency property of the first ink canvas control is transparent, the transparency property value of the first ink canvas control can be 0. In this way, the elements below the first ink canvas control (such as the second ink canvas control) are covered to a minimum extent.
[0141] In some embodiments, when a first ink canvas control is placed in a first application via a host container, the transparency property of the first ink canvas control is set by setting the transparency property of the host container. In other words, the transparency property of the first ink canvas control is consistent with the transparency property of the host container. By setting the transparency property of the host container to transparent, the transparency property of the first ink canvas control can be set to transparent; by setting the transparency property of the host container to opaque, the transparency property of the first ink canvas control can be set to opaque.
[0142] As mentioned above, in some embodiments, the user can first perform a drawing operation and then perform an erasing (or lassoing) operation, or first perform an erasing (or lassoing) operation and then perform a drawing operation, which involves switching the display between the first ink canvas control and the second ink canvas control.
[0143] In some embodiments, method 200 may further include: in the process of switching the user interface of the first application from displaying the first ink canvas control to displaying the second ink canvas control, first setting the transparency of the first ink canvas control to gradually change from opaque to transparent, and then changing the visibility property of the first ink canvas control from visible to collapsed.
[0144] In other words, referring to FIG5 (a), the user interface of the first application first displays a first ink canvas control, where the transparency property of the first ink canvas control is opaque and the visibility property of the first ink canvas control is visible. Later, the user interface of the first application switches to display a second ink canvas control. During this switching process, the transparency property of the first ink canvas control is first gradually changed from opaque to transparent (i.e., step 1 in FIG5 (a)), so that the user can see the second ink canvas control covered by the first ink canvas control. Then, the visibility property of the first ink canvas control is changed from visible to collapsed (i.e., step 2 in FIG5 (a)), so that the first ink canvas control does not occupy the canvas area of the second ink canvas control, and the user can perform operations on the second ink canvas control.
[0145] In this embodiment of the present application, an animated transition is used when the user interface of a first application switches between displaying a first ink canvas control and a second ink canvas control, thereby reducing or preventing interface flicker. Specifically, during the switching process, the transparency gradient of the first ink canvas control is completed first. Therefore, when the first ink canvas control is collapsed, the user cannot perceive it, and flickering does not occur.
[0146] In some embodiments, method 200 may further include: in the process of switching the user interface of the first application from displaying the second ink canvas control to displaying the first ink canvas control, first changing the visibility property of the first ink canvas control from collapsed to visible, and then setting the transparency of the first ink canvas control to gradually change from transparent to opaque.
[0147] In other words, as shown in Figure 5(b), the user interface of the first application initially displays the second ink canvas control. The transparency property of the first ink canvas control is transparent, and the visibility property of the first ink canvas control is collapsed. At this point, the first ink canvas control does not occupy the canvas area of the second ink canvas control. Later, the user interface of the first application switches to displaying the first ink canvas control. During this switching process, the visibility property of the first ink canvas control is first changed from collapsed to visible (i.e., step 1 in Figure 5(b)). This allows the first ink canvas control to expand and cover the second ink canvas control. Because the transparency of the first ink canvas control is transparent, the user still sees the content of the second ink canvas control and cannot see the content of the first ink canvas control. The transparency of the first ink canvas control is then gradually changed from transparent to opaque (i.e., step 2 in Figure 5(b)). This allows the user to see the content of the first ink canvas control, and the first ink canvas control now covers the second ink canvas control, allowing the user to perform operations on the first ink canvas control.
[0148] In an embodiment of the present application, an animated transition is employed during the process of switching between the second ink canvas control and the first ink canvas control in the user interface of a first application to reduce or avoid interface flickering. Specifically, during the switching process, since the visibility property of the first ink canvas control is modified first, the first ink canvas control has already expanded to occupy the canvas area. This process is imperceptible to the user, and thus, flickering does not occur when the transparency of the first ink canvas control is gradually changed.
[0149] In some embodiments, when the transparency of the first ink canvas control gradually changes from opaque to transparent or from transparent to opaque, the transparency property value of the first ink canvas control changes linearly.
[0150] The transparency gradient of the first ink canvas control is achieved through the linear change of the transparency property value, so that the transparency gradient process is smooth and natural, and maintains visual continuity.
[0151] In some embodiments, the transparency gradient time of the first ink canvas control is less than or equal to 0.2 seconds. That is, the animation duration of the user interface of the first application switching between displaying the first ink canvas control and the second ink canvas control is less than or equal to 0.2 seconds. For example, the transparency gradient time of the first ink canvas control can be 0.1 seconds.
[0152] The animation duration of switching between the two ink canvas controls is short, which can avoid interface flickering and jumping during the switching process, and achieve a user-impacted switching. In this way, users will not notice that the interface is switching, but will feel that they are operating on the same canvas.
[0153] It can be understood that in actual applications, the animation duration of switching between the two ink canvas controls can be determined based on the time it takes for the human eye to clearly perceive the interface change. This is only an exemplary description and the embodiments of the present application are not limited thereto.
[0154] In some embodiments, the method 200 may further include synchronizing the handwriting data of the first ink canvas control with the handwriting data of the second ink canvas control.
[0155] In other words, the handwriting on the first ink canvas control is kept consistent with the handwriting on the second ink canvas control. This way, when the user interface of the first application switches between the first and second ink canvas controls, the user sees the same handwriting. Even if the first application switches the ink canvas control, the user can continue to perform operations such as drawing, erasing, and lassoing based on the completed handwriting without affecting user experience.
[0156] In some embodiments, the handwriting data synchronization process between the first ink control and the second ink control may specifically include: when the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control, or when the user interface of the first application switches from displaying the second ink canvas control to displaying the first ink canvas control, synchronizing the handwriting data of the first ink canvas control with the handwriting data of the second ink canvas control.
[0157] In an embodiment of the present application, data synchronization is performed when the user switches from a drawing operation to an erasing (or lasso) operation or from an erasing (or lasso) operation to a drawing operation. This can not only avoid frequent data synchronization and performance degradation, but also ensure the timeliness of data synchronization and avoid functional errors.
[0158] In some embodiments, when the user interface of the first application switches from displaying the second ink canvas control to displaying the first ink canvas control, the second handwriting data corresponding to the second ink canvas control is synchronized to the first ink canvas control.
[0159] For ease of understanding, illustratively, as shown in (a) and (b) in Figure 6, when the user performs an erase operation or a lasso operation, the user interface of the first application currently displays the second ink canvas control; when the user switches the operation, for example, switching to a drawing operation, the user interface of the first application switches to display the first ink canvas control, and synchronizes the second handwriting data corresponding to the second ink canvas control to the first ink canvas control.
[0160] Here, the second handwriting data corresponding to the second ink canvas control can be understood as the handwriting data on the second ink canvas control before synchronization, which includes the input information received by the second ink canvas control when the user operates on the second ink canvas control (such as handwriting after erasure or movement). In some embodiments, it can also include handwriting information that has been synchronized from the first ink canvas control to the second ink canvas control before this synchronization.
[0161] When the user interface of the first application switches to display the first ink canvas control, the second handwriting data corresponding to the second ink canvas control is synchronized to the first ink canvas control, so that the user can see the handwriting after the user performs the operation on the second ink canvas control on the first ink canvas control, and continue to perform the drawing operation on the first ink canvas control based on the previous handwriting.
[0162] In some embodiments, when the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control, the first handwriting data corresponding to the first ink canvas control is synchronized to the second ink canvas control.
[0163] For ease of understanding, illustratively, as shown in (c) in Figure 6, when the user performs a drawing operation, the user interface of the first application currently displays the first ink canvas control; when the user switches the operation, for example, switching to an erase or lasso operation, the user interface of the first application switches to display the second ink canvas control, and synchronizes the first handwriting data corresponding to the first ink canvas control to the second ink canvas control.
[0164] Here, the first handwriting data corresponding to the first ink canvas control can be understood as the handwriting data on the first ink canvas control before synchronization, which includes the input information (such as input handwriting) received by the first ink canvas control when the user operates on the first ink canvas control. In some embodiments, it can also include the handwriting information that the second ink canvas control has synchronized to the first ink canvas control before this synchronization.
[0165] When the user interface of the first application switches to display the second ink canvas control, the first handwriting data corresponding to the first ink canvas control is synchronized to the second ink canvas control, so that the user can see the handwriting drawn by the user on the first ink canvas control on the second ink canvas control, and continue to perform erasing or lassoing operations on the second ink canvas control based on the handwriting already drawn.
[0166] The embodiments of the present application do not limit the order in which the steps of switching the display of the ink canvas control in the user interface of the first application and synchronizing the handwriting data of the first ink canvas control with the handwriting data of the second ink canvas control are executed. The steps can be executed sequentially or simultaneously. For example, the step of switching the ink canvas control can be executed first, followed by the step of synchronizing the handwriting data; or the step of synchronizing the handwriting data can be executed first, followed by the step of switching the ink canvas control; or the step of switching the ink canvas control and the step of synchronizing the handwriting data can be executed simultaneously.
[0167] Since the time required to switch the ink canvas control and the time required to synchronize the handwriting data are both relatively short, the switching and synchronization can be achieved without the user's perception.
[0168] In this embodiment of the present application, the handwriting of the first ink canvas control and the handwriting of the second ink canvas control are in different assemblies and have different data structures. Therefore, direct assignment of values cannot be made when synchronizing handwriting data. Therefore, this application also provides the following handwriting data synchronization method, which can achieve handwriting data synchronization between the first ink canvas control and the second ink canvas control.
[0169] The following describes how to synchronize the second handwriting data with the first ink canvas control.
[0170] In some embodiments, the second handwriting data includes a first handwriting set, the first handwriting set includes at least one handwriting point, and synchronizing the second handwriting data corresponding to the second ink canvas control to the first ink canvas control may include: converting the first handwriting set into a second handwriting set, the second handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more consecutive handwriting points in at least one handwriting point; and synchronizing the second handwriting set to the first ink canvas control.
[0171] In this embodiment of the present application, the first handwriting set may include at least one handwriting point. During synchronization of the second handwriting data, the at least one handwriting point may be first divided into at least one handwriting object based on the continuity of the handwriting points to form a second handwriting set. This converts the data organization of the second handwriting data into a data organization that is recognizable and parseable by the first ink canvas control, facilitating parsing and value assignment by the first ink canvas control.
[0172] In some embodiments, the second handwriting data includes coordinates of each handwriting point of the at least one handwriting point.
[0173] In some embodiments, the electronic device can convert a first handwriting set into a second handwriting set using a predefined model. For example, the electronic device reads the coordinates of each of at least one handwriting point in the first handwriting set using the predefined model; based on the predefined model, divides the at least one handwriting point into at least one handwriting object according to the coordinates of each of the at least one handwriting point; and combines the at least one handwriting object to form the second handwriting set.
[0174] Here, the predefined model is used to convert the data format of the second handwriting data. It can obtain which handwriting points are continuous according to the coordinates of the handwriting points, and thus form the continuous handwriting points into a handwriting object, thereby changing the organization method of the handwriting data.
[0175] In some embodiments, the attributes of the first handwriting point in the at least one handwriting object include the coordinates of the first handwriting point and a handwriting object identifier, where the handwriting object identifier is used to identify the handwriting object to which the first handwriting point belongs.
[0176] Here, the first handwriting point has been classified as a handwriting object. For example, the first handwriting point may belong to the first handwriting object. Therefore, the attributes of the first handwriting point include the coordinates of the first handwriting point and a handwriting object identifier used to identify the first handwriting object. Thus, the attributes of the first handwriting point can be used to determine both the position of the first handwriting point on the canvas and the handwriting object to which it belongs.
[0177] In some embodiments, the handwriting object identifier may be a hash value.
[0178] In some embodiments, the model may be a trained model, for example, in the form of a dictionary, specifically a point dictionary, for storing handwriting points.
[0179] For ease of understanding, the following exemplarily introduces a method for converting the first handwriting set into the second handwriting set in conjunction with Figure 7. As shown in Figure 7, the first handwriting set includes at least one handwriting point, and the second handwriting data corresponding to the second ink canvas control includes the coordinates of each handwriting point in the at least one handwriting point. In addition, the embodiment of the present application further defines a point dictionary and a point type, wherein the data in the point dictionary is stored as a key-value pair, the key is the hash value of the handwriting object, and the value is the handwriting point, wherein the type of the handwriting point is the defined point type. In the embodiment of the present application, the point type includes coordinates and handwriting attributes, and exemplarily, the handwriting attributes are represented by a handwriting object identifier. As an example and not a limitation, the handwriting identifier can be the hash value of the handwriting object in the point dictionary.
[0180] As shown in reference figure 7, when converting the first handwriting set, the point dictionary can first read the coordinates of each handwriting point in the first handwriting set, and then divide (or construct) the handwriting points in the first handwriting set into at least one handwriting object according to the coordinates of each handwriting point (or the continuity of the handwriting points), for example, divided into handwriting 1, handwriting 2, handwriting 3, etc. Each handwriting object in the at least one handwriting object includes one or more continuous handwriting points. Here, the type of handwriting points included in each handwriting object becomes a point type, that is, the attributes of each handwriting point include not only the coordinates of the handwriting point, but also the handwriting object identifier. In this way, the handwriting points can be reorganized according to the coordinates of the handwriting points and the handwriting object identifier to form a second handwriting set including handwriting object 1, handwriting object 2, handwriting object 3, ..., handwriting object N. The handwriting data corresponding to the second handwriting set can be recognized and parsed by the first ink canvas control. In the embodiment of the present application, the point dictionary serves as a data transfer station for the two ink canvas controls.
[0181] The following describes the process of synchronizing the first handwriting data to the second ink canvas control.
[0182] In some embodiments, the first handwriting data may include a third handwriting set, the third handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more continuous handwriting points, and synchronizing the first handwriting data corresponding to the first ink canvas control to the second ink canvas control may include: synchronizing the coordinates of each of the one or more handwriting points corresponding to each handwriting object in the at least one handwriting object to the second ink canvas control.
[0183] In this embodiment of the present application, the third handwriting collection may include at least one handwriting object, each of which includes one or more consecutive handwriting points. During synchronization of the first handwriting data, the coordinates of each handwriting point may be extracted and synchronized to the second ink canvas control. This converts the data organization of the first handwriting data into a data organization that is recognizable and parseable by the second ink canvas control, facilitating parsing and value assignment by the second ink canvas control.
[0184] In some embodiments, the first handwriting data may include the coordinates of each of the one or more handwriting points included in each of the at least one handwriting object and a handwriting object identifier, where the handwriting object identifier is used to identify the handwriting object to which the corresponding handwriting point belongs.
[0185] In some embodiments, the electronic device may convert the third handwriting set into a fourth handwriting set using a predefined model. For example, the electronic device reads the coordinates of each of the one or more handwriting points included in each handwriting object in at least one handwriting object from the third handwriting set using the predefined model; and based on the predefined model, forms the fourth handwriting set with all the read handwriting points and their coordinates.
[0186] Here, the fourth handwriting set includes at least one handwriting point, and the attribute of each handwriting point in the at least one handwriting point includes the coordinates of the handwriting point.
[0187] The predefined model is used to convert the data format of the first handwriting data. It can obtain the coordinates of the handwriting points, so as to form all the handwriting points into a handwriting set, thereby changing the organization method of the handwriting data.
[0188] In some embodiments, the model may be a trained model, for example, in the form of a dictionary, specifically a point dictionary, for storing handwriting points.
[0189] Based on the above introduction, this embodiment of the application parses the internal data formats of two different ink canvas controls. The second ink canvas control's handwriting data consists of individual handwriting points, while the first ink canvas control's handwriting data consists of individual handwriting objects. Therefore, this embodiment of the application defines a data structure based on handwriting points to transfer data between the two, solving the problem of data synchronization between the first and second ink canvas controls.
[0190] The control display method provided by the embodiment of the present application is described in detail above in conjunction with Figures 1 to 7. The device embodiment of the present application will be described in detail below in conjunction with Figures 8 and 9. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for parts not described in detail, reference can be made to the above method embodiment.
[0191] The apparatus provided in the embodiments of the present application includes a module for executing the corresponding method embodiments described above. The module can be software, hardware, or a combination of software and hardware. It is understood that the technical features described in the above method embodiments are also applicable to the following apparatus embodiments.
[0192] Figure 8 shows a schematic structural diagram of a device provided in an embodiment of the present application. The device 300 can be located in the electronic device 100 shown in Figure 1, or can be a specific example of the electronic device 100. The device 300 can perform each step of the method shown in Figure 2 and can specifically implement the embodiments shown in Figures 3 to 7. To avoid redundancy, the description will not be repeated.
[0193] As shown in FIG. 8 , the apparatus 300 may include a processing unit 310 and a display unit 320 .
[0194] The processing unit 310 is configured to: when detecting that a user performs a handwriting drawing operation in a first application, display a first ink canvas control in a user interface of the first application via the display unit 320 .
[0195] The processing unit 310 is further configured to: when it is detected that the user performs an operation of erasing handwriting or lassoing handwriting in the first application, display the second ink canvas control in the user interface of the first application via the display unit 320 .
[0196] In some embodiments, the first ink canvas control is placed in the first application via a host container.
[0197] In some embodiments, a host container is used to use UWP controls in applications developed based on WPF.
[0198] In some embodiments, when the first ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is visible, and the first ink canvas control is covered on the second ink canvas control; when the second ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is collapsed, and the first ink canvas control does not block the display of the second ink canvas control.
[0199] In some embodiments, when a first ink canvas control is displayed in the user interface of a first application, the transparency property of the first ink canvas control is opaque, and the first ink canvas control covers a second ink canvas control; when a second ink canvas control is displayed in the user interface of the first application, the transparency property of the first ink canvas control is transparent, and the first ink canvas control does not block the display of the second ink canvas control.
[0200] In some embodiments, when the transparency property of the first ink canvas control is opaque, the transparency property value of the first ink canvas control is 1; when the transparency property of the first ink canvas control is transparent, the transparency property value of the first ink canvas control is 0.
[0201] In some embodiments, the processing unit 310 is further configured to: during a process in which the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control, first set the transparency of the first ink canvas control to gradually change from opaque to transparent, and then change the visibility property of the first ink canvas control from visible to collapsed.
[0202] In some embodiments, the processing unit 310 is further configured to: during the process of switching the user interface of the first application from displaying the second ink canvas control to displaying the first ink canvas control, first modify the visibility property of the first ink canvas control from collapsed to visible, and then set the transparency of the first ink canvas control to gradually change from transparent to opaque.
[0203] In some embodiments, when the transparency of the first ink canvas control gradually changes from opaque to transparent or from transparent to opaque, the transparency property value of the first ink canvas control changes linearly.
[0204] In some embodiments, the transparency gradient time of the first ink canvas control is less than or equal to 0.2 seconds.
[0205] In some embodiments, the first ink canvas control is laid out in the first application via a host container, and the transparency property of the first ink canvas control is set by setting the transparency property of the host container.
[0206] In some embodiments, the processing unit 310 is further configured to synchronize the handwriting data of the first ink canvas control with the handwriting data of the second ink canvas control.
[0207] In some embodiments, the processing unit 310 is specifically configured to synchronize the first handwriting data corresponding to the first ink canvas control to the second ink canvas control when the user interface of the first application switches from displaying the first ink canvas control to displaying the second ink canvas control.
[0208] In some embodiments, the processing unit 310 is specifically configured to synchronize the second handwriting data corresponding to the second ink canvas control to the first ink canvas control when the user interface of the first application switches from displaying the second ink canvas control to displaying the first ink canvas control.
[0209] In some embodiments, the second handwriting data includes a first handwriting set, the first handwriting set includes at least one handwriting point, and the processing unit 310 is specifically used to: convert the first handwriting set into a second handwriting set, the second handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more continuous handwriting points in at least one handwriting point; and synchronize the second handwriting set to the first ink canvas control.
[0210] In some embodiments, the processing unit 310 is specifically used to: read the coordinates of each handwriting point in at least one handwriting point from a first handwriting set through a predefined model; based on the model, divide at least one handwriting point into at least one handwriting object according to the coordinates of each handwriting point in at least one handwriting point; and combine at least one handwriting object to form a second handwriting set.
[0211] In some embodiments, the attributes of the first handwriting point in the at least one handwriting object include the coordinates of the first handwriting point and a handwriting object identifier, where the handwriting object identifier is used to identify the handwriting object to which the first handwriting point belongs.
[0212] In some embodiments, the model is in the form of a dictionary.
[0213] In some embodiments, the handwriting object identifier is a hash value.
[0214] In some embodiments, the model is used to convert the data format of the second handwriting data.
[0215] In some embodiments, the first handwriting data includes a third handwriting set, the third handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more continuous handwriting points, and the processing unit 310 is specifically used to: synchronize the coordinates of each handwriting point in the one or more handwriting points corresponding to each handwriting object in the at least one handwriting object to the second ink canvas control.
[0216] In some embodiments, the first application is a handwriting program that supports the user to draw handwriting by at least one of a mouse, a stylus, a finger, and the like.
[0217] In some embodiments, the electronic device is equipped with a Windows operating system.
[0218] In summary, processing unit 310 is primarily used to execute steps in the method embodiment, such as detecting user operations, modifying the transparency and visibility properties of the first ink canvas control, and synchronizing handwriting data. Display unit 320 is primarily used to execute display-related steps in the method embodiment, such as displaying windows, displaying application interfaces, and displaying controls.
[0219] FIG9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. The electronic device 400 shown in FIG9 may be a specific example of the electronic device 100 in FIG1 .
[0220] The electronic device 400 shown in FIG9 includes a memory 410, a processor 420, and a bus 430. The memory 410 and the processor 420 are communicatively connected to each other via the bus 430.
[0221] The memory 410 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 410 may store programs. When the program stored in the memory 410 is executed by the processor 420, the processor 420 is used to perform the various steps of the control display method of the embodiment of the present application.
[0222] The processor 420 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to execute the control display method of the embodiment of the present application.
[0223] The processor 420 may also be an integrated circuit chip with signal processing capabilities. During implementation, the various steps of the control display method of the present application may be completed by hardware integrated logic circuits or software instructions in the processor 420. The processor 420 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 410. The processor 420 reads the information in the memory 410 and, in conjunction with its hardware, executes the control display method of the embodiments of the present application.
[0224] In some embodiments, the electronic device 400 further includes a communication interface 440. The communication interface 440 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the electronic device 400 and other devices or a communication network.
[0225] The bus 430 may include a path for transmitting information between various components of the electronic device 400 (eg, the memory 410 , the processor 420 , and the communication interface 440 ).
[0226] An embodiment of the present application also provides an electronic device, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions, which, when executed by the one or more processors, enable the electronic device to perform the various steps or specific embodiments of the method shown in Figures 2 to 7.
[0227] An embodiment of the present application also provides a readable storage medium including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each step or specific embodiment of the method shown in Figures 2 to 7.
[0228] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0229] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0230] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0231] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0232] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0233] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0234] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A control display method, characterized in that: Applied to an electronic device, the electronic device includes a first application developed based on a window presentation foundation WPF, the first application includes a first ink canvas control and a second ink canvas control, the first ink canvas control belongs to a universal window platform UWP control, and the second ink canvas control belongs to a window presentation foundation WPF control, the method includes: When it is detected that the user performs a handwriting drawing operation in the first application, displaying the first ink canvas control in the user interface of the first application; When it is detected that the user performs an operation of erasing or lassoing handwriting in the first application, the second ink canvas control is displayed in the user interface of the first application.
2. The method according to claim 1, characterized in that The first ink canvas control is arranged in the first application through a host container.
3. The method according to claim 2, characterized in that The host container is used to use UWP controls in applications developed based on WPF.
4. The method according to any one of claims 1 to 3, characterized in that When the first ink canvas control is displayed in the user interface of the first application, the visibility attribute of the first ink canvas control is visible, and the first ink canvas control is covered on the second ink canvas control; When the second ink canvas control is displayed in the user interface of the first application, the visibility property of the first ink canvas control is collapsed, and the first ink canvas control does not block the display of the second ink canvas control.
5. The method according to any one of claims 1 to 4, characterized in that When the first ink canvas control is displayed in the user interface of the first application, the transparency property of the first ink canvas control is opaque, and the first ink canvas control covers the second ink canvas control; When the second ink canvas control is displayed on the user interface of the first application, the transparency property of the first ink canvas control is transparent, and the first ink canvas control does not block the display of the second ink canvas control.
6. The method according to claim 5, characterized in that When the transparency attribute of the first ink canvas control is opaque, the transparency attribute value of the first ink canvas control is 1; When the transparency attribute of the first ink canvas control is transparent, the transparency attribute value of the first ink canvas control is 0.
7. The method according to any one of claims 4 to 6, characterized in that The method further comprises: In the process of switching the user interface of the first application from displaying the first ink canvas control to displaying the second ink canvas control, firstly setting the transparency of the first ink canvas control to gradually change from opaque to transparent, and then changing the visibility property of the first ink canvas control from visible to collapsed; In the process of switching the user interface of the first application from displaying the second ink canvas control to displaying the first ink canvas control, the visibility property of the first ink canvas control is first modified from collapsed to visible, and then the transparency of the first ink canvas control is set to gradually change from transparent to opaque.
8. The method according to claim 7, characterized in that When the transparency of the first ink canvas control gradually changes from opaque to transparent or when the transparency of the first ink canvas control gradually changes from transparent to opaque, the transparency property value of the first ink canvas control changes linearly.
9. The method according to claim 7 or 8, characterized in that: The transparency gradient time of the first ink canvas control is less than or equal to 0.2 seconds.
10. The method according to any one of claims 5 to 9, characterized in that The first ink canvas control is arranged in the first application through a host container, and the transparency property of the first ink canvas control is set by setting the transparency property of the host container.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: The handwriting data of the first ink canvas control is synchronized with the handwriting data of the second ink canvas control.
12. The method according to claim 11, characterized in that The step of synchronizing the handwriting data of the first ink canvas control with the handwriting data of the second ink canvas control includes: The user interface of the first application is switched from displaying the first ink canvas control to displaying the second ink canvas control. During the process, the first handwriting data corresponding to the first ink canvas control is synchronized to the second ink canvas control; In the process of switching the user interface of the first application from displaying the second ink canvas control to displaying the first ink canvas control, the second handwriting data corresponding to the second ink canvas control is synchronized to the first ink canvas control.
13. The method according to claim 12, characterized in that The second handwriting data includes a first handwriting set, the first handwriting set includes at least one handwriting point, and synchronizing the second handwriting data corresponding to the second ink canvas control to the first ink canvas control includes: Converting the first handwriting set into a second handwriting set, wherein the second handwriting set includes at least one handwriting object, and each handwriting object in the at least one handwriting object includes one or more continuous handwriting points in the at least one handwriting point; The second handwriting set is synchronized to the first ink canvas control.
14. The method according to claim 13, characterized in that The converting the first handwriting set into a second handwriting set comprises: Read the coordinates of each handwriting point in the at least one handwriting point from the first handwriting set by using a predefined model; Based on the model, dividing the at least one handwriting point into the at least one handwriting object according to the coordinates of each handwriting point in the at least one handwriting point; The at least one handwriting object is combined to form the second handwriting set.
15. The method according to claim 14, characterized in that The attributes of the first handwriting point in the at least one handwriting object include the coordinates of the first handwriting point and a handwriting object identifier, and the handwriting object identifier is used to identify the handwriting object to which the first handwriting point belongs.
16. The method according to claim 14 or 15, characterized in that The model is in dictionary form.
17. The method according to any one of claims 14 to 16, characterized in that The handwriting object identifier is a hash value.
18. The method according to any one of claims 14 to 17, characterized in that The model is used to convert the data format of the second handwriting data.
19. The method according to any one of claims 14 to 18, characterized in that The first handwriting data includes a third handwriting set, the third handwriting set includes at least one handwriting object, each handwriting object in the at least one handwriting object includes one or more continuous handwriting points, and synchronizing the first handwriting data corresponding to the first ink canvas control to the second ink canvas control includes: The coordinates of each of the one or more handwriting points corresponding to each handwriting object in the at least one handwriting object are synchronized to the second ink canvas control.
20. The method according to any one of claims 1 to 19, characterized in that The first application is a handwriting program, which supports the user to draw handwriting by at least one of a mouse, a stylus, a finger, etc.
21. The method according to any one of claims 1 to 20, characterized in that The electronic device is equipped with a Windows operating system.
22. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the electronic device performs the method as described in any one of claims 1 to 21.
23. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 21.
24. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 21.
Citation Information
Patent Citations
Handwriting display processing method, device, system and equipment and storage medium
CN114237482A
Handwriting synchronization method and device and teaching system
CN114461160A
Word processing method and device, electronic equipment and storage medium
CN115469765A
Handwriting erasing method and device, storage medium and electronic equipment
CN115705141A
