Method, device, equipment, and readable storage medium for implementing brush toolbar
By dividing the toolbar into multiple functional areas in the iOS Handwriting Brush App, and using gesture recognizers for interactive settings, the dynamic adjustment and attribute synchronization of the toolbar are achieved, solving the problem of inconvenient fixing or switching of the toolbar, and improving Improves the convenience and efficiency of user operations.
Patent Information
- Application Number
- CN202410713156.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-04
AI Technical Summary
In the iOS Handwriting Brush App, it is inconvenient to fix or switch the toolbar, which makes the interaction inconvenient and affects the operation efficiency.
Divide the brush toolbar into multiple functional areas horizontally, set up interactions based on gesture recognizers, achieve synchronization and color synchronization of brush status and attribute selectors, and dynamically adjust the position and size of the toolbar.
The function of quickly switching brushes, handwriting colors and thicknesses is realized. The toolbar can be expanded on the screen during use, without taking up canvas space, improving user experience.
Smart Images

Figure CN118295576B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of program development, and in particular to a method, device, equipment, and readable storage medium for implementing a brush toolbar. Background Art
[0002] In the current iOS handwriting brush app, writing on the canvas is smooth and the writing elements are gradually enriched. However, there are still problems in its actual use: the toolbar is either fixed in one position to occupy the canvas space, or it is inconvenient to switch the brush to select color and adjust the thickness.
[0003] This can easily lead to unreasonable partitioning of the toolbar and inconvenient interaction between users and the toolbar, which affects the efficiency of operating tools in the Sketchpad APP. Summary of the invention
[0004] The present disclosure is completed to solve the above-mentioned problems, and its purpose is to provide a method, device, equipment, and readable storage medium for implementing a brush toolbar that can quickly switch brushes, handwriting colors, and handwriting thicknesses, and can be expanded when in use and minimized to a corner of the screen when not in use, thereby improving the user experience.
[0005] The present disclosure provides this summary of the invention to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. This summary of the invention is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to be used to limit the scope of the technical solution claimed for protection.
[0006] In order to solve the above technical problems, the present disclosure provides a method for implementing a brush toolbar, including:
[0007] Divide the brush toolbar into multiple functional areas horizontally, and set corresponding operation functions for each functional area;
[0008] Based on the gesture recognizer, setting the gesture interaction corresponding to the brush toolbar when the state is adjusted;
[0009] Setting the state and composition of each brush in the brush toolbar, and associating an attribute selector with the brush;
[0010] Synchronize the brush and the attribute selector with the color selected in the functional area.
[0011] In order to solve the above technical problems, the present disclosure also provides a device for implementing a brush toolbar, including:
[0012] The area division module is used to divide the brush toolbar into multiple functional areas horizontally and set corresponding operation functions for each functional area;
[0013] An interaction setting module, based on a gesture recognizer, sets the gesture interaction corresponding to the brush toolbar when the state is adjusted;
[0014] A brush setting module, which sets the state and composition of each brush in the brush toolbar and associates an attribute selector with the brush;
[0015] A color synchronization module synchronizes the brush and the attribute selector with the color selected in the function area.
[0016] In order to solve the above technical problems, the embodiments of the present disclosure further provide a computer device, which adopts the technical solution described below, including: a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any of the preceding items is implemented.
[0017] In order to solve the above technical problems, the embodiment of the present disclosure also provides a computer-readable storage medium, which adopts the technical solution described below, including: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the method described in any of the previous items.
[0018] According to the technical solution disclosed in the present invention, compared with the prior art, it is possible to quickly switch the brush, handwriting color, and handwriting thickness, and it can be expanded when in use and minimized to the corner of the screen when not in use, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a schematic diagram of an embodiment of a system architecture according to the present disclosure;
[0020] Figure 2 is a flow chart of an embodiment of a method for implementing a brush toolbar according to the present disclosure;
[0021] Figure 3 is a schematic diagram of a brush toolbar and an attribute selector according to an embodiment of a method for implementing a brush toolbar of the present disclosure;
[0022] Figure 4 is a schematic diagram of a brush toolbar and an eraser according to an embodiment of a method for implementing a brush toolbar of the present disclosure;
[0023] Figure 5 is a schematic diagram of a brush toolbar in a minimized state according to an embodiment of a method for implementing a brush toolbar of the present disclosure;
[0024] Figure 6 is a schematic diagram of a brush toolbar in a collapsed state according to an embodiment of a method for implementing a brush toolbar of the present disclosure;
[0025] Figure 7 is a schematic diagram of an embodiment of a device for implementing a brush toolbar according to the present disclosure;
[0026] Figure 8 is a schematic diagram of one embodiment of a computer device according to the present disclosure.
[0027] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale. DETAILED DESCRIPTION
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure; the terms "including" and "having" and any variations thereof in the specification and claims of the present disclosure and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present disclosure or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0029] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present disclosure. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0030] In order to enable those skilled in the art to better understand the solution of the present disclosure, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0031] [System Structure]
[0032] First, the structure of a system according to an embodiment of the present disclosure is described. Figure 1 As shown, the system structure 100 may include terminal devices 101, 102, 103, 104, a network 105 and a server 106. The network 105 is used to provide a medium for communication links between the terminal devices 101, 102, 103, 104 and the server 106.
[0033] In this embodiment, the electronic device (eg, Figure 1 The terminal devices 101, 102, 103 or 104 shown in the figure can transmit various information through the network 105. The network 105 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc. It should be noted that the above-mentioned wireless connection methods can include but are not limited to 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB connections, local area networks ("LAN"), wide area networks ("WAN"), Internet (e.g., the Internet) and peer-to-peer networks (e.g., ad hoc peer-to-peer networks) and other network connection methods currently known or developed in the future. The network 105 can communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and can be interconnected with digital data communications (e.g., communication networks) of any form or medium.
[0034] The user can use the terminal devices 101, 102, 103, 104 to interact with the server 106 through the network 105 to receive or send messages, etc. Various client applications can be installed on the terminal devices 101, 102, 103 or 104, such as video live broadcast and playback applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0035] Terminal devices 101, 102, 103 or 104 can be various electronic devices with touch screens and / or support for web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Compressed Standard Audio Layer 3) players, MP4 (Moving Picture Experts Compressed Standard Audio Layer 4) players, head-mounted display devices, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as mobile terminals such as digital TVs, desktop computers, etc.
[0036] The server 106 may be a server that provides various services, such as a background server that provides support for pages displayed on the terminal device 101 , 102 , 103 or 104 or data transmitted.
[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0038] Here, the terminal device can independently or in cooperation with other electronic terminal devices run various operating systems such as applications in the Android system to implement the embodiment method of the present disclosure, and can also run applications in other operating systems to implement the embodiment method of the present disclosure.
[0039] [How to implement the brush toolbar]
[0040] refer to Figure 2 , shows a flow chart of an embodiment of a method for implementing a brush toolbar according to the present disclosure. The method for implementing a brush toolbar includes:
[0041] S21, dividing the brush toolbar into a plurality of functional areas in a horizontal direction, and setting a corresponding operation function for each functional area.
[0042] In one or more embodiments, the multiple functional areas are, from left to right, a first area, a second area, and a third area. Each functional area includes one or more functions, which are displayed using corresponding charts.
[0043] like Figure 3 and Figure 4 As shown, the first area includes: quick operations corresponding to the Undo and Redo function areas, which are indicated by left and right arrows as icons respectively.
[0044] The second area includes: all types of brushes and erasers. Brushes can be used as Figure 4 There are 3 settings shown, and the eraser on the far right of the second area can also be used as a special brush. At this time, there are 4 brushes in total. Of course, other numbers of brushes can also be set. The rendering effect and pattern effect brought by each brush when painting may be different.
[0045] The third area includes: a color selection area, in which a variety of basic colors and a color selector are pre-set. As shown in the figure, five default colors of black, blue, green, yellow and red can be set, and a color selector can be set. After the user clicks it, he can select the desired color through RGB color matching.
[0046] In one or more embodiments, the preset product is used as a reference and the width and height of the brush toolbar are obtained by scaling according to the screen ratio. The drawing board APP in this application is mainly used on the iOS side, so the preset product is a smart product that uses the iOS operating system as its own operating system. For example, it can be a smart phone, a smart tablet or other device.
[0047] In one or more embodiments, for example, the brush toolbar is a dynamic toolbar that can automatically adjust the position, size, functional area layout, etc. according to the user's usage habits and current tasks. For example, by creating a custom toolbar component, dynamically expand or collapse according to the user's interaction or by using SwiftUI's views and gestures to build a responsive user interface to dynamically adjust the position and size of the toolbar according to the user's drawing behavior. For example, when the user is drawing, the toolbar can be automatically minimized to avoid blocking the drawing area, and the state and binding of SwiftUI are used to manage the state of the toolbar and the user's selection.
[0048] In one or more embodiments, for example, a machine learning algorithm is used to predict the tools that a user may need, and display them on the brush toolbar in advance. For example, first, data on the user's interaction with the toolbar is collected, including the selected tool, frequency of use, usage time, etc., and useful features are extracted from the collected data, which may include timestamps, tool usage order, usage duration, etc.; then, a suitable machine learning model is selected to process these features, and the collected data is used to train the model, and the accuracy of the model is verified by methods such as cross-validation; then, the trained model is integrated into the iOS App, such as using the Core ML framework to deploy the model; finally, when the user uses the App, the model will predict and recommend tools in real time based on the user's behavior, and continuously optimize the model based on user feedback.
[0049] S22, based on the gesture recognizer, setting the gesture interaction corresponding to the brush toolbar when the state is adjusted. The state here may include: expanded state, collapsed state, and minimized state.
[0050] In one or more embodiments, based on a gesture recognizer, the drag action is determined, and the drag distance is obtained in real time. The gesture recognizer may be a UIPanGestureRecognizer, where the drag distance is set to d.
[0051] When the dragging distance d is greater than the state switching distance threshold (here the state switching distance threshold is set to t), that is, when d>t, the first animation effect is executed. In the first animation effect, the brush toolbar is collapsed with the currently selected brush as the center until the dragging action ends, and the brush toolbar is minimized to one side of the lower end of the screen, and the size is a preset ratio of the original size. For example, Figure 5 As shown in the figure, after minimizing, the brush toolbar is displayed as a brush icon and scaled to the lower left corner of the screen. The preset ratio here can be 80%.
[0052] When the brush toolbar is minimized, the user's gesture continues to be recognized. When the drag distance d is less than or equal to the state switching distance threshold t, the second animation effect is executed, and the brush toolbar is expanded with the currently selected brush as the center. When the dragging action ends, the brush toolbar is returned to the center of the lower end of the screen. At this time, the brush toolbar is restored from the minimized state to the state as shown in the figure. Figure 3 and Figure 4 The expanded state is shown and is located at the lower center of the screen.
[0053] In one or more embodiments, the duration of the first animation effect and the second animation effect is 0.7s, and the animation damping coefficient is 0.85, thereby bringing a better visual experience to the user.
[0054] Add UILongPressGestureRecognizer gesture recognizer and set the minimum press duration to 0.1s, so that when the brush toolbar is minimized and pressed, it can be restored to the collapsed state. Figure 5 and Figure 6 As shown, Figure 5 To minimize the state, Figure 6 It is the collapsed state. Compared with the minimized state, the icon is larger in the collapsed state.
[0055] Add the UITapGestureRecognizer single-click gesture recognizer to restore the brush toolbar to its collapsed size when it is minimized.
[0056] In one or more embodiments, an adaptive UI is used to dynamically adjust the layout and content of the toolbar according to the user's usage habits and preferences. For example, the content that the user is drawing is identified and related tool options are provided. If the user is drawing a straight line, the toolbar will automatically display the straight line tool and related options. For example, sensor data (such as accelerometers and gyroscopes) are used to detect the position of the device and the user's movements, thereby inferring the tools that the user may need. If the user often uses a specific brush or color at a certain time or place, the system can automatically provide these options. If the user frequently switches to a certain tool or color, the system can display it as a shortcut option.
[0057] S23, setting the state and composition of each brush in the brush toolbar, and associating an attribute selector with the brush.
[0058] In one or more embodiments, the state of the brush includes: an unselected state and a selected state. In the selected state, it means that the user is using the brush, and in the unselected state, it means that the brush is not being used.
[0059] The components of a brush include: pen body, pen tip, color and thickness indicator, and transparency label.
[0060] When clicking on a brush, if the brush is not selected, the third animation effect is executed to move the brush upward by a preset distance, and at the same time, for the currently selected brush, the third animation effect is executed to move the brush downward by a preset distance. That is, when selecting a new brush, the previously selected brush is moved downward, and the newly selected brush is moved upward to make it higher than other brushes to highlight the brush.
[0061] Among them, the duration of the third animation is 0.5s, and the animation damping coefficient is 0.6.
[0062] When you click a brush, if the brush is selected, the associated attribute selector pops up above the brush.
[0063] like Figure 3 As shown, you can change the transparency and thickness of the brush strokes through the attribute selector. You can change the thickness of the brush by clicking the upper button in the attribute selector, and change the transparency of the brush strokes by dragging the lower button.
[0064] Among them, when the transparency of the handwriting changes, the transparency label of the brush shows the latest value. When the thickness changes, the height of the brush color indicator is adjusted accordingly, so as to show the changes more vividly.
[0065] S24, synchronizing the brush and the attribute selector with the color selected in the function area.
[0066] When the desired color is selected through the color selection area in the function area, if this color has changed from the previous color, the color of the pen tip, color indicator, and attribute selector are synchronized with the selected desired color.
[0067] At this point, create an Ink structure containing a color attribute, and assign one to each brush and attribute selector. When the color of one of the brush and attribute selector changes, update the color attribute of the other Ink structure to achieve color synchronization.
[0068] When switching brushes, synchronize the current color of the selected brush to the color selection area.
[0069] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0070] [Implementation of the brush toolbar]
[0071] In order to implement the technical solution in the embodiment of the present disclosure, an embodiment of the present disclosure provides a device for implementing a brush toolbar, such as Figure 7 As shown, it includes, for example, a region division module 701 , an interaction setting module 702 , a brush setting module 703 , and a color synchronization module 704 .
[0072] The area division module 701 is used to divide the brush toolbar into multiple functional areas horizontally and set corresponding operation functions for each functional area. Here, the area division module 701 can, for example, implement the corresponding functions or technical solutions in the above step S21 or other steps, which will not be repeated here.
[0073] The interaction setting module 702 sets the gesture interaction corresponding to the state adjustment of the brush toolbar based on the gesture recognizer. Here, the interaction setting module 702 can, for example, implement the corresponding functions or technical solutions in the above step S22 or other steps, which will not be repeated here.
[0074] The brush setting module 703 sets the state and composition of each brush in the brush toolbar and associates an attribute selector with the brush. Here, the brush setting module 703 can, for example, implement the corresponding functions or technical solutions in the above step S23 or other steps, which will not be described in detail here.
[0075] The color synchronization module 704 synchronizes the brush and the attribute selector with the color selected in the function area. Here, the color synchronization module 704 can, for example, implement the unlocking function in the above method or the corresponding functions or technical solutions in other steps, which will not be described in detail here.
[0076] It should be understood that, although each box in the block diagram of the accompanying drawings may represent a module, a part of which contains one or more executable instructions for implementing a specified logical function, these modules are not necessarily executed in sequence. The modules and functional units in the device embodiments disclosed herein may be integrated into a processing module, or each unit may exist physically separately, or two or more modules or functional units may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0077] [Computer equipment]
[0078] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. The computer device in the embodiment of the present disclosure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present disclosure.
[0079] like Figure 8 As shown, the electronic device 800 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 801 for controlling the overall operation of the electronic device. The processing device may include one or more processors to execute instructions to complete all or part of the steps of the above method. In addition, the processing device 801 may also include one or more modules for processing and interacting with other devices.
[0080] The storage device 802 is used to store various types of data. The storage device 802 may include various types of computer-readable storage media or combinations thereof, such as electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, device, or component.
[0081] The sensor device 803 is used to sense the specified measured information and convert it into a usable output signal according to a certain rule, and may include one or more sensors. For example, it may include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor, etc., for detecting changes in the opening / closing state, relative positioning, acceleration / deceleration, temperature, humidity and light of the electronic device.
[0082] The processing device 801 , the storage device 802 , and the sensor device 803 are connected to each other via a bus 804 . An input / output (I / O) interface 805 is also connected to the bus 804 .
[0083] The multimedia device 806 may include input devices such as a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, etc. for receiving input signals from a user. The various input devices may cooperate with the various sensors of the above-mentioned sensor device 803 to complete, for example, gesture operation input, image recognition input, distance detection input, etc. The multimedia device 806 may also include output devices such as a liquid crystal display (LCD), a speaker, a vibrator, etc.
[0084] The power supply device 807 is used to provide power to various devices in the electronic device, and may include a power management system, one or more power supplies, and components for distributing power to other devices.
[0085] The communication device 808 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data.
[0086] The above-mentioned devices can also be connected to the I / O interface 805 to implement the application of the electronic device 800.
[0087] Although the electronic device with various devices is shown in the figure, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0088] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0089] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0090] It should be noted that the above-mentioned computer-readable medium of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. In the present disclosure, the computer-readable signal medium may include a data signal propagated in the baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in combination with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0091] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0092] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0095] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0096] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, including:
[0097] Divide the brush toolbar into multiple functional areas horizontally, and set corresponding operation functions for each functional area;
[0098] Based on the gesture recognizer, setting the gesture interaction corresponding to the brush toolbar when the state is adjusted;
[0099] Setting the state and composition of each brush in the brush toolbar, and associating an attribute selector with the brush;
[0100] Synchronize the brush and the attribute selector with the color selected in the functional area.
[0101] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0102] The multiple functional areas are, from left to right, a first area, a second area, and a third area;
[0103] The first area includes: quick operations corresponding to the undo and redo function areas;
[0104] The second area includes: all types of brushes and erasers;
[0105] The third area includes: a color selection area, in which a plurality of basic colors and a color selector are pre-set.
[0106] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution and further includes:
[0107] Based on the preset product, the width and height of the brush toolbar are obtained by scaling according to the screen ratio;
[0108] Among them, the preset product is a smart product that uses the iOS operating system as its own operating system.
[0109] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0110] Based on the gesture recognizer, determine the drag action and obtain the drag distance in real time;
[0111] When the dragging distance is greater than the state switching distance threshold, a first animation effect is executed, the brush toolbar is collapsed with the currently selected brush as the center, and when the dragging action is finished, the brush toolbar is minimized to one side of the lower end of the screen, and the size is a preset ratio of the original size;
[0112] When the dragging distance is less than or equal to the state switching distance threshold, the second animation effect is executed, and the brush toolbar is expanded with the currently selected brush as the center until the dragging action ends, and the brush toolbar is returned to the center of the lower end of the screen.
[0113] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0114] The duration of the first animation effect and the second animation effect is 0.7s, and the animation damping coefficient is 0.85;
[0115] Add UILongPressGestureRecognizer gesture recognizer and set the minimum press duration to 0.1s, so that when the brush toolbar is pressed in the minimized state, it can be restored to the collapsed state size;
[0116] Add the UITapGestureRecognizer single-click gesture recognizer to restore the brush toolbar to its collapsed size when it is minimized.
[0117] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0118] The states of the brush include: unselected state and selected state;
[0119] The brush comprises: a pen body, a pen tip, a color and thickness indicator, and a transparency label;
[0120] When the brush is clicked, if the brush is in the unselected state, a third animation effect is executed to move the brush upward by a preset distance, and at the same time, for the brush currently in the selected state, a third animation effect is executed to move the brush downward by a preset distance;
[0121] The duration of the third animation is 0.5s, and the animation damping coefficient is 0.6;
[0122] When the brush is clicked, if the brush is in the selected state, a related attribute selector pops up above the brush;
[0123] By using the attribute selector, the transparency and thickness of the brush strokes are changed;
[0124] When the pen transparency changes, the transparency label of the brush displays the latest value, and when the thickness changes, the height of the color indicator of the brush is adjusted accordingly.
[0125] According to one or more embodiments of the present disclosure, a method for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0126] Select a desired color through the color selection area in the function area;
[0127] Synchronize the colors of the pen tip, the color indicator, and the attribute selector with the color required for the selection;
[0128] Create an Ink structure containing a color attribute, and assign one to each of the brush and the attribute selector;
[0129] When the color of one of the brush and the attribute selector changes, the color attribute of the other Ink structure is updated to achieve color synchronization;
[0130] When the brush is switched, the current color of the selected brush is synchronized to the color selection area.
[0131] According to one or more embodiments of the present disclosure, a device for implementing a brush toolbar is provided, which adopts the following technical solution, including:
[0132] The area division module is used to divide the brush toolbar into multiple functional areas horizontally and set corresponding operation functions for each functional area;
[0133] An interaction setting module, based on a gesture recognizer, sets the gesture interaction corresponding to the brush toolbar when the state is adjusted;
[0134] A brush setting module, which sets the state and composition of each brush in the brush toolbar and associates an attribute selector with the brush;
[0135] A color synchronization module synchronizes the brush and the attribute selector with the color selected in the function area.
[0136] According to one or more embodiments of the present disclosure, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any of the preceding items is implemented.
[0137] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any of the preceding items is implemented.
[0138] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0139] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0140] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for implementing a brush toolbar, characterized in that: include: Divide the brush toolbar into multiple functional areas horizontally, and set corresponding operation functions for each functional area; Based on the gesture recognizer, setting the gesture interaction corresponding to the brush toolbar when the state is adjusted; Setting the state and composition of each brush in the brush toolbar, and associating an attribute selector with the brush; Synchronize the brush and the attribute selector with the color selected in the functional area; The states of the brush include: unselected state and selected state; The brush comprises: a pen body, a pen tip, a color and thickness indicator, and a transparency label; When the brush is clicked, if the brush is in the unselected state, a third animation effect is executed to move the brush upward by a preset distance, and at the same time, for the brush currently in the selected state, a third animation effect is executed to move the brush downward by a preset distance; When the brush is clicked, if the brush is in the selected state, a related attribute selector pops up above the brush; By using the attribute selector, the transparency and thickness of the brush strokes are changed; Wherein, when the transparency of the handwriting changes, the transparency label of the brush displays the latest value, and when the thickness changes, the height of the color indicator of the brush is adjusted accordingly; The method for implementing the brush toolbar further includes: Select a desired color through the color selection area in the function area; Synchronize the colors of the pen tip, the color indicator, and the attribute selector with the color required for the selection; Create an Ink structure containing a color attribute, and assign one to each of the brush and the attribute selector; When the color of one of the brush and the attribute selector changes, the color attribute of the other Ink structure is updated to achieve color synchronization; When the brush is switched, the current color of the selected brush is synchronized to the color selection area.
2. The method for implementing the brush toolbar according to claim 1, characterized in that: The multiple functional areas are, from left to right, a first area, a second area, and a third area; The first area includes: quick operations corresponding to the undo and redo function areas; The second area includes: all types of brushes and erasers; The third area includes: a color selection area, in which a plurality of basic colors and a color selector are pre-set.
3. The method for implementing the brush toolbar according to claim 1, characterized in that: Also includes: Based on the preset product, the width and height of the brush toolbar are obtained by scaling according to the screen ratio; Among them, the preset product is a smart product that uses the iOS operating system as its own operating system.
4. The method for implementing the brush toolbar according to claim 1, characterized in that: Also includes: Based on the gesture recognizer, determine the drag action and obtain the drag distance in real time; When the dragging distance is greater than the state switching distance threshold, a first animation effect is executed, the brush toolbar is collapsed with the currently selected brush as the center, and when the dragging action is finished, the brush toolbar is minimized to one side of the lower end of the screen, and the size is a preset ratio of the original size; When the dragging distance is less than or equal to the state switching distance threshold, the second animation effect is executed, and the brush toolbar is expanded with the currently selected brush as the center until the dragging action ends, and the brush toolbar is returned to the center of the lower end of the screen.
5. The method for implementing the brush toolbar as claimed in claim 4, characterized in that: Also includes: The duration of the first animation effect and the second animation effect is 0.7s, and the animation damping coefficient is 0.85; Add UILongPressGestureRecognizer gesture recognizer and set the minimum press duration to 0.1s, so that when the brush toolbar is pressed in the minimized state, it can be restored to the collapsed state size; Add the UITapGestureRecognizer single-click gesture recognizer to restore the brush toolbar to its collapsed size when it is minimized.
6. The method for implementing the brush toolbar according to claim 1, characterized in that: Also includes: The duration of the third animation is 0.5 s, and the animation damping coefficient is 0.
6.
7. A device for implementing a brush toolbar, characterized in that: For implementing the method according to any one of claims 1 to 6, the implementation device of the brush toolbar comprises: The area division module is used to divide the brush toolbar into multiple functional areas horizontally and set corresponding operation functions for each functional area; An interaction setting module, based on a gesture recognizer, sets the gesture interaction corresponding to the brush toolbar when the state is adjusted; A brush setting module, which sets the state and composition of each brush in the brush toolbar and associates an attribute selector with the brush; A color synchronization module synchronizes the brush and the attribute selector with the color selected in the function area.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
