A kind of display packing realizing handwriting input on touch screen and display deviceTechnical field
The present invention relates to computer graphics disposal technology field, in particular it relates to one realizes hand-written defeated on touch screenThe display packing entered and display device.
Background technology
Owing to touch screen can unite two into one with display screen, and replace keyboard and realize the input of information, therefore also becomeOne of indispensable device of electronic equipment, such as mobile phone and panel computer etc. at present.Along with popularizing of touch screen, drive hand-written defeatedThe extensive application entered, former handwriting, as the important interactive session of handwriting input, is gradually favored by users.Former person's handwriting bookWriting technology the most on an electronic device, a series of coordinate datas received according to touch screen, write on paper for pen by simulationCurvilinear path, draws out the pictorial pattern technology that user expects to see the most on a display screen.
Carrying out in graph processing technique existing for former handwriting, main emphasis is how to solve handwriting traceThe problem of curve smoothing, generally uses shellfish hereby (Bezier) curve to carry out the track that matching is write.But also do not have correlation techniqueConsider how that the pen optimizing handwriting trace is thick, in order to make the stroke writing figure finally shown more true and attractive in appearance, especiallyIt is when using finger to carry out handwriting input, it is impossible to write out character and graphic attractive in appearance as using brush pen.
Summary of the invention
For aforementioned problem of the prior art, the invention provides a kind of display side realizing handwriting input on touch screenMethod and display device, set handwriting trace by the pressure sensitivity value obtained according to touch coordinate point is carried out pressure sensitivity simulation processPen thick so that the stroke writing figure of final display is more true and attractive in appearance, carry out hand-written even with fingerInput, also can write out character and graphic attractive in appearance as using brush pen, and then can bring preferably experience to user, it is simple to be realBorder promotion and application.
The technical solution used in the present invention, on the one hand provides a kind of display side realizing handwriting input on touch screenMethod, comprises the steps: that S101. obtains the pixel size value S of display screenpSlightly it is worth with target pen;S102. gather when unitBetween endogenous cause of ill is hand-written and the touch coordinate point that is touched, and obtain touch coordinate dot information, described touch coordinate dot information includes touchingTouch the coordinate figure of coordinate points size value and each touch coordinate point;S103. all touching is calculated according to described touch coordinate dot informationTouch total distance length L of coordinate pointsTD, and pressure sensitivity value P of current one time is calculated according to equation belowt:
In formula, N is the touch coordinate point sum collected in the current one time;S104. for touch coordinate point each described,According to the distance of the initial touch coordinate points in corresponding touch coordinate point to current one time, interpolation obtains corresponding touch pointSingle-point pressure sensitivity value, in Interpolation Process, with pressure sensitivity value P of previous unit interval0For initial pressure sensitivity value, with the current one timePressure sensitivity value PtFor terminating pressure sensitivity value;S105. for touch coordinate point each described, by corresponding described single-point pressure sensitivity value and instituteStating target pen to be slightly worth and be multiplied, the display pen obtaining corresponding touch coordinate point is slightly worth, and then set obtains by all touch coordinate pointsThe line segment figure constituted;S106. by described line segment images outputting to display screen, it is achieved instant playback.
Optimizing, in described step S102, the length of described unit interval is not more than 40ms.
Optimize, also comprised the steps: to use Douglas-Pu Ke evacuating algorithm to institute before described step S103State touch coordinate point to be diluted processing, simplify described touch coordinate dot information.Optimize further, draw in described employing DougDescribed touch coordinate point is diluted in the step processed by Si-Pu Ke evacuating algorithm, sets dilution threshold value as M times of described picture numberSpot size value Sp, wherein, M is the natural number between 1~3.
Optimize, before described step S106, also comprise the steps: that described line segment figure is carried out secondary shellfish the most bentThe round and smooth process of line, makes the threshold value of described line segment figure less than or equal to K times of described picture number spot size value Sp, wherein, K is between 1~the natural number between 3.
The technical solution used in the present invention, on the other hand provides a kind of display dress realizing handwriting input on touch screenPut, it is characterised in that include the acquiring unit being sequentially connected with, collecting unit, computing unit, interpolating unit, aggregation units and showShow unit;Described acquiring unit, for obtaining the pixel size value S of display screenpSlightly it is worth with target pen;Described collecting unit,For gathering touch coordinate point that is hand-written in unit interval endogenous cause of ill and that be touched, and obtain touch coordinate dot information, described touchCoordinate points information includes the coordinate figure of touch coordinate spot size value and each touch coordinate point;Described computing unit, for basisDescribed touch coordinate dot information calculates total distance length L of all touch coordinate pointsTD, and calculate current one according to equation belowPressure sensitivity value P of timet:
In formula, N is the touch coordinate point sum collected in the current one time;Described interpolating unit, for for each instituteStating touch coordinate point, according to the distance of the initial touch coordinate points in corresponding touch coordinate point to current one time, interpolation obtainsTo the single-point pressure sensitivity value of corresponding touch point, in Interpolation Process, with pressure sensitivity value P of previous unit interval0For initial pressure sensitivity value,Pressure sensitivity value P with the current one timetFor terminating pressure sensitivity value;Described aggregation units, is used for for touch coordinate point each described,Corresponding described single-point pressure sensitivity value being slightly worth with described target pen and be multiplied, the display pen obtaining corresponding touch coordinate point is slightly worth, soRear set obtains the line segment figure being made up of all touch coordinate points;Described display unit, for line chart described in instant playbackShape.
Optimize, also include the dilution unit being connected between described collecting unit and described computing unit;Described dilutionUnit, is used for using Douglas-Pu Ke evacuating algorithm to be diluted described touch coordinate point processing, simplifies described touch and sitPointing information.
Optimize, also include the round and smooth processing unit being connected between described aggregation units and described display unit;DescribedRound and smooth processing unit, for described line segment figure is carried out the round and smooth process of secondary Bezier curve, makes the threshold value of described line segment figureLess than or equal to K times of described picture number spot size value Sp, wherein, K is the natural number between 1~3.
To sum up, a kind of display packing realizing handwriting input on touch screen provided by the present invention and display dress are usedPut, have the advantages that the pressure sensitivity value that (1) obtains by touch coordinate point is carried out pressure sensitivity simulation process sets bookThe pen writing track is thick, so that the stroke writing figure of final display is more true and attractive in appearance, enters even with fingerRow handwriting input, also can write out character and graphic attractive in appearance as using brush pen;(2) consider during the thick setting of pen aobviousThe picture number size of display screen, can make the stroke writing figure finally shown have optimal resolution, increases display furtherAesthetic;(3) by touch coordinate point being diluted process, the operand of subsequent treatment can be simplified, ensureing the most aobviousShow final line segment figure, fast response time;(4) by line segment figure being carried out the round and smooth process of secondary Bezier curve, Ke YibaoThe flatness of barrier line segment figure, further such that the stroke writing figure of final display is more true and attractive in appearance;(5) can giveUser brings preferably experience, it is simple to actual promotion and application.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existingIn having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is only thisSome embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible toOther accompanying drawing is obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the display packing realizing handwriting input on touch screen that the present invention provides.
Fig. 2 is based on described display packing the final display effect schematic diagram that the present invention provides.
Fig. 3 is the structural representation of the display device realizing handwriting input on touch screen that the present invention provides.
Detailed description of the invention
Hereinafter with reference to accompanying drawing, hand-written by way of example realizing on touch screen of describing that the present invention provides in detailThe display packing of input and display device.At this it should be noted that the explanation for these way of example is adapted to assist in reasonSolve the present invention, but be not intended that limitation of the invention.
The terms "and/or", a kind of incidence relation describing affiliated partner, can there are three kinds of passes in expressionSystem, such as, A and/or B, can represent: individualism A, individualism B, there is tri-kinds of situations of A and B, the terms simultaneously"/and " it is to describe another kind of affiliated partner relation, two kinds of relations, such as, A/ and B can be there are, can represent: individually deposit in expressionIn two kinds of situations of A, individualism A and B, it addition, character "/" herein, typically represent forward-backward correlation and close liking a kind of "or"System.
Embodiment one
Fig. 1 shows the schematic flow sheet of the display packing realizing handwriting input on touch screen that the present invention provides, Fig. 2Show based on described display packing the final display effect schematic diagram that the present invention provides.It is described tactile that the present embodiment providesRealize the display packing of handwriting input on control screen, comprise the steps.
S101. the pixel size value S of display screen is obtainedpSlightly it is worth with target pen.
In step S101, described picture number spot size value SpFor being used for showing that final stroke writing figure is (that is follow-upLine segment figure) display screen in the size of minimum display unit (i.e. as several points), it can be by reading the hardware of display screenParameter acquiring.Described target pen is slightly worth closely related with the thickness of final stroke writing figure display degree, and it can be inputPreset value may also be default value.
S102. gather touch coordinate point that is hand-written in unit interval endogenous cause of ill and that be touched, and obtain touch coordinate dot information,Described touch coordinate dot information includes the coordinate figure of touch coordinate spot size value and each touch coordinate point.
In step s 102, by touch screen controller (touch screen includes touch detecting apparatus and touch screen controller) in the futureBe converted to touch point coordinate from the touch information of touch detecting apparatus, thus obtain and be touched because of hand-written in handwriting areaTouch coordinate point.Described hand-written mode can be, but not limited to as using felt pen handwriting input or using finger handwriting input(now touch screen is preferably capacitance touch screen).Described touch coordinate spot size value is that in touch screen, minimum touch unit is (the most tactileTouch a little) size, its can by read touch screen hardware parameter obtain.In addition optimize, in described step S102, instituteThe length stating the unit interval is not more than 40ms.The number of times that thus can make collection per second is higher than 25 times, and then makes finally in displayThe image frame per second (comprising follow-up line segment graphical content) of screen display is higher than 25 frames/second, makes the naked eyes cannot perception graphic frameConversion, ensures the sensory experience to display content.
S103. total distance length L of all touch coordinate points is calculated according to described touch coordinate dot informationTD, and according to such asLower formula calculates pressure sensitivity value P of current one timet:
In formula, N is the touch coordinate point sum collected in the current one time.
In step s 102, according to touch coordinate spot size value in described touch coordinate dot information and each touch coordinate pointCoordinate figure calculate total distance length L of all touch coordinate pointsTD, its unit is mm.Owing to collecting in the current one timeTouch coordinate point sum may be the most, processing speed can be affected, therefore optimize, also include before described step S103Following steps: use Douglas-Pu Ke evacuating algorithm to be diluted described touch coordinate point processing, simplify described touch and sitPointing information.Described Douglas-Pu Ke evacuating algorithm is a kind of existing and for clicking on the graph data of bulk redundancyRow compression is with the method extracting necessary data point, and it is as follows that this algorithm realizes taking out dilute process: the first and last point of curve is virtually connected by (1)Straight line, ask on curve a little with the distance of straight line, and find out maximum range value dMax, use dMaxWith the most given threshold valueD compares;(2) if dMax< D, then all cast out the intermediate point on this curve, then using near as curve of this straightwaySeemingly, this section of curve processing is complete;(3) if dMax>=D, then retain dMaxCorresponding coordinate points, and with this point as boundary, curve is divided intoThese two parts are reused the method by two parts, i.e. repeat (1) and (2) step, until meeting dMax< D, i.e. completes curveTake out dilute.
Due to described Douglas-Pu Ke evacuating algorithm to take out dilute precision closely related with threshold value D, threshold value is the biggest, simplifiesDegree is the biggest, and it is the most that point reduces, otherwise, abbreviation degree is the lowest, and it is the most that point retains, and shape the most more tends to virgin curve.ThereforeOptimize further, at described employing Douglas-Pu Ke evacuating algorithm, described touch coordinate point is diluted the step processedIn Zhou, set dilution threshold value as M times of described picture number spot size value Sp, wherein, M is the natural number between 1~3.Thus lead toCross and be diluted touch coordinate point processing, the operand of subsequent treatment can be simplified, ensure and quickly show final line chartShape, fast response time.Additionally, during the calculating of dilution process and pressure sensitivity value, all consider the picture number size of display screen, canSo that the stroke writing figure of final display has optimal resolution, increase the aesthetic of display further.
S104. for touch coordinate point each described, according to initiateing in corresponding touch coordinate point to current one timeThe distance of touch coordinate point, interpolation obtains the single-point pressure sensitivity value of corresponding touch point, in Interpolation Process, with the previous unit intervalPressure sensitivity value P0For initial pressure sensitivity value, with pressure sensitivity value P of current one timetFor terminating pressure sensitivity value.
In step S104, the interpolation algorithm used can be, but not limited to as discrete smooth interpolation method (DiscreteSmooth Interpolation) or trend surface smooth interpolation method (Trend Surface), touch such that it is able to precision obtains eachTouch the corresponding single-point pressure sensitivity value of coordinate points.
S105. for touch coordinate point each described, corresponding described single-point pressure sensitivity value is slightly worth phase with described target penTaking advantage of, the display pen obtaining corresponding touch coordinate point is slightly worth, and then gathers the line segment figure obtaining being made up of all touch coordinate points.
S106. by described line segment images outputting to display screen, it is achieved instant playback.
In step s 106, described display screen can be, but not limited to LCDs or LED display.Optimize, in instituteAlso comprise the steps: before stating step S106 described line segment figure is carried out the round and smooth process of secondary Bezier curve, make described lineThe threshold value of segment figure is less than or equal to K times of described picture number spot size value Sp, wherein, K is the natural number between 1~3.Pass throughLine segment figure is carried out the round and smooth process of secondary Bezier curve, can be with the flatness of security system segment figure, can be further such thatThe stroke writing figure of display is more true and attractive in appearance eventually.
By abovementioned steps S101 to S106, not only can realize the display of handwriting input on the touchscreen, it is also possible to logicalCross pressure sensitivity value touch coordinate point being carried out pressure sensitivity simulation process and obtain thick to the pen setting handwriting trace, so thatThe stroke writing figure of final display is more true and attractive in appearance, carries out handwriting input even with finger, also can write out pictureUse the character and graphic that brush pen is the most attractive in appearance, and then preferably experience can be brought to user, it is simple to actual promotion and application.
To sum up, the display packing realizing handwriting input on touch screen that the present embodiment is provided, there is following technology effectReally: the pen that the pressure sensitivity value that (1) obtains by touch coordinate point is carried out pressure sensitivity simulation process sets handwriting trace is thick, permissibleMake the stroke writing figure finally shown more true and attractive in appearance, carry out handwriting input even with finger, also can writeGo out character and graphic attractive in appearance as using brush pen;(2) consider during the thick setting of pen display screen as number size, canSo that the stroke writing figure of final display has optimal resolution, increase the aesthetic of display further;(3) by rightTouch coordinate point is diluted processing, and can simplify the operand of subsequent treatment, ensures and quickly shows final line segment figure, ringsAnswer speed fast;(4) by line segment figure being carried out the round and smooth process of secondary Bezier curve, can with the flatness of security system segment figure,Can be further such that the stroke writing figure of final display be more true and attractive in appearance;(5) can bring preferably to userExperience, it is simple to actual promotion and application.
Embodiment two
Fig. 3 shows the structural representation of the display device realizing handwriting input on touch screen that the present invention provides.ThisEmbodiment provides the display dress of a kind of display packing realizing handwriting input on touch screen realized described by embodiment onePut, including the acquiring unit being sequentially connected with, collecting unit, computing unit, interpolating unit, aggregation units and display unit;DescribedAcquiring unit, for obtaining the pixel size value S of display screenpSlightly it is worth with target pen;Described collecting unit, for gathering at listThe touch coordinate point that bit time endogenous cause of ill is hand-written and is touched, and obtain touch coordinate dot information, described touch coordinate dot information bagInclude the coordinate figure of touch coordinate spot size value and each touch coordinate point;Described computing unit, for according to described touch coordinateDot information calculates total distance length L of all touch coordinate pointsTD, and the pressure sensitivity value of current one time is calculated according to equation belowPt:
In formula, N is the touch coordinate point sum collected in the current one time;Described interpolating unit, for for each instituteStating touch coordinate point, according to the distance of the initial touch coordinate points in corresponding touch coordinate point to current one time, interpolation obtainsTo the single-point pressure sensitivity value of corresponding touch point, in Interpolation Process, with pressure sensitivity value P of previous unit interval0For initial pressure sensitivity value,Pressure sensitivity value pressure sensitivity value P with the current one timetFor terminating pressure sensitivity value;Described aggregation units, for for touch each describedCoordinate points, is slightly worth corresponding described single-point pressure sensitivity value with described target pen and is multiplied, and obtains the first reality of corresponding touch coordinate pointBorder pen is slightly worth, and then set obtains the line segment figure being made up of all touch coordinate points;Described display unit, for instant playbackDescribed line segment figure.
Optimize, also include the dilution unit being connected between described collecting unit and described computing unit;Described dilutionUnit, is used for using Douglas-Pu Ke evacuating algorithm to be diluted described touch coordinate point processing, simplifies described touch and sitPointing information.
Optimize, also include the round and smooth processing unit being connected between described aggregation units and described display unit;DescribedRound and smooth processing unit, for described line segment figure is carried out the round and smooth process of secondary Bezier curve, makes the threshold value of described line segment figureLess than or equal to K times of described picture number spot size value Sp, wherein, K is the natural number between 1~3.
The technique effect of the described display device realizing handwriting input on touch screen that the present embodiment provides, can basisThe technique effect of embodiment one is known, repeats no more in this.
As it has been described above, the present invention can preferably be realized.For a person skilled in the art, according to the religion of the present inventionLeading, the display packing realizing handwriting input on touch screen and the display device of designing multi-form are not required to creativenessWork.Without departing from the principles and spirit of the present invention these embodiments are changed, revise, replace, integrate andModification still falls within protection scope of the present invention.