Embodiment
Embodiments provide a kind of method that touch-screen output display touches person's handwriting, in order to improve the compatibility of handwriting input on touch-screen product.
See Fig. 1, the method that a kind of touch-screen output display that the embodiment of the present invention provides touches person's handwriting comprises step:
S101, according to preset interval duration sampled in user person's handwriting touch point on the touchscreen;
Corresponding person's handwriting line segment is determined in S102, the adjacent person's handwriting touch point obtained by sampling;
S103, corresponding live width according to the length of the up-to-date person's handwriting line segment determined, the length of the front person's handwriting line segment once determined and the front person's handwriting line segment once determined, obtain the live width of the described up-to-date person's handwriting line segment determined; Wherein, the live width of the person's handwriting line segment determined of sampling for the first time is preset value;
S104, by this up-to-date person's handwriting line segment determined of described live width output display.
Preferably, the described length according to the up-to-date person's handwriting line segment determined, the length of the front person's handwriting line segment once determined and the corresponding live width of the front person's handwriting line segment once determined, obtain the live width of the described up-to-date person's handwriting line segment determined, comprising:
According to the length of the up-to-date person's handwriting line segment determined, the length of the front person's handwriting line segment once determined and default interval duration, determine the touch speed of the up-to-date person's handwriting line segment determined, the touch speed of the front person's handwriting line segment once determined; Wherein, described touch speed is determined by the length of person's handwriting line segment corresponding to sample two adjacent touch points and the ratio of interval duration preset;
According to the touch speed of the described up-to-date person's handwriting line segment determined, the touch speed of the front person's handwriting line segment once determined, and the corresponding live width of the front person's handwriting line segment once determined, obtain the live width of the described up-to-date person's handwriting line segment determined.
Preferably, the touch speed of the touch speed of the up-to-date person's handwriting line segment determined that described basis calculates, the front person's handwriting line segment once determined and the corresponding live width of the front person's handwriting line segment once determined, obtain the live width of the described up-to-date person's handwriting line segment determined, specifically comprise:
Calculate the touch speed of user at the up-to-date person's handwriting line segment determined compared to the relative velocity rate of change of the touch speed of the front person's handwriting line segment once determined, according to the corresponding live width of this relative velocity rate of change and the front person's handwriting line segment once determined, determine the live width of the described up-to-date person's handwriting line segment determined.
Preferably, the described corresponding live width according to this relative velocity rate of change and the front person's handwriting line segment once determined, determine the live width of the described up-to-date person's handwriting line segment determined, specifically comprise:
When this relative velocity rate of change be on the occasion of time, the corresponding live width of the person's handwriting line segment once determined before reducing according to the size of this relative velocity rate of change, as the live width of the described up-to-date person's handwriting line segment determined;
When this relative velocity rate of change is negative value, the corresponding live width of the person's handwriting line segment once determined before increasing according to the size of this relative velocity rate of change, as the live width of the described up-to-date person's handwriting line segment determined.
Preferably, the described corresponding live width according to this relative velocity rate of change and the front person's handwriting line segment once determined, determine the live width of the described up-to-date person's handwriting line segment determined, specific formula for calculation is W
i=W
i-1(1-R
i);
Wherein:
W
ifor the live width of the up-to-date person's handwriting line segment determined;
W
i-1for the corresponding live width of the front person's handwriting line segment once determined;
R
ifor relative velocity rate of change.
Preferably, the method also comprises:
The coordinate range in the up-to-date coordinate of the person's handwriting touch point determined and the region of current input characters is compared, if this person's handwriting touch point is outside described coordinate range, then according to the coordinate range in the region of the current input characters of the coordinate renew of this person's handwriting touch point; Wherein, the coordinate range in the region of current input characters is the extreme value of coordinate in upper and lower, left and right all directions of all touch points of current input characters.
Preferably, after this up-to-date person's handwriting line segment determined of output display, the method also comprises:
If the sampling in the described interval duration of predetermined number there is no person's handwriting touch point, then determine that user is to current character end of input;
According to the coordinate range in the region of current input characters, this word is shown between two parties.
Provide several specific embodiments of the invention below.
Specific embodiment 1: utilize writing speed to adjust the thickness of person's handwriting, combine the writing style of majority, can well the product of compatible all support touch screens, because writing speed can calculate according to sampled point.
As Fig. 2, the concrete implementation step that a kind of touch-screen exports the method touching person's handwriting is as follows:
S201, terminal device gathers according to the touch point of time interval Δ T to user of presetting, and design sketch is see Fig. 2.
S202, mobile terminal determination current character write region;
The coordinate range in the up-to-date coordinate of the person's handwriting touch point determined and the region of current input characters is compared, if this person's handwriting touch point is outside described coordinate range, then according to the coordinate range in the region of the current input characters of the coordinate renew of this person's handwriting touch point;
Specific implementation process is: by the coordinate of first touch point stored in one group of named variable, and the implication of this group named variable is respectively left margin, right margin, coboundary, lower boundary;
The coordinate of newly-increased point is compared with named variable, if the horizontal ordinate of newly-increased point is less than left margin, or is greater than right margin, by this abscissa value stored in corresponding left margin or right margin; If the ordinate of newly-increased point is less than lower boundary, or is greater than coboundary, by this ordinate value stored in corresponding lower boundary or coboundary; What namely described named variable stored is the boundary information be input to so far.
S203, terminal device calculates adjacent touch point (X
i, Y
i) and (X
i-1, Y
i-1) between distance, and according to distance computing velocity S
i;
Screen area can be divided into coordinates regional by usual terminal device, and there is a corresponding coordinate each touch point, and the backstage of terminal device can calculate corresponding data according to the coordinate information of collection point.
Speed S
icomputing formula is
As Fig. 3, it is scene schematic diagram of the present invention.
S204, terminal device calculated description writing rate rate of change;
S
ifor the speed between up-to-date a pair touch point determined;
S
i-1for the speed between a pair touch point inputting before;
Δ S is S
iwith S
i-1velocity contrast;
R
ifor relative velocity rate of change;
Computing formula is
S205, terminal device calculating pen trace is wide;
W
ifor the live width between up-to-date a pair touch point determined;
W
i-1for the live width between a pair touch point inputting before;
Computing formula is W
i=W
i-1(1-R
i)
According to described computing formula, the relation of percentage speed variation and live width can be understood as: when user accelerates to write, relative velocity rate of change R
ifor on the occasion of, R
ivalue larger, live width is narrower, and namely person's handwriting can be lighter; When user slows down writing speed, relative velocity rate of change R
ifor negative value, R
ivalue less, live width is wider, and namely person's handwriting can be denseer; The method is consistent with the writing style of user.
Especially, the live width between first pair of touch point can be preset as fixing value, also can according to the speed between first pair of touch point, according to the relation of the speed preset with live width, determines the live width of correspondence.
S206, the person's handwriting of this person's handwriting live width of terminal output display, and word is shown between two parties;
The person's handwriting of this person's handwriting live width of terminal output display;
When not collecting touch point in the time interval that terminal detects continuous multiple Δ T, terminal thinks user's current character end of input;
Terminal, according to the border of S202 step determination input characters, adjusts the viewing area of word and is shown between two parties by word.
Specific embodiment 2: because the temporal frequency of sampling is fixing, live width is calculated according to user writing percentage speed variation, the change calculations live width of the distance between mathematically can being reduced to according to the touch point of user, namely the step S203 of specific embodiment 1, S204, S205 are simplified, the rate of change of distance between the touch point directly calculating user, according to this rate of change determination person's handwriting live width.The method process is more simple, decreases the computational load of terminal device.
What the program and the scheme of specific embodiment 1 reached is identical technique effect.
A kind of mobile terminal that the embodiment of the present invention provides comprises:
Sampling module, for sampling to user person's handwriting touch point on the touchscreen according to the interval duration preset;
First determination module, corresponding person's handwriting line segment is determined in the adjacent person's handwriting touch point for being obtained by sampling;
Second determination module, for the length of the length according to the up-to-date person's handwriting line segment determined, the front person's handwriting line segment once determined and the corresponding live width of the front person's handwriting line segment once determined, obtains the live width of the described up-to-date person's handwriting line segment determined;
Display module, for by this up-to-date person's handwriting line segment determined of described live width output display.
Preferably, the second determination module specifically for:
According to the length of the up-to-date person's handwriting line segment determined, the length of the front person's handwriting line segment once determined and default interval duration, determine the touch speed of the up-to-date person's handwriting line segment determined, the touch speed of the front person's handwriting line segment once determined;
According to the touch speed of the described up-to-date person's handwriting line segment determined, the touch speed of the front person's handwriting line segment once determined, and the corresponding live width of the front person's handwriting line segment once determined, obtain the live width of the described up-to-date person's handwriting line segment determined.
Preferably, second determination module is used for the corresponding live width according to the touch speed of the up-to-date person's handwriting line segment determined, the touch speed of the front person's handwriting line segment once determined and the front person's handwriting line segment once determined, when obtaining the live width of the described up-to-date person's handwriting line segment determined, specifically for:
Calculate the touch speed of user at the up-to-date person's handwriting line segment determined compared to the relative velocity rate of change of the touch speed of the front person's handwriting line segment once determined, according to the corresponding live width of this relative velocity rate of change and the front person's handwriting line segment once determined, determine the live width of the described up-to-date person's handwriting line segment determined.
Preferably, the second determination module is used for the corresponding live width according to this relative speed rate of change and the front person's handwriting line segment once determined, when determining the live width of the described up-to-date person's handwriting line segment determined, specifically for:
When this relative velocity rate of change be on the occasion of time, the corresponding live width of the person's handwriting line segment once determined before reducing according to the size of this relative velocity rate of change, as the live width of the described up-to-date person's handwriting line segment determined;
When this relative velocity rate of change is negative value, the corresponding live width of the person's handwriting line segment once determined before increasing according to the size of this relative velocity rate of change, as the live width of the described up-to-date person's handwriting line segment determined.
Preferably, the second determination module is used for the corresponding live width according to this relative speed rate of change and the front person's handwriting line segment once determined, when determining the live width of the described up-to-date person's handwriting line segment determined, specific formula for calculation is W
i=W
i-1(1-R
i);
Wherein:
W
ifor the live width of the up-to-date person's handwriting line segment determined;
W
i-1for the corresponding live width of the front person's handwriting line segment once determined;
R
ifor relative velocity rate of change.
Preferably, this mobile terminal also comprises:
Area determination module, for the coordinate range of the up-to-date coordinate of the person's handwriting touch point determined and the region of current input characters is compared, if this person's handwriting touch point is outside described coordinate range, then according to the coordinate range in the region of the current input characters of the coordinate renew of this person's handwriting touch point.
Preferably, display module be used for by after this up-to-date person's handwriting line segment determined of described live width output display, also for:
If the sampling in the described interval duration of predetermined number there is no person's handwriting touch point, then determine that user is to current character end of input;
According to the coordinate range in the region of current input characters, this word is shown between two parties.
In sum, embodiments provide a kind of method that touch-screen output display touches person's handwriting, for using the writing speed of stroke as input parameter to calculate thickness and the vigour of style in writing of stroke, be applicable to any type of touch-screen, improve the compatibility of handwriting input on different touch-screen product.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory and optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.