CN111127583A - Method and device for drawing curve and electronic equipment - Google Patents

Method and device for drawing curve and electronic equipment Download PDF

Info

Publication number
CN111127583A
CN111127583A CN201911093965.9A CN201911093965A CN111127583A CN 111127583 A CN111127583 A CN 111127583A CN 201911093965 A CN201911093965 A CN 201911093965A CN 111127583 A CN111127583 A CN 111127583A
Authority
CN
China
Prior art keywords
initial value
value
interval
adjustment
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911093965.9A
Other languages
Chinese (zh)
Other versions
CN111127583B (en
Inventor
詹孟学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jupiter Technology Co ltd
Original Assignee
Shell Internet Beijing Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shell Internet Beijing Security Technology Co Ltd filed Critical Shell Internet Beijing Security Technology Co Ltd
Priority to CN201911093965.9A priority Critical patent/CN111127583B/en
Publication of CN111127583A publication Critical patent/CN111127583A/en
Application granted granted Critical
Publication of CN111127583B publication Critical patent/CN111127583B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Image Generation (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a method and a device for drawing a curve and electronic equipment, relates to the technical field of computers, and can more accurately set the curvature of the curve. The method comprises the following steps: receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and the end point value with a smaller range is greater than or equal to 0; when the initial value is located in a first interval of the range, performing first adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the first interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is smaller than that of the initial value; drawing a target circle by taking the adjustment value as a target radius; and cutting the target circle by using the cutting frame to generate a target curve. The invention is suitable for drawing curves in electronic equipment.

Description

Method and device for drawing curve and electronic equipment
Technical Field
The present invention relates to computer technologies, and in particular, to a method and an apparatus for drawing a curve, and an electronic device.
Background
As shown in fig. 1, when we want to draw a curve through an electronic device, a circle may be drawn on a canvas 11 provided by the electronic device first, and then a cut-out frame 12 is used to cut out a curve on the circle, and the cut-out curve is used as a target curve; when the size of the trimming frame 12 is constant, the radius of the drawn circle is different, and curves with different degrees of curvature (degrees of bending) are generated. Most of the current electronic devices providing such a drawing method provide a dragging bar 13(SeekBar) to the user, and the displacement of the dragging bar 13 pulled by the user is directly regarded as the radius of the circle.
At this time, the user may find that the unfolding speed of the curve is very slow in the process of pulling the dragging strip, and the curve within the target curvature range cannot appear until the stretching speed is pulled to the middle-rear section of the seekbr; since the length of seekbr corresponding to the target curvature range is small, it is difficult for the user to accurately set the curvature of the curve within the target curvature range.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for drawing a curve, and an electronic device, which can more accurately set a curvature of the curve.
In a first aspect, an embodiment of the present invention provides a method for drawing a curve, where the method includes: receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and the end point value with a smaller range is greater than or equal to 0; when the initial value is located in a first interval of the range, performing first adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the first interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is smaller than that of the initial value; drawing a target circle by taking the adjustment value as a target radius; and cutting the target circle by using the cutting frame to generate a target curve.
Optionally, the ratio of the first interval in the measuring range is greater than a preset threshold.
Optionally, the method further includes: when the initial value is located in a second interval of the measuring range, performing second adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the second interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is greater than that of the initial value; the end point value with the larger second interval is equal to the end point value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is larger than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the method further includes: when the initial value is located in a second interval of the measuring range, performing second adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the second interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is greater than that of the initial value; the end point value with the smaller second interval is equal to the end point value with the larger first interval, and the adjustment value corresponding to the initial value in the first interval is smaller than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the drawing a target circle by using the adjustment value as a target radius includes: scaling the adjustment value according to a linear scaling coefficient to obtain a target radius; and drawing a target circle according to the target radius.
Optionally, the end point value with the smaller measuring range is positively correlated with the width and/or height of the cutting frame; and/or the end point value with the larger measuring range is positively correlated with the width and/or the height of the cutting frame.
Optionally, before the target circle is cut by using the cutting frame, the method further includes: generating the cutting frame adaptive to the text box according to the text box input by the user; after generating the target curve, the method further comprises: and with the target curve as a layout path, uniformly arranging the texts in the text boxes along the layout path.
In a second aspect, an embodiment of the present invention further provides an apparatus for plotting curves, including: the receiving module is used for receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within the range of the interactive control according to the operation of the user on the interactive control, and the end point value with the smaller range is greater than or equal to 0; the first adjusting module is used for performing first adjustment on the initial value when the initial value is located in a first interval of the range to obtain an adjusting value, wherein when the initial value is increased in the first interval, the adjusting value is increased along with the increase of the initial value, and the increase of the adjusting value is smaller than that of the initial value; the drawing module is used for drawing a target circle by taking the adjustment value as a target radius; and the cutting module is used for cutting the target circle by using the cutting frame to generate a target curve.
Optionally, the ratio of the first interval in the measuring range is greater than a preset threshold.
Optionally, the apparatus further comprises: a second adjusting module, configured to perform a second adjustment on the initial value when the initial value is within a second interval of the range, so as to obtain an adjustment value, where when the initial value increases within the second interval, the adjustment value increases with an increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value; the end point value with the larger second interval is equal to the end point value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is larger than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the apparatus further comprises: a second adjusting module, configured to perform a second adjustment on the initial value when the initial value is within a second interval of the range, so as to obtain an adjustment value, where when the initial value increases within the second interval, the adjustment value increases with an increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value; the end point value with the smaller second interval is equal to the end point value with the larger first interval, and the adjustment value corresponding to the initial value in the first interval is smaller than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the drawing module is specifically configured to: scaling the adjustment value according to a linear scaling coefficient to obtain a target radius; and drawing a target circle according to the target radius.
Optionally, the end point value with the smaller measuring range is positively correlated with the width and/or height of the cutting frame; and/or the end point value with the larger measuring range is positively correlated with the width and/or the height of the cutting frame.
Optionally, the apparatus further comprises: the cutting frame generating module is used for generating a cutting frame matched with the text frame according to the text frame input by a user before the cutting module cuts the target circle by using the cutting frame; and the arranging module is used for uniformly arranging the texts in the text boxes along the arranging path by taking the target curve as the arranging path after the target curve is generated by the cutting module.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used for executing any method for drawing the curve provided by the embodiment of the invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement any of the methods for drawing a curve provided by the embodiments of the present invention.
According to the method, the device, the electronic equipment and the storage medium for drawing the curve, which are provided by the embodiment of the invention, the initial value input by a user through operating the interactive control is received, wherein the initial value linearly changes within the measuring range of the interactive control according to the operation of the user on the interactive control, and the end point value with a smaller measuring range is greater than or equal to 0; when the initial value is located in a first interval of the range, performing first adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the first interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is smaller than that of the initial value; drawing a target circle by taking the adjustment value as a target radius; and cutting the target circle by using the cutting frame to generate a target curve. In this way, compared with the method in the prior art in which the initial value is directly used as the radius of the target circle, when the user operates the interactive control in the first interval under the condition that the operating characteristics of the user on the interactive control are the same, the curvature of the curve can be set more accurately by using the adjustment value as the radius of the target circle.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic drawing of a curve drawn by a drag bar;
FIG. 2 is a flow chart of a method for plotting curves provided by an embodiment of the present invention;
FIG. 3 is a diagram of one embodiment of an interaction control;
FIG. 4 is a graph comparing the variation trend of the initial value and the adjustment value in one embodiment of the present invention;
FIG. 5 is a graph comparing the variation trend of the initial value and the adjustment value in another embodiment of the present invention;
FIG. 6 is a diagram illustrating the effect of one embodiment of the method for plotting curves according to the present invention;
FIG. 7 is a schematic structural diagram of one of the devices for plotting curves provided by the embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a first aspect, embodiments of the present invention provide a method for drawing a curve, which can set a curvature of the curve more accurately.
As shown in fig. 2, a method for drawing a curve according to the present invention may include:
step 101, receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and a terminal value with a smaller range is greater than or equal to 0;
in this step, when the user operates the interactive control, the initial value linearly changes within the range of the interactive control according to the operating characteristics of the user on the interactive control, for example:
the interactive control may be a sliding control, and the sliding control may be a dragging bar (seekbar) as shown in fig. 1, where the dragging bar includes a progress bar and a slider, and the initial value linearly changes within a range of the progress bar according to a sliding length of the slider from the starting point in a process of dragging the slider along the progress bar by a user; i.e. the initial value, is equal to the value indicated by the position of the slider on the progress bar. For example: the range of the dragging bar is 0-1, the first moment of the sliding block is located at the starting point of the progress bar, the initial value is equal to 0 at the first moment, the length between the second moment of the sliding block and the starting point is one fourth of the length of the whole progress bar, the initial value is equal to 0.25 at the second moment, the third moment of the sliding block is located in the middle of the sliding block, and the initial value is equal to 0.5 at the third moment.
The interactive control can also be a long-press control, and the initial value linearly changes within the range of the long-press control according to the pressing time of the long-press control by the user; in this embodiment, the pressing time of the user may be accumulated, that is, when the user presses next time, the time of the previous pressing is taken as a starting point when the initial value corresponding to the pressing time of the user does not exceed the range. Of course, the pressing time of the user may not be accumulated, and in this case, the pressing time starts to be 0 every time the user presses.
The interactive control can also be a rotary control, and the initial value linearly changes within the measuring range of the rotary control according to the rotation angle of the user to the rotary control. In this embodiment, optionally, the rotation control may rotate clockwise or counterclockwise, so that the user can conveniently adjust the initial value repeatedly.
The interactive control can also be a click control, and the initial value linearly changes within the range of the click control according to the number of times of clicking the click control by the user; for example, the click control shown in fig. 3, the range of the click control may be 0 to positive infinity, the initial value may be equal to the number of clicks of the "+" symbol by the user, where the initial value is equal to 0 when the user does not click the "+" symbol, is equal to 1 when the user clicks the "+" symbol for the first time, and is equal to N when the user clicks the "+" symbol for the nth time, where N is a positive integer; as shown in fig. 3, the click control may further include a "-" symbol, and at this time, the number of times that the user clicks the click control is equal to the difference between the number of times that the user clicks the "+" symbol and the number of times that the user clicks the "-" symbol, so that the initial value may be linearly increased or decreased, which is convenient for the user to repeatedly adjust the initial value.
In this embodiment, the interactive control may be one of the above-mentioned sliding control, long-press control, spin control, and click control, may also be a combination of two or more of the above-mentioned sliding control, long-press control, spin control, and click control, and may also be other types of controls, which is not limited in this embodiment. The end point value of the interaction control with the smaller measuring range is greater than or equal to 0, for example: the range can be 0-1 mm, 0.6-1 mm, 10-1000 mm and the like, and can be set according to actual needs in practical application, and the range is not limited in the embodiment.
In an alternative embodiment of the invention, the smaller end point value of the range of the measuring range is greater than 0.
In this embodiment, since the initial value linearly increases from 0 in the measurement range when the end point value of the small measurement range is equal to 0, the radius of the circle whose radius is equal to the initial value also increases from 0, the circle expands very slowly before increasing (i.e. the speed of the circle that grows to the size desired by the user is very slow), and the curvature (degree of curvature) is very large, in some cases where curves with very large curvature are not needed, the increase is useless for the user, and the time for the user to draw the target curve is wasted, thereby reducing the user experience; therefore, in some application occasions without curves with large curvature, the end point value with the small range can be set to be a value larger than 0, so that the operation time of a user can be saved, and the user experience is improved.
In addition, under the condition that the initial value is linearly increased from 0 in the measuring range, a circle with the initial value as the radius occupies a certain measuring range in the process of being increased to the size expected by a user, so that the measuring range occupied by the other part of the initial value which is really useful for the user is smaller; therefore, setting the end point value of the small range to a value greater than 0 can increase the range occupied by the initial value really useful to the user, thereby enabling the user to set the curvature of the curve more accurately.
For example, the interactive control is a dragging bar, the dragging bar comprises a slider and a progress bar, the original measuring range of the dragging bar is 0-10 mm, and the radius range of circles used by users is 6-9 mm; in this case, when the user draws a curve each time, the user can draw a curve with a curvature close to the target curvature of the user only by dragging the slider by approximately 60% of the length of the progress bar. By the method provided by the embodiment, the range of the dragging bar can be set to be 5-10 mm, and at this time, under the condition that the length of the progress bar is not changed, a user can draw a satisfactory curve only after dragging the slider by 10% of the length of the progress bar.
And after the user drags the slider to the vicinity of the target position, the user often needs to adjust the slider back and forth to select the most satisfactory curve, and at this time, under the condition that the length of the progress bar is unchanged and the distance for the user to slide the slider is the same, the change amount of the initial value set by the dragging bar with the length range of 5-10 mm is smaller than the change amount of the initial value set by the dragging bar with the length range of 0-10 mm, which means that the user can more accurately set the curvature of the curve by the dragging bar with the length range of 5-10 mm compared with the dragging bar with the length range of 0-10 mm.
Step 102, when the initial value is located in a first interval of the range, performing a first adjustment on the initial value to obtain an adjustment value, wherein when the initial value increases in the first interval, the adjustment value increases with the increase of the initial value, and the increase of the adjustment value is smaller than the increase of the initial value;
in this step, any two initial values in the first interval are taken, and the difference between two adjustment values corresponding to the two initial values is smaller than the difference between the two initial values. This means that, compared to the prior art method in which the initial value is directly used as the radius of the target circle, the radius increase speed of the circle with the adjustment value as the radius is reduced under the condition that the operation characteristics of the user on the interactive control are the same. Therefore, when the user operates the interactive control in the first interval, the curvature of the curve can be set more accurately.
Since the curvature of the circle directly using the initial value as the radius changes faster in the first half of the range and slower in the second half when the initial value linearly increases in the range, in an optional implementation manner of this embodiment, the first interval may be located in the first half or the middle of the range, so that the curvature of the curve drawn in the subsequent step changes more uniformly in the entire range.
Of course, in some applications where a curve with no need for a large degree of curvature is desired, the first interval may also be located in the middle-second half of the range. For example, as shown in the coordinate system shown in fig. 4, the horizontal axis represents the range of the interactive control, and the range of the range is 0-1 mm; the vertical axis represents the target radius in the subsequent step; the first interval is positioned in the middle and the rear half of the measuring range, and the initial value positioned in the first interval is sleeved with a formula 1- (1-x)3Then (x represents an initial value), obtaining an adjustment value; the straight line in the coordinate system represents the initial value and the curve represents the adjustment value. As can be seen from fig. 4, in the first interval, when the operation characteristics of the interactive control by the user are the same, the increase of the adjustment value is smaller than the increase of the initial value, so that when the user operates the interactive control in the first interval, the adjustment value is used as the target radius, and the curvature of the curve can be set more accurately.
Optionally, the ratio of the first interval in the measuring range is greater than a preset threshold.
In this embodiment, the larger the proportion of the first interval in the measuring range is, the wider the range in which the curvature can be accurately adjusted by the user is, and the better the user experience is. The preset threshold value can be 0.3, 0.5, 0.6, 0.8, 1 and the like, and can also be other values between 0 and 1.
Optionally, in the above embodiment, the first interval may be the same as the range of the measuring range. At this moment, when the user operates in the whole range of the interactive control, the curvature of the curve can be set more accurately.
Optionally, the range of the interactive control may further include a second interval, and when the initial value is located in the second interval of the range, the initial value is second adjusted to obtain an adjustment value, where when the initial value increases in the second interval, the adjustment value increases with the increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value.
In this embodiment, any two initial values in the second interval are taken, and the difference between the two adjustment values corresponding to the two initial values is greater than the difference between the two initial values. This means that, compared to the prior art method in which the initial value is directly used as the radius of the circle in the subsequent step, the increase speed of the radius of the circle with the adjustment value as the radius is increased under the condition that the operation characteristics of the user on the interactive control are the same. In this way, when the user operates the interactive control in the second interval, the target circle generated in the subsequent step can grow faster.
As shown in fig. 4, as an optional implementation manner of the foregoing embodiment, the endpoint value with the larger second interval is equal to the endpoint value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is greater than or equal to the adjustment value corresponding to the initial value in the second interval. In this case, when the second interval and the first interval constitute a continuous interval and the initial value linearly increases in the continuous interval, the adjustment value increases as the initial value increases. Therefore, in some application occasions without curves with large curvature, the target circle can be quickly unfolded into a circle with a size expected by a user, and then the curvature of the target circle is accurately adjusted in the first interval, so that the user experience is improved.
As another optional implementation manner of the foregoing embodiment, the end point value with the smaller second interval is equal to the end point value with the larger first interval, and the adjustment value corresponding to the initial value in the first interval is smaller than or equal to the adjustment value corresponding to the initial value in the second interval. In this case, the first interval and the second interval constitute a continuous interval, and when the initial value linearly increases in the continuous interval, the adjustment value increases as the initial value increases. Therefore, when the value of the initial value is large, the curvature change of the circle with the initial value as the radius is not obvious, and therefore, the method adopted by the embodiment can accelerate the curvature change of the target circle generated in the subsequent steps when the user operates at the rear section of the interactive control, and the user experience is improved.
Optionally, as shown in fig. 5 (a straight line in the figure represents an initial value, and a curve represents an adjustment value), the two embodiments may also be combined, so that when the initial value linearly increases in the range of the interactive control, the adjustment value that changes with the initial value first increases rapidly, then increases slowly, and finally increases rapidly.
Step 103, drawing a target circle by taking the adjustment value as a target radius;
in this embodiment, in the process that the adjustment value changes with the initial value, the target circle drawn with the adjustment value as the target radius also changes dynamically with the adjustment value. Alternatively, the target circles may be expanded with the center of the circle as a base point (i.e., the centers of the target circles coincide) or may be expanded with a certain point on the circumference as a base point, for example, as shown in fig. 1, the lowest end point on the circumference is expanded as a base point. Of course, the expansion can be performed in other manners, which is not limited in this embodiment.
Optionally, the drawing a target circle by using the adjustment value as a target radius may include: scaling the adjustment value according to a linear scaling coefficient to obtain a target radius; and drawing a target circle according to the target radius.
In this embodiment, when the adjustment value obtained in step 102 is smaller and does not match the size of the electronic device, a linear scaling coefficient larger than 1 may be set, and the adjustment value and the linear scaling coefficient are multiplied to obtain a target radius suitable for the size of the electronic device. For the same reason, when the adjustment value obtained in step 102 is larger, a linear scaling coefficient smaller than 1 may be set, and the adjustment value and the linear scaling coefficient are multiplied to obtain the target radius.
And 104, cutting the target circle by using the cutting frame to generate a target curve.
In this step, the trimming frame may be specified by a user, or may be generated according to a preset rule, for example, as shown in fig. 6, in an optional implementation manner of this embodiment, the target curve may be used as an arrangement path of a text in the text box, so that the whole text in the text box has a special bending effect; at this time, when the user inputs the text box, a cutting box adapted to the text box may be generated.
In the above embodiment, the user may input the text box before step 101, in which case, the size of the trimming box may be the same as the text box, and the arrangement position may coincide with the text box. In this way, as shown in fig. 1, when the target circle is drawn in step 102, the target circle may be drawn with the midpoint of the lower frame of the trimming frame as the lower endpoint of the target circle. And after the target circle is generated, cutting the target circle by using the cutting frame, and taking a curve positioned in the cutting frame as a target curve.
After the target curve is generated, the target curve is used as a layout path, and texts in the text box are uniformly arranged along the layout path, so that the texts in the text box have a special bending effect on the whole. Optionally, when the target curve is used as a layout path of a text, the target curve may be set to be transparent, so that the target curve does not affect the display effect of the text.
Of course, when the target curve is applied to other situations, the trimming frame may also be generated according to other manners, and after the trimming frame is generated, the user may also perform operations such as scaling, moving, rotating, and the like on the trimming frame, which is not limited in this embodiment; in the same way, the generation sequence between the trimming frame and the target circle is not limited in this embodiment, and may be set according to actual needs.
Optionally, the range of the interactive control may be dynamically changed along with the size of the trimming frame. For example: the end point value with the smaller measuring range is positively correlated with the width and/or height of the cutting frame; thus, when the cropping frame is enlarged, the smaller end point value of the interactive control is enlarged, so that a target circle with an initial radius positively correlated with the smaller end point value is adapted to the size of the cropping frame; in the same way, the end point value with the larger measuring range can also be positively correlated with the width and/or the height of the cutting frame, so that when the cutting frame becomes large, the end point value with the larger interaction control also becomes large, and the maximum radius and the target circle with the positive correlation of the end point value are adapted to the size of the cutting frame.
In the method for drawing a curve provided by this embodiment, an initial value input by a user through operating an interactive control is received, where the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and a terminal value of the interactive control with a smaller range is greater than or equal to 0; when the initial value is located in a first interval of the range, performing first adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the first interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is smaller than that of the initial value; drawing a target circle by taking the adjustment value as a target radius; and cutting the target circle by using the cutting frame to generate a target curve. In this way, compared with the method in the prior art in which the initial value is directly used as the radius of the target circle, when the user operates the interactive control in the first interval under the condition that the operating characteristics of the user on the interactive control are the same, the curvature of the curve can be set more accurately by using the adjustment value as the radius of the target circle.
In a second aspect, embodiments of the present invention further provide an apparatus for drawing a curve, which can more accurately set the curvature of the curve.
As shown in fig. 7, an embodiment of the present invention further provides an apparatus for plotting curves, including: the receiving module 21 is configured to receive an initial value input by a user through operation of an interactive control, where the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and a smaller endpoint value of the range is greater than or equal to 0; a first adjusting module 22, configured to perform a first adjustment on the initial value when the initial value is in a first interval of the range, so as to obtain an adjusted value, where when the initial value increases in the first interval, the adjusted value increases as the initial value increases, and an increase of the adjusted value is smaller than an increase of the initial value; a drawing module 23, configured to draw a target circle by using the adjustment value as a target radius; and the cutting module 24 is used for cutting the target circle by using the cutting frame to generate a target curve.
Optionally, the ratio of the first interval in the measuring range is greater than a preset threshold.
Optionally, the apparatus further comprises: a second adjusting module, configured to perform a second adjustment on the initial value when the initial value is in a second interval of the range, so as to obtain an adjustment value, where when the initial value increases in the second interval, the adjustment value increases with an increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value; the end point value with the larger second interval is equal to the end point value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is larger than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the apparatus further comprises: a second adjusting module, configured to perform a second adjustment on the initial value when the initial value is in a second interval of the range, so as to obtain an adjustment value, where when the initial value increases in the second interval, the adjustment value increases with an increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value; the end point value with the smaller second interval is equal to the end point value with the larger first interval, and the adjustment value corresponding to the initial value in the first interval is smaller than or equal to the adjustment value corresponding to the initial value in the second interval.
Optionally, the drawing module is specifically configured to: scaling the adjustment value according to a linear scaling coefficient to obtain a target radius; and drawing a target circle according to the target radius.
Optionally, the end point value with the smaller measuring range is positively correlated with the width and/or height of the cutting frame; and/or the end point value with the larger measuring range is positively correlated with the width and/or the height of the cutting frame.
Optionally, the apparatus further comprises: the cutting frame generating module is used for generating a cutting frame matched with the text frame according to the text frame input by a user before the cutting module cuts the target circle by using the cutting frame; and the arranging module is used for uniformly arranging the texts in the text boxes along the arranging path by taking the target curve as the arranging path after the target curve is generated by the cutting module.
Optionally, the interaction control includes at least one of: the initial value linearly changes within the measuring range of the sliding control according to the sliding length of the user on the sliding control; the initial value linearly changes within the range of the click control according to the number of times of clicking the click control by the user; the initial value linearly changes within the range of the long press control according to the press time of the long press control by the user; and the initial value linearly changes within the measuring range of the rotary control according to the rotation angle of the rotary control by the user.
In a third aspect, embodiments of the present invention further provide an electronic device, which can set the curvature of a curve more accurately.
Fig. 8 is a schematic structural diagram of an embodiment of an electronic device of the present invention, and as shown in fig. 8, the electronic device may include: the device comprises a shell 31, a processor 32, a memory 33, a circuit board 34 and a power circuit 35, wherein the circuit board 34 is arranged inside a space enclosed by the shell 31, and the processor 32 and the memory 33 are arranged on the circuit board 34; a power supply circuit 35 for supplying power to each circuit or device of the electronic apparatus; the memory 33 is used for storing executable program codes; the processor 32 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 33, and is used for executing the method for drawing a curve according to any one of the foregoing embodiments.
For the specific execution process of the above steps by the processor 32 and the steps further executed by the processor 32 by running the executable program code, reference may be made to the description of the foregoing embodiments, which are not described herein again.
The above electronic devices exist in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing computing service, the server comprises a processor, a hard disk, a memory, a system bus and the like, the server is similar to a general computer architecture, but the server has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing highly reliable service.
(5) And other electronic equipment with data interaction function.
Accordingly, an embodiment of the present invention further provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs can be executed by one or more processors to implement any one of the methods for drawing a curve provided in the foregoing embodiments, so that corresponding technical effects can also be achieved, which have been described in detail above and are not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group consisting of additional identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method of plotting curves, comprising:
receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within a range of the interactive control according to the operation of the user on the interactive control, and the end point value with a smaller range is greater than or equal to 0;
when the initial value is located in a first interval of the range, performing first adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the first interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is smaller than that of the initial value;
drawing a target circle by taking the adjustment value as a target radius;
and cutting the target circle by using the cutting frame to generate a target curve.
2. The method of claim 1, wherein the first interval has a ratio in the span range greater than a preset threshold.
3. The method of claim 1, further comprising:
when the initial value is located in a second interval of the measuring range, performing second adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the second interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is greater than that of the initial value;
the end point value with the larger second interval is equal to the end point value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is larger than or equal to the adjustment value corresponding to the initial value in the second interval.
4. The method of claim 1, further comprising:
when the initial value is located in a second interval of the measuring range, performing second adjustment on the initial value to obtain an adjustment value, wherein when the initial value is increased in the second interval, the adjustment value is increased along with the increase of the initial value, and the increase of the adjustment value is greater than that of the initial value;
the end point value with the smaller second interval is equal to the end point value with the larger first interval, and the adjustment value corresponding to the initial value in the first interval is smaller than or equal to the adjustment value corresponding to the initial value in the second interval.
5. The method according to any one of claims 1 to 4, wherein the drawing a target circle by using the adjustment value as a target radius comprises:
scaling the adjustment value according to a linear scaling coefficient to obtain a target radius;
and drawing a target circle according to the target radius.
6. The method according to claim 1, characterized in that the end point value of the smaller measuring range is positively correlated with the width and/or height of the cutting frame; and/or
The end point value with the larger measuring range is positively correlated with the width and/or height of the cutting frame.
7. The method of claim 1, wherein prior to trimming the target circle with a trimming frame, the method further comprises:
generating the cutting frame adaptive to the text box according to the text box input by the user;
after generating the target curve, the method further comprises:
and with the target curve as a layout path, uniformly arranging the texts in the text boxes along the layout path.
8. An apparatus for plotting curves, comprising:
the receiving module is used for receiving an initial value input by a user through operating an interactive control, wherein the initial value linearly changes within the range of the interactive control according to the operation of the user on the interactive control, and the end point value with the smaller range is greater than or equal to 0;
the first adjusting module is used for performing first adjustment on the initial value when the initial value is located in a first interval of the range to obtain an adjusting value, wherein when the initial value is increased in the first interval, the adjusting value is increased along with the increase of the initial value, and the increase of the adjusting value is smaller than that of the initial value;
the drawing module is used for drawing a target circle by taking the adjustment value as a target radius;
and the cutting module is used for cutting the target circle by using the cutting frame to generate a target curve.
9. The apparatus of claim 8 wherein the ratio of the first interval in the span range is greater than a preset threshold.
10. The apparatus of claim 8, further comprising:
a second adjusting module, configured to perform a second adjustment on the initial value when the initial value is in a second interval of the range, so as to obtain an adjustment value, where when the initial value increases in the second interval, the adjustment value increases with an increase of the initial value, and an increase of the adjustment value is greater than an increase of the initial value;
the end point value with the larger second interval is equal to the end point value with the smaller first interval, and the adjustment value corresponding to the initial value in the first interval is larger than or equal to the adjustment value corresponding to the initial value in the second interval.
CN201911093965.9A 2019-11-08 2019-11-08 Curve drawing method and device and electronic equipment Active CN111127583B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911093965.9A CN111127583B (en) 2019-11-08 2019-11-08 Curve drawing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911093965.9A CN111127583B (en) 2019-11-08 2019-11-08 Curve drawing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111127583A true CN111127583A (en) 2020-05-08
CN111127583B CN111127583B (en) 2024-01-12

Family

ID=70495213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911093965.9A Active CN111127583B (en) 2019-11-08 2019-11-08 Curve drawing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111127583B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113643410A (en) * 2021-08-24 2021-11-12 凌云光技术股份有限公司 GUI (graphical user interface) graphic control design method and device for positioning elliptic arc curve

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6417173A (en) * 1987-07-10 1989-01-20 Hitachi Ltd Circle/circular arc plotting and plotting method
CN102663749A (en) * 2012-03-28 2012-09-12 汕头大学 Ultrasonic image lesion segmentation technology based on phase information
CN105824531A (en) * 2016-03-15 2016-08-03 网易(杭州)网络有限公司 Method and device for adjusting numbers
CN109741419A (en) * 2018-11-20 2019-05-10 广州南方卫星导航仪器有限公司 A kind of method for drafting of center line of road, electronic equipment, storage medium and system
CN109783097A (en) * 2018-12-29 2019-05-21 南京控维通信科技有限公司 Draw the implementation method of web frequency diagram plug-in unit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6417173A (en) * 1987-07-10 1989-01-20 Hitachi Ltd Circle/circular arc plotting and plotting method
CN102663749A (en) * 2012-03-28 2012-09-12 汕头大学 Ultrasonic image lesion segmentation technology based on phase information
CN105824531A (en) * 2016-03-15 2016-08-03 网易(杭州)网络有限公司 Method and device for adjusting numbers
CN109741419A (en) * 2018-11-20 2019-05-10 广州南方卫星导航仪器有限公司 A kind of method for drafting of center line of road, electronic equipment, storage medium and system
CN109783097A (en) * 2018-12-29 2019-05-21 南京控维通信科技有限公司 Draw the implementation method of web frequency diagram plug-in unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113643410A (en) * 2021-08-24 2021-11-12 凌云光技术股份有限公司 GUI (graphical user interface) graphic control design method and device for positioning elliptic arc curve
CN113643410B (en) * 2021-08-24 2024-01-23 凌云光技术股份有限公司 GUI graphic control design method and device for positioning elliptical arc curve

Also Published As

Publication number Publication date
CN111127583B (en) 2024-01-12

Similar Documents

Publication Publication Date Title
EP2267581A1 (en) Method of dynamically adjusting long-press delay time, electronic device, and computer-readable medium
US20190138263A1 (en) Method and device for determining delay of audio
EP2875447A2 (en) Creating variations when transforming data into consumable content
CN113010063B (en) File previewing method and device, electronic equipment and storage medium
JP5953430B2 (en) Application character adjustment method, apparatus, terminal, program, and recording medium
EP3396563A1 (en) Network resource recommendation method and computer device
US20170277379A1 (en) Method and terminal for processing desktop icon
CN111127583A (en) Method and device for drawing curve and electronic equipment
CN104881224A (en) Method and device for adding cards
CN107978014B (en) Particle rendering method and device, electronic equipment and storage medium
CN103605521A (en) Method and device for realizing interface apposition
WO2017167163A1 (en) Browser theme changing method and apparatus, and electronic device
CN104750661A (en) Method and device for selecting words and sentences of text
CN115270737B (en) Method and device for modifying format of target object
CN111522610A (en) Information display method, device and equipment
CN109841232A (en) The extracting method of note locations and device and storage medium in music signal
KR101730114B1 (en) Apparatus, method, and computer program for viewing catoon data
CN112036149A (en) File editing method and device, electronic equipment and storage medium
CN109165065B (en) Method, device and equipment for processing word list
CN110727387B (en) Method, device and computer storage medium for determining user behavior data
CN109684010B (en) Information display method and device and electronic equipment
US9213681B2 (en) Method and system to modify source content to fit into a target display area in a browser
EP3371715A1 (en) Generating a deferrable data flow
CN110705242A (en) Method and device for manufacturing slide template and electronic equipment
CN104820695A (en) Method and device for resource acquisition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201130

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing 100123

Applicant after: Beijing LEMI Technology Co.,Ltd.

Address before: 100041 Beijing, Shijingshan District Xing Xing street, building 30, No. 3, building 2, A-0071

Applicant before: Beijing Cheetah Mobile Technology Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231211

Address after: 3870A, 3rd Floor, Building 4, Courtyard 49, Badachu Road, Shijingshan District, Beijing, 100144

Applicant after: Beijing Jupiter Technology Co.,Ltd.

Address before: 100123 room 115, area C, 1st floor, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing

Applicant before: Beijing LEMI Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant