Drawing method and device based on touch panel pressure detection, medium and equipment
By introducing a drawing method based on touch panel pressure detection in the graphic editing technology, dynamically adjusting the display resolution and drawing coordinate system, the problem of insufficient operational intuitiveness and flexibility in the existing technology is solved, and more accurate and flexible drawing is achieved Experience.
Patent Information
- Application Number
- CN202510010539.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing graphic editing technology has limitations in operational intuitiveness and flexibility. Users need to edit graphics through complex menus or shortcut keys, and the adjustment of colors and lines lacks intuitiveness and flexibility.
Using a drawing method based on touch panel pressure detection, by determining the touch distance between the touch starting point and the touch panel pressure sensor, calculating the resolution ratio of the touch panel and the display screen, dynamically adjusting the display resolution and the display ratio of the drawing coordinate system, and according to Touch the pressure to adjust the line thickness and color of the drawing pen.
Improve the accuracy and flexibility of drawing, and users can make fine adjustments through intuitive touch operations to achieve richer drawing expression and higher creative efficiency.
Smart Images

Figure CN119399328A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computer graphics editing, and in particular to a drawing method, device, medium and equipment based on touch panel pressure detection. Background Art
[0002] In the field of computer graphics editing, traditional graphics editing methods are mainly completed through input devices such as keyboards and mice. Although these methods meet the basic needs of graphics editing to a certain extent, they are still limited in terms of intuitiveness and flexibility. With the continuous development of touch technology and pressure sensing technology, integrating these advanced technologies into graphics editing tools to achieve a more natural and intuitive editing experience has become an important direction of current technological development.
[0003] In existing graphic editing technologies, users usually need to first determine the graphic items to be edited, such as colors and lines, through menus, toolbars, or shortcut keys. However, this selection method often relies on the user's visual attention and memory, which is not only cumbersome to operate, but also prone to errors. In addition, in the traditional graphic editing process, users can usually only adjust colors and lines by entering specific values or using preset styles, which lacks intuitiveness and flexibility. Summary of the invention
[0004] The purpose of the present invention is to provide a drawing method, device, medium and equipment based on touch panel pressure detection, aiming to solve the technical problem of low intuitiveness and flexibility of drawing in related scenarios.
[0005] In order to achieve the above-mentioned purpose, a first aspect of an embodiment of the present disclosure provides a drawing method based on touch panel pressure detection, the method comprising: In response to a touch drawing operation on the touch panel, determining a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determining a resolution ratio of the touch panel to a display screen according to the touch distance; According to the resolution ratio, a target display ratio of the drawing coordinate system in the display screen is determined from a preset display ratio, and according to the target display ratio, the display ratio of the drawing coordinate system on the display screen is adjusted with the position of the drawing brush on the display screen as the center, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; Determining drawing information of a drawing pen corresponding to the touch drawing operation according to the pressure of the touch drawing operation at the touch starting point, and controlling the drawing pen to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point according to the drawing information; In the process of the press-to-draw, in response to a new touch-to-draw operation on the touch panel, the drawing adjustment information is determined according to the press point information of the new touch-to-draw operation and whether the track press point in the press-to-draw trajectory is displaced after the new touch-to-draw operation is started and before the new touch-to-draw operation is ended; The drawing adjustment is performed according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, the drawing pen is continuously controlled to perform press drawing with the press movement trajectory as the drawing trajectory.
[0006] In a possible implementation, the determining of the drawing adjustment information according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the track of the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended includes: In the case where the track pressing point in the pressing movement track does not move, determining a first distance between an initial pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track, and determining a second distance between a current pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track; Determining a line thickness adjustment method for the line thickness in the drawing information according to a magnitude relationship between the first distance and the second distance, and determining a line thickness adjustment amount for the line thickness in the drawing information according to a first difference between the first distance and the second distance; The line thickness in the drawing information is adjusted according to the line thickness adjustment method and the line thickness adjustment amount.
[0007] In a possible implementation, determining a line adjustment method for the line thickness in the drawing information according to a magnitude relationship between the first distance and the second distance, and determining a line adjustment amount for the line thickness in the drawing information according to a first difference between the first distance and the second distance includes: In a case where the first distance is greater than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, to determine the line adjustment amount for reducing the thickness of the line in the drawing information; in a case where the first distance is less than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, to determine the line adjustment amount for increasing the thickness of the line in the drawing information, each of the thickness adjustment ranges corresponds to a thickness adjustment amount; or When the first distance is less than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for reducing the thickness of the line in the drawing information; when the first distance is greater than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for increasing the thickness of the line in the drawing information, and each of the thickness adjustment ranges corresponds to a thickness adjustment amount.
[0008] In a possible implementation, the determining of the drawing adjustment information according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the track of the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended includes: In the case where the track pressing point in the pressing movement track is displaced, determining the type of the movement track in which the track pressing point is displaced; If the type of the moving trajectory of the displacement of the track pressing point is a linear movement, a function of adjusting the display ratio of the drawing coordinate system on the display screen is started, and a third distance before the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined, and a fourth distance after the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined; Determine a fifth distance between the initial pressing point in the pressing point information of the newly added touch drawing operation and the current pressing point in the pressing point information of the newly added touch drawing operation; determining a proportional adjustment method for the display ratio according to a magnitude relationship between the third distance and the fourth distance, and determining a proportional adjustment amount for the display ratio according to the fifth distance; The display scale of the drawing coordinate system on the display screen is adjusted according to the scale adjustment method and the scale adjustment amount.
[0009] In a possible implementation manner, determining the proportional adjustment method for the display ratio according to the magnitude relationship between the third distance and the fourth distance, and determining the proportional adjustment amount for the display ratio according to the fifth distance include: When the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds to a proportional adjustment amount; or When the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds one to one to a proportional adjustment amount.
[0010] In a possible implementation, the method further includes: If the type of the moving trajectory of the displacement of the trajectory pressing point is non-linear movement, a function for adjusting the line color in the drawing information is started, and a drawing pen color selection window is displayed on the display screen in a pop-up window, and the drawing pen color selection window is used to display a color display panel; Hide the painting brush and display a selection cursor in the painting brush color selection window; Moving the selection cursor to point to a color in the color display panel according to the current pressing point in the pressing point information of the newly added touch drawing operation; In response to the newly added touch drawing operation, the touch is stopped, the line color of the painting pen is adjusted using the color pointed to by the selection cursor when it is stopped as the target color, and the painting pen color selection window is closed and the painting pen is redisplayed at the position where the painting pen is hidden.
[0011] In a possible implementation, the method further includes: In response to the track pressing point in the pressing movement track ceasing to touch, the touch panel is initialized to restore the target display ratio of the drawing coordinate system, the line thickness and the line color of the drawing pen to default settings.
[0012] According to a second aspect of the embodiments of the present disclosure, there is provided a drawing device based on touch panel pressure detection, comprising: a first determination module configured to determine, in response to a touch drawing operation on the touch panel, a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determine a resolution ratio of the touch panel to the display screen according to the touch distance; A second determination module is configured to determine a target display ratio of the drawing coordinate system in the display screen from a preset display ratio according to the resolution ratio, and adjust the display ratio of the drawing coordinate system on the display screen based on the target display ratio and with the position of the drawing brush on the display screen as the center, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; A third determining module is configured to determine drawing information of a drawing pen corresponding to the touch drawing operation according to the pressure of the touch drawing operation at the touch starting point, and control the drawing pen to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point according to the drawing information; a fourth determination module configured to, in response to a new touch drawing operation on the touch panel during the press drawing process, determine drawing adjustment information according to press point information of the new touch drawing operation and whether a track press point in the press movement track is displaced after starting the new touch drawing operation and before ending the new touch drawing operation; The fifth determining module is configured to perform drawing adjustment according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, continue to control the drawing pen to perform press drawing with the press movement trajectory as the drawing trajectory.
[0013] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0014] According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of any one of the methods in the first aspect.
[0015] The present invention provides a drawing method, device, medium and equipment based on touch panel pressure detection. Compared with the prior art, it has the following beneficial effects: By determining the touch distance between the touch starting point and the touch pad pressure sensor, and then determining the resolution ratio of the touch pad and the display, this technology can dynamically adjust the display resolution according to the user's specific operation position and strength, ensuring that the user's drawing operations on the touch pad can be accurately reflected on the display, reducing the error caused by resolution mismatch and improving the accuracy of drawing.
[0016] The mapping relationship between the resolution ratio and the preset display scale is used to automatically adjust the display scale of the drawing coordinate system on the display screen, and the adjustment is centered on the position of the drawing pen. This function allows the drawing area to be dynamically scaled according to the user's needs, making it easier for users to perform detailed or rough drawing operations under different accuracy requirements, thereby enhancing the flexibility and convenience of drawing.
[0017] By identifying the pressure of the touch drawing operation, the drawing information of the drawing pen is determined, and the drawing pen is controlled to draw with the pressing movement trajectory as the drawing trajectory. This technology allows users to change the thickness, depth and other characteristics of the drawing line by adjusting the pressure, achieving richer drawing expressions and improving the quality and expressiveness of the drawing.
[0018] During the press-draw process, if the user adds a touch-draw operation on the touchpad, the drawing adjustment information is determined in real time and adjusted accordingly based on the press point information of the new operation and the displacement of the press point in the press movement trajectory. This allows the user to correct errors or adjust the drawing direction at any time during the drawing process without interrupting the drawing process, ensuring the continuity and smoothness of the drawing.
[0019] In summary, the technical solution of this application provides users with a more accurate, flexible and efficient drawing experience by combining advanced technologies such as touch distance perception, adaptive display ratio adjustment, pressure-sensitive drawing and real-time drawing adjustment. Users can freely create in a more intuitive and convenient interactive environment without worrying about the impact of technical limitations on creative ideas and expression effects. It not only helps to improve the user's creative efficiency and work quality, improve the accuracy and flexibility of drawing, but also greatly improves the user's drawing efficiency and creativity through the functions of real-time adjustment and continuous drawing.
[0020] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 The present invention is a flow chart of a drawing method based on touch panel pressure detection according to an embodiment of the specification.
[0022] Figure 2 The invention is a block diagram of a drawing device based on touch panel pressure detection according to an embodiment of the specification.
[0023] Figure 3 It is a block diagram of another drawing device based on touch panel pressure detection according to an embodiment of the specification. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0026] The present invention provides a drawing method based on touch panel pressure detection. Figure 1 The flowchart of a drawing method based on touch panel pressure detection according to an embodiment is shown. The method comprises: In step S11, in response to a touch drawing operation on the touch panel, determining a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determining a resolution ratio of the touch panel to the display screen according to the touch distance; The touch start point is the position where the user first touches the touchpad. For example, the touchpad is touched by the index finger of one hand. The pressure sensor is a device that can sense and quantify the pressure changes on the touchpad. In the embodiment of the present disclosure, the touchpad may include: a circuit board, a pressure sensor, a bracket and a touch controller, wherein the circuit board and the pressure sensor are electrically connected to the touch controller respectively; The bracket is arranged below the circuit board, and includes a main body, and four first extensions extending from the four corners of the main body toward a direction away from the main body, a window is arranged in the middle area of the main body, a second extension connected to any window edge of the main body is arranged in the window, the end of each first extension and the end of the second extension are respectively adhered to the circuit board, and the second extension is provided with a unique pressure sensor near the edge connected to the window; A touch electrode layer is disposed on the upper surface of the circuit board, and the touch electrode layer is used to sense a touch sensing signal in response to an action of touching or pressing the touch panel, and output the touch sensing signal to the touch controller.
[0027] The resolution ratio is the proportional relationship between the physical resolution of the touch panel and the display screen, and is used to adjust the display accuracy of the drawing coordinate system on the display screen.
[0028] In the disclosed embodiment, when a user performs a drawing operation on the touchpad, the system will first record the position of the touch start point. At the same time, the physical distance between the touch start point and the sensor can be measured through the pressure sensor under the touchpad (this is usually calculated indirectly through mechanisms such as pressure distribution or capacitance change). This distance reflects the sensitivity and force distribution of the touch, which in turn affects the determination of the resolution ratio. The resolution ratio is calculated based on the inherent characteristics of the touchpad and the physical resolution of the display screen, and is used to ensure the accurate performance of the drawing operation on the display screen.
[0029] For example: Assuming that the touchpad is designed with high-precision pressure sensing, when the user touches the touchpad lightly, the system measures that the distance between the touch start point and the pressure sensor is short (indicating a light touch). Based on this information, combined with the resolution parameters of the touchpad and the display, a lower resolution ratio is calculated, which means that the drawing operation will be more delicate on the display. When the user touches the touchpad lightly, the system measures that the distance between the touch start point and the pressure sensor is far. Based on this information, combined with the resolution parameters of the touchpad and the display, a higher resolution ratio is calculated.
[0030] In step S12, according to the resolution ratio, a target display ratio of the drawing coordinate system in the display screen is determined from a preset display ratio, and according to the target display ratio, the display ratio of the drawing coordinate system on the display screen is adjusted with the position of the drawing pen on the display screen as the center, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; The display scale is the scale of the drawing coordinate system presented on the display screen. The drawing coordinate system is a reference frame used to define the positions of all points in the drawing operation. The mapping relationship is the correspondence between the resolution ratio and the display scale.
[0031] In the disclosed embodiment, based on the obtained resolution ratio, the system will search for the best display ratio corresponding to it from a preset set of display ratios. This mapping relationship ensures that the display ratio of the drawing coordinate system on the display screen is dynamically adjusted according to the actual touch situation of the touchpad to adapt to drawing requirements of different precisions. The adjusted drawing coordinate system is scaled with the current drawing pen position as the center to ensure the continuity and accuracy of the drawing operation.
[0032] For example, if the resolution ratio indicates that a higher display accuracy is required (for example, the resolution ratio is large), the system may choose a display ratio of 1:1, that is, the drawing coordinate system is displayed without scaling on the display. This setting is very useful if the user is doing fine drawing, such as drawing a small icon. On the contrary, if the resolution ratio is small, the system may choose a lower display ratio, such as 1:2, to expand the drawing area and make it easier for the user to overview the overall layout.
[0033] In step S13, drawing information of a drawing pen corresponding to the touch drawing operation is determined according to the pressure of the touch drawing operation at the touch starting point, and according to the drawing information, the drawing pen is controlled to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point; The drawing information may include the color, thickness, transparency and other properties of the drawing pen, as well as the pressure change information during drawing. The press movement trajectory is the trajectory formed when the user applies pressure and moves the finger through the touchpad. For example, when the user is performing touch drawing, the path of the finger or stylus moving on the touchpad includes the various pressing points on the path and their order. Press drawing is a drawing method that dynamically adjusts the drawing effect according to the touch pressure.
[0034] In the disclosed embodiment, after the touch start point is determined, the system continuously monitors the change of the touch position and dynamically adjusts the position of the drawing pen according to the position change information. This is usually achieved through the pressure value fed back by the pressure sensor in real time or the touch position fed back by the touch electrode layer in real time, so as to track the user's movement trajectory, combine the real-time drawing information, and draw a graphic corresponding to the touch pressure on the display screen.
[0035] For example, when a user presses the touchpad hard and moves his finger, as the user moves his finger along a specific path, a line of uniform thickness and color will be drawn on the display screen according to the change in pressure, simulating the drawing effect in real painting. This dynamic adjustment makes the drawing process more intuitive and expressive.
[0036] In step S14, during the press-to-draw process, in response to a new touch-to-draw operation on the touch panel, drawing adjustment information is determined according to the press point information of the new touch-to-draw operation and whether a track press point in the press movement track is displaced after the new touch-to-draw operation is started and before the new touch-to-draw operation is ended; The newly added touch drawing operation is a new, independent drawing action performed by the user on the touchpad, which is different from the previous drawing operation. The press point information refers to the position, pressure value and other information of the point captured by the system when the user touches or presses the touchpad. The track press point displacement determines whether the position of the last press point on the press movement track changes after the newly added touch drawing operation during the continuous touch drawing process.
[0037] In the disclosed embodiment, the newly added touch drawing operation initiated by the user on the touchpad is first monitored and responded to. This operation is usually accompanied by the first new contact between the user's finger or stylus and the touchpad, at which time the system will record the press point information of the contact point, including position, pressure, etc. Subsequently, while the user continues to perform the drawing operation (i.e., press and move the finger or stylus), the system will continuously track and record all the press point information on the press movement trajectory.
[0038] In the disclosed embodiment, the key is to determine whether the track pressing point in the pressing movement trajectory has shifted after the start of the newly added touch drawing operation and before the end. The displacement here refers to the change in position of the last pressing point on the pressing movement trajectory compared to the last pressing point on the pressing movement trajectory when the new touch drawing operation was added after the start of the newly added touch drawing operation and before the end. If the track pressing point has not shifted significantly (that is, it remains in almost the same position), it may mean that the user has only performed a new touch drawing operation in this process; and if the track pressing point has shifted significantly, it means that the user has not only added a new touch drawing operation, but also continued the operation of the pressing movement trajectory.
[0039] It can be explained that in the embodiment of the present application, the line thickness or line color of the painting pen will not change with the change of touch pressure, because the pressure applied by the user to the touchpad is definitely uneven, especially when the pressure is longer, the finger muscles will gradually be unable to accurately control the force. Therefore, compared with the prior art of changing the line thickness or line color of the painting pen by pressure, the present application adds a touch drawing operation, determines the drawing adjustment information according to the pressure point information of the newly added touch drawing operation and whether the track pressure point in the pressing movement trajectory is displaced after the start of the newly added touch drawing operation and before the end of the newly added touch drawing operation, so as to avoid uneven color or line thickness due to changes in touch pressure.
[0040] In step S15, drawing adjustment is performed according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, the drawing pen is continuously controlled to perform press drawing with the pressing movement trajectory as the drawing trajectory.
[0041] The drawing adjustment information is a change to the drawing attributes such as line thickness, color, transparency, etc. The drawing adjustment is a modification or optimization of the ongoing or upcoming drawing operation based on the drawing adjustment information.
[0042] In the disclosed embodiment, the current drawing operation is adjusted accordingly according to the determined drawing adjustment information. These adjustments may include but are not limited to: line thickness adjustment, color or transparency adjustment, and after the adjustment is completed, when the newly added touch drawing operation ends (i.e. the user stops pressing the newly added touch), according to the final drawing adjustment result, the drawing pen is continued to be controlled (in the virtual or physical environment) to perform press drawing with the pressing movement trajectory as the drawing trajectory, completing the entire drawing process.
[0043] It can be explained that the line thickness, line color and display ratio involved in the embodiments of the present disclosure can change in real time with the touch movement in the new touch drawing operation, but the final adjustment result is based on the final touch position of the new touch drawing operation.
[0044] The above technical solution determines the resolution ratio of the touchpad and the display screen by determining the touch distance between the touch starting point and the touch pad pressure sensor. This technology can dynamically adjust the display resolution according to the user's specific operation position and strength, ensuring that the user's drawing operations on the touchpad can be accurately reflected on the display screen, reducing the error caused by resolution mismatch and improving the accuracy of drawing.
[0045] The mapping relationship between the resolution ratio and the preset display scale is used to automatically adjust the display scale of the drawing coordinate system on the display screen, and the adjustment is centered on the position of the drawing pen. This function allows the drawing area to be dynamically scaled according to the user's needs, making it easier for users to perform detailed or rough drawing operations under different accuracy requirements, thereby enhancing the flexibility and convenience of drawing.
[0046] By identifying the pressure of the touch drawing operation, the drawing information of the drawing pen is determined, and the drawing pen is controlled to draw with the pressing movement trajectory as the drawing trajectory. This technology allows users to change the thickness, depth and other characteristics of the drawing line by adjusting the pressure, achieving richer drawing expressions and improving the quality and expressiveness of the drawing.
[0047] During the press-draw process, if the user adds a touch-draw operation on the touchpad, the drawing adjustment information is determined in real time and adjusted accordingly based on the press point information of the new operation and the displacement of the press point in the press movement trajectory. This allows the user to correct errors or adjust the drawing direction at any time during the drawing process without interrupting the drawing process, ensuring the continuity and smoothness of the drawing.
[0048] In summary, the technical solution of this application provides users with a more accurate, flexible and efficient drawing experience by combining advanced technologies such as touch distance perception, adaptive display ratio adjustment, pressure-sensitive drawing and real-time drawing adjustment. Users can freely create in a more intuitive and convenient interactive environment without worrying about the impact of technical limitations on creative ideas and expression effects. It not only helps to improve the user's creative efficiency and work quality, improve the accuracy and flexibility of drawing, but also greatly improves the user's drawing efficiency and creativity through the functions of real-time adjustment and continuous drawing.
[0049] In a possible implementation, in step S14, the drawing adjustment information is determined according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended, including: In step S141, when the track pressing point in the pressing movement track does not move, determining a first distance between an initial pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track, and determining a second distance between a current pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track; In the embodiment of the present disclosure, it is first checked whether the track pressing point in the pressing movement track has shifted relative to the initial position during the newly added touch drawing operation. If the track pressing point has not shifted (that is, the finger of the user remains stationary on the touch screen in the original pressing movement track), the calculation of the first distance and the second distance is performed.
[0050] When the track pressing point does not shift, the first distance between the initial pressing point and the track pressing point (the track pressing point that has not shifted) in the pressing point information of the newly added touch drawing operation is calculated. At the same time, the system also calculates the second distance between the current pressing point and the track pressing point (the track pressing point that has not shifted) in the pressing point information of the newly added touch drawing operation.
[0051] For example: suppose the user's finger adds a touch drawing operation on the touchpad, and the initial pressure point of the touch or press is recorded. At this time, the user can move the newly added touching finger, for example, move it closer to the track pressure point (the track pressure point that has not been displaced), or move it away from the track pressure point (the track pressure point that has not been displaced).
[0052] It can be understood that the track press point is an undisplaced track press point, so the first distance between the initial press point and the track press point (the undisplaced track press point) remains unchanged, and the current press point in the press point information of the newly added touch drawing operation can be away from or close to the track press point (the undisplaced track press point), so the second distance between the current press point and the track press point (the undisplaced track press point) in the press point information of the newly added touch drawing operation changes dynamically.
[0053] In step S142, a line thickness adjustment method for the line thickness in the drawing information is determined according to a magnitude relationship between the first distance and the second distance, and a line thickness adjustment amount for the line thickness in the drawing information is determined according to a first difference between the first distance and the second distance; The line thickness adjustment method refers to a method for adjusting the thickness of a drawing line, such as increasing, decreasing, or keeping it unchanged. The line thickness adjustment amount refers to a specific value or ratio of the line thickness adjustment.
[0054] In step S143, the line thickness in the drawing information is adjusted according to the line thickness adjustment method and the line thickness adjustment amount.
[0055] In the disclosed embodiment, the line thickness in the drawing information is adjusted according to the determined line thickness adjustment method and adjustment amount. For example, if the system calculates that the line thickness needs to be increased by 20%, it will multiply the line thickness value in the current drawing information by 1.2 to obtain the adjusted line thickness value.
[0056] The above technical solution is different from the prior art that adjusts the line thickness by pressure. When the track pressing point is not displaced, the first distance between the initial pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point (the track pressing point that has not been displaced) is calculated. At the same time, the system also calculates the second distance between the current pressing point and the track pressing point (the track pressing point that has not been displaced) in the pressing point information of the newly added touch drawing operation, and determines the adjustment method and adjustment amount. This can not only avoid uneven thickness of the line due to changes in finger pressure, but also flexibly determine the adjustment method and adjustment amount, thereby improving flexibility and drawing effect.
[0057] In a possible implementation, in step S142, determining a line adjustment method for line thickness in the drawing information according to a magnitude relationship between the first distance and the second distance, and determining a line adjustment amount for the line thickness in the drawing information according to a first difference between the first distance and the second distance, includes: In a case where the first distance is greater than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, and determining the line adjustment amount for reducing the thickness of the line in the drawing information; in a case where the first distance is less than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, and determining the line adjustment amount for increasing the thickness of the line in the drawing information, each of the thickness adjustment ranges corresponds to a thickness adjustment amount; In this embodiment, if the first distance is greater than the second distance, it means that the line drawn later needs to be thinner relative to the line thickness in the track pressing point, so the line adjustment method of the line thickness is to reduce the line thickness. If the first distance is less than the second distance, it means that the line drawn later needs to be thicker relative to the line thickness in the track pressing point, so the line adjustment method of the line thickness is to increase the line thickness.
[0058] In this embodiment, the difference between the first distance and the second distance, i.e., the first difference, is calculated. According to the size of the first difference, the thickness adjustment range to which it belongs is searched. Each thickness adjustment range predefines a difference interval and a corresponding line adjustment amount. According to the thickness adjustment range where the first difference is located, the specific line adjustment amount is determined. This adjustment amount will be used to increase or decrease the thickness of the line.
[0059] For example, suppose you are working on a map application where if the first distance (the distance to the building) of a road is much greater than the second distance (the distance to the parallel road), this may mean that the road is in an open area and does not need a particularly eye-catching line. Therefore, reduce the thickness of the line and find the thickness adjustment range where the first difference is located. Assuming the difference is 30 meters, the corresponding adjustment amount is 2 pixels, so it can be determined to reduce the line thickness of the painting pen by 2 pixels.
[0060] If the first distance of a road is much smaller than the second distance, this may mean that the road is located in a dense urban area and needs a more eye-catching line to highlight its location. Therefore, it is decided to increase the thickness of the line and find the thickness adjustment range where the first difference is located. Assuming the difference is -50 meters, the corresponding adjustment amount is 3 pixels, so it can be determined to increase the line thickness of the painting pen by 3 pixels.
[0061] In this way, the thickness of the line can be dynamically adjusted according to a specific distance relationship, thereby optimizing the visual effect and readability of the graphics. It can avoid uneven thickness of the line due to changes in finger pressure, and can flexibly determine the adjustment method and amount, improving flexibility and drawing effect.
[0062] When the first distance is less than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for reducing the thickness of the line in the drawing information; when the first distance is greater than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for increasing the thickness of the line in the drawing information, and each of the thickness adjustment ranges corresponds to a thickness adjustment amount.
[0063] In this embodiment, if the first distance is greater than the second distance, it means that the line drawn later needs to be thicker relative to the line thickness in the track pressing point, so the line adjustment method of the line thickness is to increase the line thickness. If the first distance is less than the second distance, it means that the line drawn later needs to be thinner relative to the line thickness in the track pressing point, so the line adjustment method of the line thickness is to reduce the line thickness.
[0064] For example, suppose you are working on a map application where the first distance (the distance to the building) of a road is much greater than the second distance (the distance to the parallel road), which may mean that the road is located in a dense urban area and needs a more eye-catching line to highlight its location. Therefore, you decide to increase the thickness of the line and find the thickness adjustment range where the first difference is located. Assuming the difference is 30 meters, the corresponding adjustment amount is 2 pixels, so you can determine to increase the line thickness of the painting pen by 2 pixels.
[0065] If the first distance of a road is much smaller than the second distance, this may mean that the road is located in an open area and does not need a particularly eye-catching line. Therefore, reduce the thickness of the line and find the thickness adjustment range where the first difference is located. Assuming the difference is -50 meters, the corresponding adjustment amount is 3 pixels, so it can be determined to reduce the line thickness of the painting pen by 3 pixels.
[0066] In this way, the thickness of the line can be dynamically adjusted according to a specific distance relationship, thereby optimizing the visual effect and readability of the graphics. It can avoid uneven thickness of the line due to changes in finger pressure, and can flexibly determine the adjustment method and amount, improving flexibility and drawing effect.
[0067] In a possible implementation, in step S14, the drawing adjustment information is determined according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended, including: In step S1401, when the track pressing point in the pressing movement track is displaced, determining the type of the movement track in which the track pressing point is displaced; The type of the moving track may refer to the shape of a path formed by the track pressing point moving on the touch panel, such as a straight line or a curve.
[0068] In the disclosed embodiment, by recording the position information of the track pressing point after the start of the newly added touch drawing operation and before the end of the newly added touch drawing operation, the distance and direction changes between adjacent pressing points are calculated to determine the type of moving trajectory of the track pressing point displacement.
[0069] For example: Assume that after starting the newly added touch drawing operation, the user moves from the upper left corner of the touchpad to the lower left corner along a straight line. By calculating the position change of each pressing point after starting the newly added touch drawing operation and before ending the newly added touch drawing operation, a straight line movement trajectory is identified.
[0070] In step S1402, if the type of the moving trajectory of the displacement of the track pressing point is a linear movement, the display ratio adjustment function of the drawing coordinate system on the display screen is started, and the third distance between the initial pressing point and the track pressing point before the displacement in the pressing point information of the newly added touch drawing operation is determined, and the fourth distance between the initial pressing point and the track pressing point after the displacement in the pressing point information of the newly added touch drawing operation is determined; Among them, the display ratio adjustment function is a function of changing the size ratio of the content displayed by the drawing coordinate system on the display screen through user operation.
[0071] In the embodiment of the present disclosure, when the system recognizes that the moving track is a straight line, it is determined that the user needs to use the function of adjusting the display ratio. Two key distances are calculated: the third distance (representing the ratio reference before adjustment) and the fourth distance (representing the ratio reference after adjustment). The changes in these two distances will be used to calculate the adjustment factor of the display ratio.
[0072] For example: Assume that the user starts touching the center of the screen (initial press point), and then moves down a certain distance along a straight line (the track press point is displaced). The system calculates that the distance between the initial press point and the last press point before the start of the movement (i.e., the state before the displacement occurs) is 100 pixels (the third distance). When the user continues to move to a new position, the system calculates that the distance between the initial press point and the current press point is 150 pixels (the fourth distance). Based on the changes in these two distances, it can be calculated whether the display ratio needs to be adjusted.
[0073] In step S1403, a fifth distance between the initial pressing point in the pressing point information of the newly added touch drawing operation and the current pressing point in the pressing point information of the newly added touch drawing operation is determined; The fifth distance is the distance between the initial pressing point and the current pressing point (ie, the point on the touch panel currently touched by the user's finger) in the newly added touch drawing operation.
[0074] In the disclosed embodiment, by recording the coordinate information of the initial pressing point and the current pressing point, a geometric distance formula (such as the Euclidean distance formula) is used to calculate the distance between the two, i.e., the fifth distance. This distance reflects the total moving distance of the user's touch operation.
[0075] For example: Assume that during the new touch drawing operation, the user starts touching the upper right corner of the screen (the initial pressing point) and moves down along a straight line or curve to a position in the center of the screen (the current pressing point). The distance between the two points is calculated to be 200 pixels, which is the fifth distance.
[0076] In step S1404, a proportional adjustment method for the display ratio is determined according to a magnitude relationship between the third distance and the fourth distance, and a proportional adjustment amount for the display ratio is determined according to the fifth distance; The proportional adjustment mode refers to whether the display scale is increased or decreased, or whether other forms of adjustment are performed (such as a change in the zoom center). The proportional adjustment amount is a specific value or percentage of the display scale adjustment.
[0077] In the disclosed embodiment, the third distance (reference distance before adjustment) and the fourth distance (reference distance after adjustment) are first compared. If the fourth distance is greater than the third distance, for example, the display ratio is increased; otherwise, the display ratio is reduced. Next, the fifth distance (total moving distance) and a certain algorithm (such as a linear proportional relationship, a logarithmic proportional relationship, etc.) are used to calculate the proportional adjustment amount. This algorithm may also involve factors such as user preferences, the physical size and resolution of the screen, etc.
[0078] For example: Assume that the third distance is 100 pixels and the fourth distance is 150 pixels, indicating that the user wants to increase the display ratio. The proportional adjustment amount is calculated based on the fifth distance (such as 200 pixels) and a preset algorithm (such as the display ratio increases by 10% for every 100 pixels moved). In this example, the proportional adjustment amount may be 20% (because 200 pixels is twice 100 pixels, and every 100 pixels corresponds to a 10% adjustment amount).
[0079] In step S1405, the display scale of the drawing coordinate system on the display screen is adjusted according to the scale adjustment method and the scale adjustment amount.
[0080] In the disclosed embodiment, after the proportional adjustment method and proportional adjustment amount are determined, the drawing coordinate system on the display screen will be adjusted accordingly. This usually involves transformation operations such as scaling and translation (if the adjustment center changes) of the drawing content. These transformation operations are optimized according to the parameters set by the user and the physical characteristics of the screen to ensure the clarity and readability of the drawing content.
[0081] For example: Assume that the system has determined that the scaling method is to increase the display scale, and the scaling amount is 20%. Then, the drawing coordinate system will be scaled so that the drawing content appears larger and clearer on the screen. If the adjustment center remains unchanged, the center position of the drawing content will also move toward the center of the screen accordingly (because the entire drawing content is enlarged). If the adjustment center changes (for example, the user selects a specific point as the scaling center), the drawing content will be scaled around this point.
[0082] In this way, the display scale can be adjusted during the actual drawing process, thereby improving the efficiency and convenience of drawing.
[0083] In a possible implementation, in step S1404, determining the proportional adjustment method for the display ratio according to the magnitude relationship between the third distance and the fourth distance, and determining the proportional adjustment amount for the display ratio according to the fifth distance include: When the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds to a proportional adjustment amount; The proportional adjustment method is a strategy for adjusting the display ratio, such as increasing, decreasing, or keeping it unchanged. The proportional adjustment amount refers to the specific adjustment size or percentage of the display ratio. The proportional adjustment range is a series of ranges divided into different preset intervals, and each range corresponds to a specific proportional adjustment amount.
[0084] In one implementation of the present disclosure, the third distance is compared with the fourth distance to determine whether the display ratio needs to be adjusted. In this embodiment, if the third distance is greater than the fourth distance, it indicates that the user may want to see a wider content area (because the user is away from a specific element), so the system decides to reduce the display ratio (i.e., reduce the content to fit a larger field of view). Conversely, if the third distance is less than the fourth distance, the user may want to focus more on a certain detail, so the system decides to increase the display ratio (i.e., enlarge the content).
[0085] Further, the system predefines a series of proportional adjustment ranges for the fifth distance, and each range corresponds to a specific proportional adjustment amount. For example, when the fifth distance is large, it may mean that you want to have an overview of the entire interface, so the system will choose a larger proportional increase. On the contrary, when the fifth distance is small, it may mean that you want to see more details, so you choose a smaller proportional increase or a smaller proportional decrease.
[0086] For example, in case 1, after the user moves the finger, the third distance is greater than the fourth distance, indicating that the user wants to see more content. After recognition, the system decides to reduce the display ratio and finds the corresponding ratio adjustment range based on the fifth distance (for example, the user's finger is close to the bottom of the screen, indicating that the adjustment is not expected to be too large), and finally determines to reduce it to 92%.
[0087] In case 2, after the user moves the finger, the third distance is less than the fourth distance, indicating that the user wants to see the word more clearly. The system decides to increase the display ratio and again searches for a suitable ratio adjustment amount based on the fifth distance, and finally determines to increase it to 130%.
[0088] When the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds one to one to a proportional adjustment amount.
[0089] In another embodiment of the present disclosure, the third distance is compared with the fourth distance to determine whether the display ratio needs to be adjusted. In this embodiment, if the third distance is less than the fourth distance, it indicates that the user may want to focus more on a certain detail, so the system decides to reduce the display ratio (i.e., reduce the content to fit a larger field of view). Conversely, if the third distance is less than the fourth distance, the user may want to see a wider content area (because the user is away from a specific element), so the system decides to increase the display ratio (i.e., enlarge the content).
[0090] Further, the system predefines a series of proportional adjustment ranges for the fifth distance, and each range corresponds to a specific proportional adjustment amount. For example, when the fifth distance is large, it may mean that you want to have an overview of the entire interface, so the system will choose a larger proportional increase. On the contrary, when the fifth distance is small, it may mean that you want to see more details, so you choose a smaller proportional increase or a smaller proportional decrease.
[0091] For example, in case 1, after the user moves the finger, the third distance is less than the fourth distance, indicating that the user wants to see more content. After recognition, the system decides to reduce the display ratio and finds the corresponding ratio adjustment range based on the fifth distance (for example, the user's finger is close to the bottom of the screen, indicating that the adjustment is not expected to be too large), and finally determines to reduce it to 92%.
[0092] In case 2, after the user moves the finger, the third distance is greater than the fourth distance, indicating that the user wants to see the word more clearly. The system decides to increase the display ratio and again searches for a suitable ratio adjustment amount based on the fifth distance, and finally determines to increase it to 130%.
[0093] In a possible implementation, the method further includes: In step S1406, if the type of the moving trajectory of the displacement of the trajectory pressing point is non-linear movement, a function for adjusting the line color in the drawing information is started, and a drawing pen color selection window is popped up on the display screen, and the drawing pen color selection window is used to display a color display panel; The paint pen color selection window is a pop-up window interface for users to select the color of the paint pen. The color display panel is an area that displays various color options in the paint pen color selection window.
[0094] In the disclosed embodiment, the moving trajectory of the track pressing point is tracked in real time. If the moving trajectory of the track pressing point is detected to be a non-straight line (such as a curve or a broken line), it is determined that the user may want to perform a color selection operation. When it is determined that the user wants to select a color, the system starts an adjustment function for the line color in the drawing information. A painting pen color selection window pops up on the display screen, and the window includes a color display panel for displaying various color options.
[0095] In step S1407, the painting brush is hidden, and a selection cursor is displayed in the painting brush color selection window; The selection cursor is moved on the color display panel to indicate the color currently selected by the user. In the disclosed embodiment, in order to avoid interface confusion, the system hides the current painting pen icon. A selection cursor is displayed in the painting pen color selection window to move on the color display panel and select a color.
[0096] In step S1408, the selection cursor is moved to point to a color in the color display panel according to the current pressing point in the pressing point information of the newly added touch drawing operation; In the disclosed embodiment, the system updates the position of the selection cursor in real time according to the pressure point information of the newly added touch drawing operation. When the user moves the finger, the selection cursor moves on the color display panel to indicate the currently selected color.
[0097] In step S1409, in response to the touch being stopped in the newly added touch drawing operation, the line color of the painting brush is adjusted using the color pointed to by the selection cursor as the target color, and the painting brush color selection window is closed and the painting brush is redisplayed at the position where the painting brush is hidden.
[0098] In the disclosed embodiment, when the user stops touching (i.e., the newly added touch drawing operation ends), the system records the color pointed to by the selection cursor when it stops as the target color. The system adjusts the line color of the drawing pen to the target color. The drawing pen color selection window is closed, and the drawing pen is redisplayed at the position where the drawing pen was previously hidden, so that the user can continue drawing.
[0099] For example, suppose a user is using a drawing app to create a work. The user first draws a straight line on the screen with a pen. Then, the user wants to change the color of the pen, so he touches the touchpad with his other hand and starts a non-linear movement trajectory (for example, draws a circle) with the original finger. After the system detects this non-linear movement trajectory, a pen color selection window pops up on the screen.
[0100] Furthermore, the window includes a color display panel that displays a variety of color options. At this time, the paint pen icon is hidden to avoid interfering with the user's color selection. The user moves the "other finger" described above on the touchpad, and the selection cursor also moves on the color display panel, and finally stops on a blue color. After the user stops touching the screen, the system uses the blue as the target color and adjusts the line color of the paint pen. Subsequently, the paint pen color selection window is closed, and the paint pen reappears in the previously hidden position, and the user can continue to draw with the new color.
[0101] In a possible implementation, the method further includes: In response to the track pressing point in the pressing movement track ceasing to touch, the touch panel is initialized to restore the target display ratio of the drawing coordinate system, the line thickness and the line color of the drawing pen to default settings.
[0102] In the disclosed embodiment, when the user draws or operates on the touchpad, the system will continuously monitor the position and movement trajectory of the touch point. Once it is detected that there is no longer a track pressing point on the touchpad (that is, the user stops touching), the system will consider that the current operation has been completed or paused, thereby triggering the subsequent initialization setting process. For example: suppose the user is using a finger to draw a straight line on the touchpad. When the finger leaves the touchpad, the system detects the action of stopping touching and then enters the initialization setting stage.
[0103] In the disclosed embodiment, during the initialization setting, the system will restore the target display scale of the drawing coordinate system to the preset default state. This usually means that no matter how the user previously scaled or adjusted the drawing area, it will now be restored to the original display scale for new drawing or operation. For example: if the user enlarges the display scale to 200% during the drawing process, when the user stops touching and triggers the initialization setting, the display scale will automatically return to the default 100%, restoring the drawing area to its original size.
[0104] In the disclosed embodiment, during the initialization setting, the system will restore the line thickness of the drawing pen to the preset default value. This helps to ensure the coherence and consistency of subsequent drawing operations and avoids the drawing effect being affected by different line thicknesses. For example: if the user previously set the line thickness of the drawing pen to 5 pixels, when the touch stops and the initialization setting is triggered, the line thickness will automatically return to the default 1 pixel or other system preset values.
[0105] In the disclosed embodiment, also in the initialization setting, the system will restore the line color to the preset default value. This helps to keep the drawing interface neat and consistent and avoids the visual effect being affected by color confusion. For example: if the user previously set the line color to red, when the touch stops and the initialization setting is triggered, the line color will automatically return to the default black or other colors preset by the system.
[0106] In summary, in response to the track pressing point stopping the touch, the process of initializing the touchpad includes multiple steps such as detecting the stop of the touch, restoring the target display scale of the drawing coordinate system, restoring the line thickness and line color of the drawing pen, etc. These steps together ensure the coherence and consistency of the touchpad drawing function, providing users with a more stable and reliable drawing experience.
[0107] The present disclosure also provides a drawing device based on touch panel pressure detection, see Figure 2 As shown, including: A first determination module 210 is configured to determine, in response to a touch drawing operation on the touch panel, a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determine a resolution ratio of the touch panel to the display screen according to the touch distance; The second determining module 220 is configured to determine a target display ratio of the drawing coordinate system in the display screen from a preset display ratio according to the resolution ratio, and adjust the display ratio of the drawing coordinate system on the display screen with the position of the drawing brush on the display screen as the center according to the target display ratio, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; The third determining module 230 is configured to determine drawing information of the drawing pen corresponding to the touch drawing operation according to the pressure of the touch drawing operation at the touch starting point, and control the drawing pen to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point according to the drawing information; The fourth determining module 240 is configured to determine drawing adjustment information in response to a new touch drawing operation on the touch panel during the press drawing process according to the press point information of the new touch drawing operation and whether a track press point in the press movement track is displaced after the new touch drawing operation is started and before the new touch drawing operation is ended; The fifth determining module 250 is configured to perform drawing adjustment according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, continue to control the drawing pen to perform press drawing with the press movement trajectory as the drawing trajectory.
[0108] In a possible implementation, the fourth determining module 240 is configured to: In the case where the track pressing point in the pressing movement track does not move, determining a first distance between an initial pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track, and determining a second distance between a current pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track; Determining a line thickness adjustment method for the line thickness in the drawing information according to a magnitude relationship between the first distance and the second distance, and determining a line thickness adjustment amount for the line thickness in the drawing information according to a first difference between the first distance and the second distance; The line thickness in the drawing information is adjusted according to the line thickness adjustment method and the line thickness adjustment amount.
[0109] In a possible implementation, the fourth determining module 240 is configured to: In a case where the first distance is greater than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, and determining the line adjustment amount for reducing the thickness of the line in the drawing information; in a case where the first distance is less than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, and determining the line adjustment amount for increasing the thickness of the line in the drawing information, each of the thickness adjustment ranges corresponds to a thickness adjustment amount; When the first distance is less than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for reducing the thickness of the line in the drawing information; when the first distance is greater than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for increasing the thickness of the line in the drawing information, and each of the thickness adjustment ranges corresponds to a thickness adjustment amount.
[0110] In a possible implementation, the fourth determining module 240 is configured to: In the case where the track pressing point in the pressing movement track is displaced, determining the type of the movement track in which the track pressing point is displaced; If the type of the moving trajectory of the displacement of the track pressing point is a linear movement, a function of adjusting the display ratio of the drawing coordinate system on the display screen is started, and a third distance before the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined, and a fourth distance after the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined; Determine a fifth distance between the initial pressing point in the pressing point information of the newly added touch drawing operation and the current pressing point in the pressing point information of the newly added touch drawing operation; determining a proportional adjustment method for the display ratio according to a magnitude relationship between the third distance and the fourth distance, and determining a proportional adjustment amount for the display ratio according to the fifth distance; The display scale of the drawing coordinate system on the display screen is adjusted according to the scale adjustment method and the scale adjustment amount.
[0111] In a possible implementation, the fourth determining module 240 is configured to: When the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds to a proportional adjustment amount; When the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds one to one to a proportional adjustment amount.
[0112] In a possible implementation, the fourth determining module 240 is configured to: If the type of the moving trajectory of the displacement of the trajectory pressing point is non-linear movement, a function for adjusting the line color in the drawing information is started, and a drawing pen color selection window is displayed on the display screen in a pop-up window, and the drawing pen color selection window is used to display a color display panel; Hide the painting brush and display a selection cursor in the painting brush color selection window; Moving the selection cursor to point to a color in the color display panel according to the current pressing point in the pressing point information of the newly added touch drawing operation; In response to the newly added touch drawing operation, the touch is stopped, the line color of the painting pen is adjusted using the color pointed to by the selection cursor when it is stopped as the target color, and the painting pen color selection window is closed and the painting pen is redisplayed at the position where the painting pen is hidden.
[0113] In a possible implementation, the device further includes: an initialization module configured to: In response to the track pressing point in the pressing movement track ceasing to touch, the touch panel is initialized to restore the target display ratio of the drawing coordinate system, the line thickness and the line color of the drawing pen to default settings.
[0114] The present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described in any one of the aforementioned embodiments are implemented.
[0115] The present disclosure also provides an electronic device, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the method in any one of the aforementioned embodiments.
[0116] Figure 3The drawing device 100 based on touch panel pressure detection shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the drawing device 100 based on touch panel pressure detection may also include a communication component, which may be used for data interaction between the device 100 and other devices, such as data transmission and / or data reception. It should be noted that in actual scheduling, the communication component is not limited to one, and the structure of the drawing device 100 based on touch panel pressure detection does not constitute a limitation on the embodiments of the present application.
[0117] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0118] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0119] The memory 1003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store program code and can be read by a computer, without limitation herein.
[0120] The memory 1003 is used to store program codes for executing the embodiments of the present disclosure, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the program codes stored in the memory 1003 to implement the steps shown in the above-mentioned embodiment of the drawing method based on touch panel pressure detection.
[0121] The embodiment of the present disclosure further provides a computer-readable storage medium having program codes stored thereon. When the program codes are executed by a processor, the steps and corresponding contents of the aforementioned embodiment of the drawing method based on touch panel pressure detection can be implemented.
[0122] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments; within the technical concept of the present disclosure, various changes, modifications, substitutions and variations may be made to these embodiments, and these changes, modifications, substitutions and variations all fall within the protection scope of the present disclosure.
[0123] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction, and they should also be regarded as the contents disclosed in this disclosure. In order to avoid unnecessary repetition, this disclosure will not further describe various possible combinations. The technical scope of this application is not limited to the contents in the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A drawing method based on touch panel pressure detection, characterized in that: The method comprises: In response to a touch drawing operation on the touch panel, determining a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determining a resolution ratio of the touch panel to a display screen according to the touch distance; According to the resolution ratio, a target display ratio of the drawing coordinate system in the display screen is determined from a preset display ratio, and according to the target display ratio, the display ratio of the drawing coordinate system on the display screen is adjusted with the position of the drawing brush on the display screen as the center, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; Determining drawing information of a drawing pen corresponding to the touch drawing operation according to the pressure of the touch drawing operation at the touch starting point, and controlling the drawing pen to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point according to the drawing information; In the process of the press-to-draw, in response to a new touch-to-draw operation on the touch panel, the drawing adjustment information is determined according to the press point information of the new touch-to-draw operation and whether the track press point in the press-to-draw trajectory is displaced after the new touch-to-draw operation is started and before the new touch-to-draw operation is ended; The drawing adjustment is performed according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, the drawing pen is continuously controlled to perform press drawing with the press movement trajectory as the drawing trajectory.
2. The drawing method based on touch panel pressure detection as claimed in claim 1, characterized in that: The determining of the drawing adjustment information according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the track of the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended includes: In the case where the track pressing point in the pressing movement track does not move, determining a first distance between an initial pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track, and determining a second distance between a current pressing point in the pressing point information of the newly added touch drawing operation and the track pressing point in the pressing movement track; Determining a line thickness adjustment method for the line thickness in the drawing information according to a magnitude relationship between the first distance and the second distance, and determining a line thickness adjustment amount for the line thickness in the drawing information according to a first difference between the first distance and the second distance; The line thickness in the drawing information is adjusted according to the line thickness adjustment method and the line thickness adjustment amount.
3. The drawing method based on touch panel pressure detection as claimed in claim 2, characterized in that: The determining, according to the magnitude relationship between the first distance and the second distance, a line adjustment method for the line thickness in the drawing information, and determining, according to a first difference between the first distance and the second distance, a line adjustment amount for the line thickness in the drawing information, includes: In a case where the first distance is greater than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, to determine the line adjustment amount for reducing the thickness of the line in the drawing information; in a case where the first distance is less than the second distance, determining that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and querying the thickness adjustment range where the first difference between the first distance and the second distance is located, to determine the line adjustment amount for increasing the thickness of the line in the drawing information, each of the thickness adjustment ranges corresponds to a thickness adjustment amount; or When the first distance is less than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to reduce the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for reducing the thickness of the line in the drawing information; when the first distance is greater than the second distance, it is determined that the line adjustment method for the line thickness in the drawing information is to increase the thickness of the line, and the thickness adjustment range in which the first difference between the first distance and the second distance is located is queried to determine the line adjustment amount for increasing the thickness of the line in the drawing information, and each of the thickness adjustment ranges corresponds to a thickness adjustment amount.
4. The drawing method based on touch panel pressure detection as claimed in claim 1, characterized in that: The determining of the drawing adjustment information according to the pressing point information of the newly added touch drawing operation and whether the pressing point in the track of the pressing movement track is displaced after the newly added touch drawing operation is started and before the newly added touch drawing operation is ended includes: In the case where the track pressing point in the pressing movement track is displaced, determining the type of the movement track in which the track pressing point is displaced; If the type of the moving trajectory of the displacement of the track pressing point is a linear movement, a function of adjusting the display ratio of the drawing coordinate system on the display screen is started, and a third distance before the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined, and a fourth distance after the displacement of the initial pressing point and the track pressing point in the pressing point information of the newly added touch drawing operation is determined; Determine a fifth distance between the initial pressing point in the pressing point information of the newly added touch drawing operation and the current pressing point in the pressing point information of the newly added touch drawing operation; determining a proportional adjustment method for the display ratio according to a magnitude relationship between the third distance and the fourth distance, and determining a proportional adjustment amount for the display ratio according to the fifth distance; The display scale of the drawing coordinate system on the display screen is adjusted according to the scale adjustment method and the scale adjustment amount.
5. The drawing method based on touch panel pressure detection as claimed in claim 4, characterized in that: The determining, according to the magnitude relationship between the third distance and the fourth distance, a proportional adjustment method for the display ratio, and determining, according to the fifth distance, a proportional adjustment amount for the display ratio, include: When the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds to a proportional adjustment amount; or When the third distance is less than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to reduce the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for reducing the display ratio; when the third distance is greater than the fourth distance, it is determined that the proportional adjustment method for the display ratio is to increase the display ratio, and the proportional adjustment range of the fifth distance is queried to determine the proportional adjustment amount for increasing the display ratio, and each of the proportional adjustment ranges corresponds one to one to a proportional adjustment amount.
6. The drawing method based on touch panel pressure detection as claimed in claim 4, characterized in that: The method further comprises: If the type of the moving trajectory of the displacement of the trajectory pressing point is non-linear movement, a function for adjusting the line color in the drawing information is started, and a drawing pen color selection window is displayed on the display screen in a pop-up window, and the drawing pen color selection window is used to display a color display panel; Hide the painting brush and display a selection cursor in the painting brush color selection window; Moving the selection cursor to point to a color in the color display panel according to the current pressing point in the pressing point information of the newly added touch drawing operation; In response to the newly added touch drawing operation, the touch is stopped, the line color of the painting pen is adjusted using the color pointed to by the selection cursor when it is stopped as the target color, and the painting pen color selection window is closed and the painting pen is redisplayed at the position where the painting pen is hidden.
7. The drawing method based on touch panel pressure detection according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the track pressing point in the pressing movement track ceasing to touch, the touch panel is initialized to restore the target display ratio of the drawing coordinate system, the line thickness and the line color of the drawing pen to default settings.
8. A drawing device based on touch panel pressure detection, characterized in that: include: a first determination module configured to determine, in response to a touch drawing operation on the touch panel, a touch distance between a touch start point of the touch drawing operation and a pressure sensor of the touch panel, and determine a resolution ratio of the touch panel to the display screen according to the touch distance; A second determination module is configured to determine a target display ratio of the drawing coordinate system in the display screen from a preset display ratio according to the resolution ratio, and adjust the display ratio of the drawing coordinate system on the display screen based on the target display ratio and with the position of the drawing brush on the display screen as the center, wherein there is a one-to-one mapping relationship between the resolution ratio and the display ratio; A third determining module is configured to determine drawing information of a drawing pen corresponding to the touch drawing operation according to the pressure of the touch drawing operation at the touch starting point, and control the drawing pen to perform press drawing with a pressing movement trajectory as a drawing trajectory starting from the touch starting point according to the drawing information; a fourth determination module configured to, in response to a new touch drawing operation on the touch panel during the press drawing process, determine drawing adjustment information according to press point information of the new touch drawing operation and whether a track press point in the press movement track is displaced after starting the new touch drawing operation and before ending the new touch drawing operation; The fifth determining module is configured to perform drawing adjustment according to the drawing adjustment information, and after the newly added touch drawing operation is completed, based on the completed drawing adjustment, continue to control the drawing pen to perform press drawing with the press movement trajectory as the drawing trajectory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Graph drawing method and device, storage medium and terminal equipment
CN112199030A
Touch point position drawing method and device, screen projector and storage medium
CN114564139A
Drawing content processing method and device for terminal apparatus, and terminal apparatus
US20200134890A1
Devices, methods, and graphical user interfaces for displaying sets of controls in response to gaze and / or gesture inputs
US20240361901A1
Cited By
Pressure touchpad with finger replacing pressure-sensitive active pen
CN119690257A
A pressure touchpad of a finger substitute pressure-sensitive active pen
CN119690257B