Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is a kind of flow chart of one embodiment of the processing method of vector graphics provided by the present invention, this implementation
The method that example is provided is applied to the situation that the vector graphics of drafting is acquired and played back, and this method can be by vector graphics
Processing unit is performed.As shown in figure 1, the method for the present embodiment can include:
S110, receives acquisition instructions.
In the present embodiment, generally the drafting of vector graphics can be carried out by vector image software, and can received
The acquisition instructions that user sends, realize the recording to the vector graphics in drafting.
S120, the touch sensible signal for obtaining user's triggering screen and generating, and according to the acquisition instructions and the touch sense
Induction signal, is acquired to the vector graphics drawn on painting canvas, obtains the first dynamic vector graphics.
In the present embodiment, so that the processing unit of vector graphics is the terminal device with touch-screen as an example, with to figure
Drafting illustrate:When user starts the graphing in blank canvas, when finger starts to touch screen, and slide
When, equipment obtains user and touches screen and the touch sensible signal that generates, and the acquisition instructions that are triggered according to user before and touches
Induced signal is touched, the vector graphics drawn on painting canvas is acquired, the first dynamic vector graphics are obtained.
S130, according to first dynamic vector graphics, obtains corresponding first dynamic data frame, and by first dynamic number
It is stored according to frame in vector data file;The first dynamic data frame includes the corresponding arrow of the first dynamic vector graphics of the collection
Data, the very first time and dynamic vector graphics mark are measured, the very first time includes the time that the user touches the screen, or should
The duration that user slides on the screen.
In the present embodiment, to the recording of vector graphics, the collection to vector graphics and record, prior art are generally basede on
Middle collection is the corresponding picture frame of vector graphics with preserve, can take larger memory space;The side that the present embodiment is provided
In method, corresponding dynamic data frame is obtained according to the first dynamic vector graphics of collection, the data frame includes first and moved
The corresponding vector data of state vector figure, the very first time and dynamic vector graphics mark, Fig. 2 are provided by the embodiment of the present invention
A kind of structural representation of data frame;Specifically, vector data is relative coordinate and the combination of the dynamic vector graphics in drawing
Rule is converted to the well-regulated serial data that numeral and letter are formed, and vector data and vector graphics can be by certain
Algorithmic rule is mutually changed, and the time that the very first time draws for the first dynamic vector graphics of record, specially user touch should
The time of screen, or the duration that user slides on the screen.Unlike the prior art, by the first dynamic in the present embodiment
Vector graphics is converted to after data frame, to be stored in the form of data structure in vector data file, reduces memory space
Take.
The processing method for the vector graphics that the present embodiment is provided, by the acquisition instructions of reception and user's triggering screen
Dynamic vector graphics in drafting are acquired by the touch sensible signal of generation, and the dynamic vector graphics of collection are changed
For the form of dynamic data frame, by dynamic vector graphics to be stored in the form of data structure in vector data file, solve
The problem of causing memory space increase in the way of picture frame storage vector graphics in the prior art, reduces storage polar plot
The memory space that shape takes, and improve the performance for the terminal device for recording vector graphics.
Further, in another embodiment of the present invention, on the basis of above-mentioned embodiment illustrated in fig. 1, this method
Also include:
If active user stops touching the screen, the first static vector graphics on current painting canvas is gathered, and according to this
All static polar plots preserved in first static vector graphics, or the first static vector graphics and vector data file
Shape, obtains corresponding first static data frame, and the first static data frame is stored in the vector data file;Wherein,
One static data frame includes the corresponding vector data of the first static state vector graphics, the second time and the static vector graphics mark;
Or, the first static data frame includes the corresponding vector data of the first static state vector graphics, all static state preserved before
The corresponding vector data of vector graphics, second time and the static vector graphics mark;Second time included the current user
Stop touching the screen corresponding time.
It should be noted that the vector graphics that active user draws is dynamic vector graphics, when user terminates current dynamic
During the drafting of vector graphics, the dynamic vector graphics are changed into static vector graphics.
A kind of vector graphics that Fig. 3 methods shown in Fig. 1 of the present invention are provided, Fig. 4 methods shown in Fig. 1 of the present invention are carried
The corresponding vector data file of vector graphics of confession, the process of vector graphics as shown in Figure 3, explanation are drawn with user on painting canvas
The processing method for the vector graphics that the present embodiment is provided;When user triggers one position of point of screen, at the time of this is triggered
Start to record vector graphics, generate data frame 1, data frame 1 is identified including dynamic vector graphics, and the corresponding time touches including finger
Touch the time of screen point one, vector data includes line one(Point one)Corresponding vector data, similarly, can obtain vector data
Data frame 2~8 in file;It should be noted that data frame 4, which is user, stops what is being generated during to the drafting of line one, line one by
Dynamic vector graphics are converted into static vector graphics, therefore, and data frame 3 is identical with 4 vector data, and pattern identification and time are not
Together;In addition, data frame 8, which is user, stops what is being generated during the drafting to line two, now, line two is converted into quiet by dynamic vector graphics
State vector figure, different from above-mentioned data frame 4, the vector data of data frame 8 includes line two and is converted into static vector graphics
When the corresponding vector data and corresponding vector data of static vector graphics line one that preserves before;When implementing, data
Frame also includes separator, for being separated to the sentence between two data frames, when reading vector data file, to separate
Accord with as the interval read and parsed to data frame, when vector data file completes to record, the separation of last data frame
Symbol is cut-off symbol.
The present embodiment provide vector graphics processing method, for dynamic vector graphics collection to currently drawing
The record of dynamic vector graphics, the collection for static vector graphics is not only remembered to the static vector graphics being currently generated
Record, and all static vector graphics preserved on painting canvas are recorded.
Fig. 5 is a kind of flow chart of another embodiment of the processing method of vector graphics provided by the present invention.Such as Fig. 5
Shown, the method for the present embodiment can include:
S210, receives acquisition instructions.
S220, the touch sensible signal for obtaining user's triggering screen and generating, and according to the acquisition instructions and the touch sense
Induction signal, is acquired to the vector graphics drawn on painting canvas, obtains the first dynamic vector graphics.
S230, according to first dynamic vector graphics, obtains corresponding first dynamic data frame, and by first dynamic number
It is stored according to frame in vector data file;The first dynamic data frame includes the corresponding arrow of the first dynamic vector graphics of the collection
Data, the very first time and dynamic vector graphics mark are measured, the very first time includes the time that the user touches the screen, or should
The duration that user slides on the screen.
S240, if the current user stops touching the screen, gathers the first static vector graphics on current painting canvas, and
According to the first static vector graphics, or all static state preserved in the first static vector graphics and the vector data file
Vector graphics, obtains corresponding first static data frame, and the first static data frame is stored in the vector data file;
The corresponding vector number of all static vector graphics that the first static data frame includes the first static vector graphics and preserved
According to, the second time and static vector graphics mark.
S250, receives edit instruction, and the edit instruction includes M vector graphics to be edited and corresponding editor ginseng
Number.
In the processing method for the vector graphics that the present embodiment is provided, user can also enter to the vector graphics for having completed to draw
Edlin, completed vector graphics is static vector graphics before editor, for example, user can be to completed on painting canvas
M vector graphics sends edit instruction, and the M vector graphics to be edited and corresponding editor ginseng are included in the edit instruction
Number.
S260, successively according to the editing parameter, on the painting canvas, Editorial Services is carried out to corresponding vector graphics to be edited
Reason, and the vector graphics of editor is acquired successively, obtain corresponding second dynamic vector graphics.
S270, according to M the second dynamic vector graphics, obtains corresponding second dynamic data frame, and by second dynamic
Data frame is stored in vector data file;The second dynamic data frame includes the M corresponding vectors of the second dynamic vector graphics
Data sum, the 3rd time and dynamic vector graphics mark, the 3rd time compile including the vector graphics to be edited to this
Collect the duration of processing.
In the present embodiment, the M vector graphics to be edited that it is indicated, this M static arrow are selected according to edit instruction
Spirogram shape is changed into dynamic vector graphics, also, according to the editing parameter in establishment instruction to M motion vector figure having selected
Shape carries out editing and processing;Can be user to the arrow that has selected to the editing and processing of the vector graphics of selection when implementing
The editor of spirogram shape, such as stretching, mobile, change color and shape, accordingly, re-starts to the vector graphics after editor
Collection, obtains corresponding second dynamic vector graphics and is stored in vector data file;Another middle arrow that the present embodiment is provided
The processing method of spirogram shape, to the editing and processing of the vector graphics selected, can also be user by preset algorithmic rule,
Edlin is entered to the corresponding vector data of the vector graphics selected in vector aspect, what is specifically edited is the interior of vector data
Hold, correspondingly, directly separately have the data frame after editor in vector data file.
The processing method for the vector graphics that the present embodiment is provided, by the acquisition instructions of reception and user's triggering screen
Dynamic vector graphics in drafting are acquired by the touch sensible signal of generation, and the dynamic vector graphics of collection are changed
For the form of dynamic data frame, by dynamic vector graphics to be stored in the form of data structure in vector data file, solve
The problem of causing memory space increase in the way of picture frame storage vector graphics in the prior art, reduces storage polar plot
The memory space that shape takes, and improve the performance for the terminal device for recording vector graphics.In addition, according to the editor of reception
The selection to vector graphics and editor are instructed, is also the corresponding data frame of vector graphics due to what is preserved after editor, therefore, to arrow
The editor of spirogram shape can ensure the resolution ratio of figure, it is ensured that the display effect of vector graphics;Further, in vector graphics
Recording process in, when vector graphics changes, just it is acquired and data frame conversion and storage, solve existing
The corresponding picture frame of vector image of intercepting and capturing per second is preserved in technology, the problem of causing storage mass of redundancy data, reduces and deposits
Store up the waste in space.
Further, in another embodiment of the present invention, on the basis of embodiment illustrated in fig. 5, this method may be used also
With including:
Other vector graphics on S280, collection painting canvas in addition to vector graphics to be edited, according to other vector graphics,
Corresponding second static data frame is obtained, and the second static data frame is stored in vector data file;Wherein, second is static
Data frame includes the corresponding vector data sum of other vector graphics, the 4th time and static vector graphics mark;When the 4th
Between for user select first vector graphics to be edited time.
It should be noted that the static vector graphics that editor has been completed on painting canvas is more than or equal to M, wherein in edit instruction
Including M static vector graphics be converted to dynamic vector graphics, though other the static vector graphics not included in edit instruction
Do not change so, but gather and change, it is necessary to be re-started to it according to the edit instruction to vector graphics on painting canvas
Preserved for data frame.
Fig. 6 is a kind of flow chart of the further embodiment of the processing method of vector graphics provided by the present invention.Such as Fig. 6
Shown, this method can specifically include:
S310, receives acquisition instructions.
S320, the touch sensible signal for obtaining user's triggering screen and generating, and according to the acquisition instructions and the touch sense
Induction signal, is acquired to the vector graphics drawn on painting canvas, obtains the first dynamic vector graphics.
S330, according to first dynamic vector graphics, obtains corresponding first dynamic data frame, and by first dynamic number
It is stored according to frame in vector data file;The first dynamic data frame includes the corresponding arrow of the first dynamic vector graphics of the collection
Data, the very first time and dynamic vector graphics mark are measured, the very first time touches the screen including the user and stopped to the user
Touch the duration between the screen.
S340, if the current user stops touching the screen, gathers the first static vector graphics on current painting canvas, and
According to the first static vector graphics, or all static state preserved in the first static vector graphics and the vector data file
Vector graphics, obtains corresponding first static data frame, and the first static data frame is stored in the vector data file;
The corresponding vector number of all static vector graphics that the first static data frame includes the first static vector graphics and preserved
According to, the second time and static vector graphics mark.
S350, starts timer and starts timing.
In the present embodiment, record command to vector graphics is completed, can also be right according to the vector data file of preservation
It is played back, and what is recorded during recording in data frame is the relative time of vector graphics generation, therefore, can be passed through in playback
Mode during timer, the relative time in being played back.
S360, according to the play-back command received, reads in sequence in the data frame preserved from the vector data file
Take data frame.
In the present embodiment, according to play-back command of the user to vector graphics is received, from the corresponding arrow of the vector graphics
The data frame of reading and saving in data file is measured, is generally successively read and parses according to the order of collection;When implementing,
A part of data frame can be first read, the order according still further to data frame is parsed to it successively.
S370, obtain read data frame in time, and obtain read the data frame when timer record it is relative
Time.
S380, if the difference that the time in the data frame subtracts the relative time of timer record when reading the data frame is small
When zero, the vector data in the data frame is loaded.
In being played back in the present embodiment to vector graphics, the relative time of timer record can be reflected and read
Data frame in the time relative position, therefore, using the time of timer record as time reference, the data frame of preservation is entered
Row playback, if the difference that the time in data frame subtracts the relative time of timer record is less than or equal to zero, illustrates to open from timing
Begin to the current time to already exceed the relative time of the data frame recording, therefore the vector data in loading data frame immediately.
Similarly, the processing method for the vector graphics that the present embodiment is provided, in addition to:
S390, if the difference that the time in the data frame subtracts the relative time of timer record when reading the data frame is big
In zero, then when the time in the data frame subtracts the reading data frame after the difference of the relative time of the timer record, plus
Carry the vector data in the data frame.
It should be noted that S380 and S390 do not have clear and definite sequencing in the present embodiment.
For example, the replayed section for a kind of vector graphics that Fig. 7 methods shown in Fig. 6 of the present invention are provided, specifically to upper
The vector data file for stating Fig. 4 offers is played back.It should be noted that the processing side for the vector graphics that the present embodiment is provided
Method, when loading the vector data in data frame, is specifically included:If the vector graphics in the data frame is designated static vector graphics
Mark, then empty the painting canvas and reload vector data in the data frame;Or, if the vector graphics mark in data frame
Identify, then replace the corresponding dynamic vector graphics of vector data in data frame on presently described painting canvas for dynamic vector graphics
Dynamic vector graphics.For example, the vector graphics in data frame 4 and 8 is designated static vector graphics mark, accordingly, it would be desirable to clearly
All vector graphics on empty painting canvas, reload the vector data in data frame, due to when collection, for static vector
For figure, all vector graphics on current painting canvas are saved, therefore, painting canvas is emptied in playback and can show record
At the time of painting canvas in all figures;In another example, the vector graphics in data frame 6 and 7 is designated dynamic vector graphics mark,
When loading data frame 7, the corresponding vector graphics of data frame 6 is shown on current painting canvas, with the corresponding dynamic of data frame 7
Static vector graphics in dynamic vector graphics in vector graphics replacement data frame 6, data frame 7 is identical with data frame 6, therefore
Keep constant.
The processing method for the vector graphics that the present embodiment is provided, by the acquisition instructions of reception and user's triggering screen
Dynamic vector graphics in drafting are acquired by the touch sensible signal of generation, and the dynamic vector graphics of collection are changed
For the form of dynamic data frame, by dynamic vector graphics to be stored in the form of data structure in vector data file, solve
The problem of causing memory space increase in the way of picture frame storage vector graphics in the prior art, reduces storage polar plot
The memory space that shape takes, and improve the performance for the terminal device for recording vector graphics.In addition, according to vector data text
The data frame stored in part, is played back to corresponding vector graphics, and the process of playback is identical with data recording frame sequential, dynamic
The effect of display can clearly show the process of drafting;Further, the vector graphics stored in the form of data frames, is being returned
The vector data in data frame is also based on when putting to the Zoom display that vector graphics is carried out, it is ensured that vector graphics in playback
Resolution ratio and screen display effect.
Further, in the processing method for the vector graphics that the various embodiments described above of the present invention are provided, according to acquisition instructions
When being acquired to the vector graphics drawn on painting canvas, voice messaging when drawing vector graphics, voice letter can also be recorded
Breath can be specifically explanation to vector graphics drawing process etc.;Correspondingly, vector graphics correspondence is being read according to play-back command
Vector data file when, the voice messaging of recording can also be read, the voice messaging and vector graphics are played back simultaneously.
A kind of structural representation of one embodiment of the processing unit for vector graphics that Fig. 8 provides for the present invention.Such as Fig. 8
Shown, the processing unit for the vector graphics that the present embodiment is provided is specifically included:Receiving module 11, acquisition module 12 and dynamic number
According to frame acquisition module 13.
Wherein, receiving module 11, for receiving acquisition instructions.
Acquisition module 12, for the touch sensible signal for obtaining user's triggering screen and generating, and according to the receiving module
11 acquisition instructions received and the touch sensible signal, are acquired to the vector graphics drawn on painting canvas, obtain first and move
State vector figure.
Dynamic data frame acquisition module 13, for first dynamic vector graphics gathered according to the acquisition module 12, is obtained
Corresponding first dynamic data frame is taken, and the first dynamic data frame is stored in vector data file;First dynamic number
Include the corresponding vector data of the first dynamic vector graphics, the very first time and the dynamic vector graphics mark of the collection according to frame, should
The very first time includes the time that the user touches the screen, or the duration that the user slides on the screen.
The processing unit of vector graphics provided in an embodiment of the present invention is used to perform what embodiment illustrated in fig. 1 of the present invention was provided
The processing method of vector graphics, possesses corresponding functional module, and its implementing principle and technical effect is similar, and here is omitted.
A kind of structural representation of another embodiment of the processing unit for vector graphics that Fig. 9 provides for the present invention.This
The processing unit for the vector graphics that embodiment is provided is on the basis of Fig. 8 shown device structures, and the device also includes:
Static data frame acquisition module 14, for when the current user stops touching the screen, then gathering current painting canvas
On the first static vector graphics, and according to the first static vector graphics, or the first static vector graphics and the vector
All static vector graphics preserved in data file, obtain corresponding first static data frame, and by first static data
Frame is stored in the vector data file;Wherein, the first static data frame includes the corresponding arrow of the first static state vector graphics
Measure data, the second time and static vector graphics mark;Or, the first static data frame includes the first static vector graphics
Corresponding vector data, the corresponding vector data of all static vector graphics preserved before, second time and static state arrow
Measure pattern identification;Second time includes the current user and stops touching the screen corresponding time.
It should be noted that the vector graphics that active user draws is dynamic vector graphics, when user terminates current dynamic
During the drafting of vector graphics, the dynamic vector graphics are changed into static vector graphics.
Preferably, the receiving module 11 is additionally operable to receive edit instruction, and the edit instruction includes M vectors to be edited
Figure and corresponding editing parameter.
Then the device can further include:Processing module 15, for successively according to being somebody's turn to do that the receiving module 11 is received
Editing parameter, on the painting canvas, editing and processing, and the polar plot to editor successively are carried out to corresponding vector graphics to be edited
Shape is acquired, and obtains corresponding second dynamic vector graphics.
In the present embodiment, correspondingly, the dynamic data frame acquisition module 13 is additionally operable to according to M the second motion vector figures
Shape, obtains corresponding second dynamic data frame, and the second dynamic data frame is stored in vector data file;This second move
State data frame includes the M corresponding vector data sums of the second dynamic vector graphics, the 3rd time and dynamic vector graphics mark,
3rd time included carrying out the vector graphics to be edited the duration of editing and processing.
The processing unit of vector graphics provided in an embodiment of the present invention is used to perform what embodiment illustrated in fig. 5 of the present invention was provided
The processing method of vector graphics, possesses corresponding functional module, and its implementing principle and technical effect is similar, and here is omitted.
Figure 10 is a kind of flow chart of the further embodiment of the processing unit of vector graphics provided by the present invention.This reality
The processing unit of vector graphics of example offer is applied on the basis of Fig. 9 shown device structures,
The processing module 15 is additionally operable to gather other vector graphics on the painting canvas in addition to the vector graphics to be edited;
Correspondingly, the static data frame acquisition module 14 is additionally operable to, according to other vector graphics, obtain corresponding second static data
Frame, and the second static data frame is stored in the vector data file;Wherein, the second static data frame includes this other
The corresponding vector data sum of vector graphics, the 4th time and static vector graphics mark;4th time selected for the user
The time of first vector graphics to be edited.
It should be noted that the static vector graphics that editor has been completed on painting canvas is more than or equal to M, wherein in edit instruction
Including M static vector graphics be converted to dynamic vector graphics, though other the static vector graphics not included in edit instruction
Do not change so, but gather and change, it is necessary to be re-started to it according to the edit instruction to vector graphics on painting canvas
Preserved for data frame.
Preferably, the device can further include:
Timing module 16, timing is started for starting timer.
In read module 17, the play-back command received for basis, the data frame preserved from the vector data file
Read data frame in sequence.
Time-obtaining module 18, for obtaining the time in the data frame read, and meter when obtaining the reading data frame
When device record relative time.
Load-on module 19, the timer record is relative when subtracting the reading data frame for the time in the data frame
When the difference of time is less than or equal to zero, the vector data in the data frame is loaded.
The time that the load-on module 19 is additionally operable in the data frame subtracts timer record when reading the data frame
The difference of relative time be more than zero, then the time in the data frame subtract read the data frame when timer record it is relative when
Between difference after, load the vector data in the data frame.
It should be noted that the processing unit for the vector graphics that the present embodiment is provided, the load-on module 19 is loading the number
During according to vector data in frame, specifically include:If the vector graphics in the data frame is designated static vector graphics mark, clearly
The empty painting canvas reloads the vector data in the data frame;Or, if the vector graphics in the data frame is designated motion vector
Pattern identification, then replace the corresponding dynamic vector graphics of vector data in the data frame motion vector on the current painting canvas
Figure.
The processing unit of vector graphics provided in an embodiment of the present invention is used to perform what embodiment illustrated in fig. 6 of the present invention was provided
The processing method of vector graphics, possesses corresponding functional module, and its implementing principle and technical effect is similar, and here is omitted.
Further, in the processing unit for the vector graphics that the various embodiments described above of the present invention are provided, it can also include:Voice
Module is recorded, for when being acquired according to acquisition instructions to the vector graphics drawn on painting canvas, record to draw vector graphics
When voice messaging, the voice messaging can be specifically explanation to vector graphics drawing process etc.;Correspondingly, read module exists
During vector data file corresponding according to play-back command reading vector graphics, the voice messaging of recording can also be read, to add
Module is carried to be played back the voice messaging simultaneously with vector graphics.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.