[summary of the invention]
In view of this, the invention provides a kind of implementation method and device of drawing instrument, so that help user to draw on the mobile apparatus easily.
Concrete technical scheme is as follows:
The invention provides a kind of implementation method of drawing instrument, the method comprises:
The gesture operation of monitoring users;
If listen to gesture operation of effectively drawing under Graphics Mode, then obtain each impact point corresponding to this drawing gesture operation in operating system adopt position coordinates in coordinate system;
By described each impact point in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts;
Call described graphic plotting instrument draw described each impact point and show.
According to the present invention one preferred implementation, the method also comprises:
When listening to the gesture operation switching Graphics Mode under non-drawing pattern, switch to Graphics Mode; Or,
When listening to the gesture operation switching Graphics Mode under Graphics Mode, switch to non-drawing pattern.
According to the present invention one preferred implementation, the gesture operation switching Graphics Mode comprises:
Click the function button that user switches Graphics Mode.
According to the present invention one preferred implementation, the method also comprises: filter the drawing gesture operation listened under Graphics Mode, only retain gesture operation of effectively drawing; Wherein said filtration comprises:
Filter out the gesture exceeding drafting scope, and/or, filter out the gesture not meeting default drawing gesture-type.
According to the present invention one preferred implementation, described effective drawing gesture operation comprises: draw the gesture operation of lines or revise the gesture operation having drawn lines.
According to the present invention one preferred implementation, the gesture operation of described drafting lines comprises: with the short slip gesture by starting;
The gesture operation that lines have been drawn in described amendment comprises: with the long slip gesture started by the point drawn on lines.
According to the present invention one preferred implementation, each impact point that the gesture operation of described drafting lines is corresponding is described with each point on the short sliding trace corresponding by the slip gesture started;
Described amendment has drawn each impact point corresponding to the gesture operation of lines for described to draw each point obtained after line style or position are changed caused by the long slip gesture started by the point drawn on lines.
According to the present invention one preferred implementation, cause with the long slip gesture started by the end points drawing lines and draw the angle of inclination of lines or the change of length;
The change of the position of drawing lines is caused with the long slip gesture started by the middle part point drawing lines.
According to the present invention one preferred implementation, the method also comprises:
If listen to effective gesture operation under non-drawing pattern, then according to the new business datum that described gesture operation obtains, to the point drawn on lines in operating system adopt the position coordinates in coordinate system to carry out adaptation processing;
By the point drawn after adaptation processing on lines in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts;
Call described graphic plotting instrument draw the point drawn after described adaptation processing on lines and show.
According to the present invention one preferred implementation, described effective gesture operation comprises: slip screen operator, zoom in or out operation.
According to the present invention one preferred implementation, the described point to drawing on lines in operating system adopt the position coordinates in coordinate system to carry out adaptation processing to comprise:
Utilize the described relative position drawn between lines and business datum of record, after the described new business datum of acquisition, according to business datum on application interface operating system adopt the position coordinates in coordinate system determine to draw lines in operating system adopt position coordinates in coordinate system.
According to the present invention one preferred implementation, the method also comprises:
Record the relative position between business datum that described each impact point and current application interface show;
Persistent storage is carried out to the described relative position information of record.
According to the present invention one preferred implementation, the method also comprises:
When the application at described drawing instrument place is activated, obtain the relative position information of persistent storage;
According to the business datum of current application showing interface and the relative position information of acquisition, determine the position coordinates drawing lines within the scope of current application showing interface;
The position coordinates determined is mapped in the coordinate system of described graphic plotting instrument;
Call described graphic plotting instrument draw the lines of drafting within the scope of current application showing interface and show.
According to the present invention one preferred implementation, the application at described drawing instrument place comprises: stock class is applied.
Present invention also offers a kind of implement device of drawing instrument, this device comprises:
Monitoring unit, for the gesture operation of monitoring users;
Acquiring unit, if listen to gesture operation of effectively drawing for described monitoring unit under Graphics Mode, then obtain each impact point corresponding to this drawing gesture operation in operating system adopt position coordinates in coordinate system;
Map unit, for by described each impact point in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts;
Call unit, draws for calling described graphic plotting instrument described each impact point and shows.
According to the present invention one preferred implementation, this device also comprises:
Switch unit, during for listening to the gesture operation switching Graphics Mode under non-drawing pattern when described monitoring unit, switches to Graphics Mode; Or, when described monitoring unit listens to the gesture operation switching Graphics Mode under Graphics Mode, switch to non-drawing pattern.
According to the present invention one preferred implementation, the gesture operation switching Graphics Mode comprises:
Click the function button that user switches Graphics Mode.
According to the present invention one preferred implementation, this device also comprises:
Filter element, for filtering the drawing gesture operation that described monitoring unit listens under Graphics Mode, only retains gesture operation of effectively drawing; Wherein said filtration comprises:
Filter out the gesture exceeding drafting scope, and/or, filter out the gesture not meeting default drawing gesture-type.
According to the present invention one preferred implementation, described effective drawing gesture operation comprises: draw the gesture operation of lines or revise the gesture operation having drawn lines.
According to the present invention one preferred implementation, the gesture operation of described drafting lines comprises: with the short slip gesture by starting;
The gesture operation that lines have been drawn in described amendment comprises: with the long slip gesture started by the point drawn on lines.
According to the present invention one preferred implementation, each impact point that the gesture operation of described drafting lines is corresponding is described with each point on the short sliding trace corresponding by the slip gesture started;
Described amendment has drawn each impact point corresponding to the gesture operation of lines for described to draw each point obtained after line style or position are changed caused by the long slip gesture started by the point drawn on lines.
According to the present invention one preferred implementation, cause with the long slip gesture started by the end points drawing lines and draw the angle of inclination of lines or the change of length;
The change of the position of drawing lines is caused with the long slip gesture started by the middle part point drawing lines.
According to the present invention one preferred implementation, this device also comprises:
Adaptation unit, if listen to effective gesture operation for described monitoring unit under non-drawing pattern, then according to the new business datum that described gesture operation obtains, carries out adaptation processing to the point drawn on lines position coordinates in an operating system;
Described map unit, also for by the point drawn after adaptation processing on lines in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts;
Described call unit, also draws for calling described graphic plotting instrument the point drawn after described adaptation processing on lines and shows.
According to the present invention one preferred implementation, described effective gesture operation comprises: slip screen operator, zoom in or out operation.
According to the present invention one preferred implementation, described adaptation unit, specifically for having drawn the relative position between lines and business datum described in utilization record, after the described new business datum of acquisition, according to business datum on application interface operating system adopt the position coordinates in coordinate system determine to draw lines in operating system adopt position coordinates in coordinate system.
According to the present invention one preferred implementation, this device also comprises:
Storage unit, for recording the relative position between the business datum that described each impact point and current application interface show; Persistent storage is carried out to the described relative position information of record.
According to the present invention one preferred implementation, this device also comprises:
Start treatment unit, for when the application at described drawing instrument place is activated, obtains the relative position information of persistent storage; According to the business datum of current application showing interface and the relative position information of acquisition, determine the position coordinates drawing lines within the scope of current application showing interface;
Described map unit, the position coordinates also for being determined by described start treatment unit is mapped in the coordinate system that described graphic plotting instrument adopts;
Described call unit, also draws for calling described graphic plotting instrument the described lines of drafting within the scope of current application showing interface and shows.
According to the present invention one preferred implementation, the application at described graphic plotting instrument place comprises: stock class is applied.
As can be seen from the above technical solutions, the present invention is by the monitoring to the effective drawing gesture operation of user, by each impact point corresponding for drawing gesture operation in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts, and call figure drawing tool and each impact point is drawn and shows, thus realize user and drawn on the mobile apparatus easily by gesture operation.
[embodiment]
In order to make the object, technical solutions and advantages of the present invention clearly, describe the present invention below in conjunction with the drawings and specific embodiments.
Method provided by the invention is mainly used in the mobile terminal with touch screen, includes but not limited to smart mobile phone, panel computer, PDA (personal digital assistant) etc.
Wherein, mobile terminal architecturally comprises some basic modules, as bus, disposal system, storage system, one or more input/output and communication interface etc.Bus can comprise one or more wire, is used for realizing the communication between each assembly of mobile terminal.Disposal system comprises and all types of is used for performing instruction, the processor for the treatment of progress or thread or microprocessor.Storage system can comprise the dynamic storagies such as the random access storage device (RAM) storing multidate information, with the static memory such as ROM (read-only memory) (ROM) storing static information, and comprise the mass storage of magnetic or optical record medium and respective drive.Input system supplies user's input information to mobile terminal, as writing pencil, touch screen, sound recognition system or bioassay system etc.Output system comprises touch screen, loudspeaker etc. for output information.Communication interface is used for mobile terminal is communicated with miscellaneous equipment.Be connected in network by wired connection, wireless connections or light between communication interface.
In addition, mobile terminal includes for management of system resource, control the operating system software that other program runs, and be used for realizing the application software of certain functional modules.
The implementation method of drawing instrument provided by the invention and device can be equipped on the multiple application software on mobile terminal, such as stock class application software, weather class application software, icon class application software etc.Use the implementation method of drawing instrument provided by the invention and device can in above-mentioned application software the drafting of the basis of data enterprising line bar class is provided, thus help user to carry out data analysis.Be described for stock class application software in an embodiment of the present invention, the scene of other application software is similar.
The main method process flow diagram that Fig. 1 provides for the embodiment of the present invention, as shown in fig. 1, the method can comprise the following steps:
In 101, the gesture operation of monitoring users.
In 102, if listen to gesture operation of effectively drawing under Graphics Mode, then obtain each impact point corresponding to this drawing gesture operation in operating system adopt position coordinates in coordinate system.
In embodiments of the present invention, owing to having carried drawing instrument provided by the invention, can there is the switching between two kinds of patterns: Graphics Mode and non-drawing pattern in the current application (follow-up referred to as current application) used of user.In order to ensure that the existing function of current application is as its major function, such as its major function of stock class application software still carries out the displaying of stock information, and therefore acquiescence being in non-drawing pattern, and namely current application is given tacit consent to upon actuation and is in non-drawing pattern.
Can be triggered by the gesture operation of user from non-drawing pattern to the switching of Graphics Mode.If when namely listening to the gesture operation switching Graphics Mode under non-drawing pattern, switch to Graphics Mode.When listening to the gesture operation switching Graphics Mode under Graphics Mode, switch to non-drawing pattern.
The gesture operation wherein switching Graphics Mode can preset, as long as the gesture operation having a function with the operating system of current application and mobile terminal distinguishes.Lift the gesture operation example that switches Graphics Mode in embodiments of the present invention, as shown in Figure 2 a, when carrying out the displaying of stock certificate data in current application, interface exists the function button that switches Graphics Mode, namely the button of " setting-out " is denoted as in figure, when user needs to carry out mapping operation, switch to Graphics Mode by clicking this function button from non-drawing pattern.When switching to Graphics Mode, above-mentioned functions button becomes " returning ", as shown in figure 2b, when user clicks this function button again, switches back non-drawing pattern.
Here so-called " effectively " refers to needs to filter the drawing gesture operation listened to, and only retains gesture operation of effectively drawing, specifically will describe in subsequent embodiment.
In addition, in embodiments of the present invention, effective drawing gesture operation can include but not limited to: the gesture operation of drafting lines, amendment have been drawn the gesture operation of lines and deleted the gesture operation having drawn lines.
In 103, by each impact point in operating system adopt the position coordinates in coordinate system to be converted to position coordinates in the coordinate system adopted at graphic plotting instrument.
Each impact point corresponding to drawing gesture operation that first can obtain 102 in operating system adopt the position coordinates in coordinate system to carry out record, for Android operation system, with the screen upper left corner for initial point, the x of the point that recording user gesture operation is touched on screen, the position of y coordinate.
The graphic plotting instrument adopted in embodiments of the present invention can be but be not limited to OpenGL, and that is, OpenGL can provide interface to graphic plotting instrument, calls for graphic plotting instrument, thus the drafting completed impact point and display.
Because the true origin of the graphic plotting instruments such as such as OpenGL is different from the true origin of android system, the coordinate origin of such as OpenGL is in the lower left corner, therefore need the position coordinates of impact point to change, be converted to the position coordinates in the coordinate system that the graphic plotting instruments such as OpenGL adopt.
In 104, call figure drawing tool draw each impact point and show.
Below by several embodiment, several use scenes that the present invention relates to are described in detail.
The method flow diagram of the drafting lines that Fig. 3 provides for the embodiment of the present invention, under supposing that current application is switched to Graphics Mode by user in the present embodiment, user will carry out the drafting of lines under this Graphics Mode, and as shown in Figure 3, this process can specifically comprise the following steps:
In 301, the gesture operation of monitoring users.
In 302, under Graphics Mode, the gesture operation listened to is filtered.
In this step, can pre-set the drafting scope under Graphics Mode, namely on the interface of current application, preset a scope, the drawing gesture of only carrying out within the scope of this is just effective, and the drawing gesture exceeding this scope will be filtered.
In addition, also can pre-set some and effectively draw gesture-type, these gesture-type can be to draw out the gesture-type of straight line, broken line, curve etc., will be filtered for not meeting these gestures of drawing gesture-type.
In 303, each impact point corresponding for the gesture operation of the drafting lines listened to is converted to the position coordinates of the coordinate system at OpenGL at the position coordinates of the coordinate system of operating system.
In the present embodiment, if listened to the short slip gesture by starting, and this slip gesture remains after being through the filtration of 302, so can to determine to listen to the gesture operation drawing lines, and each point on its sliding trace is above-mentioned impact point.
For Android operation system, because the coordinate system of operating system is true origin with the upper left corner, and in units of pixel, and OpenGL is true origin by central point and in units of the height of whole view, therefore needs the position coordinates each impact point being converted to the coordinate system at OpenGL at the position coordinates of the coordinate system of Android operation system.If certain impact point is (xPosi, yPosi) at the position coordinates of the coordinate system of Android operation system, the position coordinates (x, y) of the coordinate system at OpenGL so obtained after conversion is:
Wherein, oriCanvasWidth is view width, and oriCanvasHeight is view altitude, and widthRatio is the spread factor of OpenGL, and heightRatio is the height coefficient of OpenGL.
In 304, call OpenGL draw each impact point and show.
In 305, record the relative position between business datum that above-mentioned each impact point and current application interface show.
Due to each impact point in Android operation system adopt the position coordinates in coordinate system to be an absolute location coordinates, and business datum is actually and upgrades gradually, for stock class software, usual display be k line data, k line data are constantly updated on time-axis direction, as shown in figure 2b, the up-to-date business datum of current interface display is the k line data on Dec 2, but wait until tomorrow, the up-to-date business datum of display just becomes the k line data on Dec 3, and this will cause integral image to be moved to the left.Iff record each impact point in Android operation system adopt position coordinates (i.e. absolute location coordinates) in coordinate system, so then no longer applicable for the business datum after upgrading.
In order to overcome above-mentioned problem, making, when business datum occurs to upgrade, still correctly to show the lines that user draws, needing to record the relative position between business datum that above-mentioned each impact point and current application interface show.
In 306, persistent storage is carried out to the above-mentioned relative position information of record.
Persistent storage in this step refers to this and is stored in after current application is closed and still retains, and except non-user manually deletes the content of this persistent storage, otherwise the content of this persistent storage will exist always.
By flow process shown in Fig. 3, user can draw lines on current application interface, and user can draw out lines on the interface shown in Fig. 2 b, and result can be as is shown in fig. 4 a.It should be noted that, the drafting for lines is not limited to the straight-line segment shown in Fig. 4 a, also can be broken line or curve etc.
Fig. 5 has drawn the method flow diagram of lines for amendment that the embodiment of the present invention provides, under supposing that current application is switched to Graphics Mode by user in the present embodiment, user will modify for the lines drawn under this Graphics Mode, as shown in Figure 5, this process can comprise the following steps:
In 501, the gesture operation of monitoring users.
In 502, under Graphics Mode, the gesture operation listened to is filtered.
Similar with step 302 in Fig. 3, can set drafting scope and drawing gesture-type in advance, if the gesture operation scope that user revises existing lines exceeds drafting scope, or the gesture-type of the existing lines of amendment does not meet default drawing gesture-type, then filtered out.
In 503, determining the gesture operation type to drawing lines, if delete the operation of having drawn lines, then performing 504; If the operation of lines has been drawn in amendment, perform 505.
In the present embodiment, the gesture operation type to drawing lines can being pre-set, can include but not limited to: pattern or the position of lines have been drawn in amendment, delete and draw lines, etc.In addition, the gesture operation having drawn lines for each amendment can pre-set equally.Such as be set to cause with the long slip gesture started by the end points drawing lines and drawn the angle of inclination of lines or the change of length, namely user can realize drawing the angle of inclination of lines or pulling of length by pinning the end points drawing lines.Again such as, cause the change of the position of drawing lines with the long slip gesture started by the middle part point drawing lines, namely user can move this and drawn lines by pinning the medium position drawing lines and point the position frameed out to user.
Again such as, recall submenu and deletion option on chooser menu is set to delete the gesture operation having drawn lines by long by drawing lines, or by choose draw lines after the delete button clicked on interface be set to delete the gesture operation having drawn lines.Under the previous case, when with the head of a household by when drawing lines, interface can be ejected a submenu, in this submenu exist one delete option, when user clicks this deletion option, delete this and draw lines.In the case of the latter, under Graphics Mode, there is a delete button in interface, after user to choose in modes such as clicks and draws lines, if click this delete button again, then delete this and draw lines.
In 504, delete and draw lines, OpenGL would not show deleted lines, terminates the process to this gesture operation.
In 505, obtain amendment drawn each impact point corresponding to the gesture operation of lines in Android operation system adopt position coordinates in coordinate system.
It can be above-mentioned to draw each point obtained after line style or position are changed caused by the long slip gesture started by the point drawn on lines that each impact point corresponding to the gesture operation of lines has been drawn in amendment.
In 506, by above-mentioned impact point in Android operation system adopt the position coordinates in coordinate system to be converted to the position coordinates of the coordinate system at OpenGL.
In 507, call OpenGL and each impact point is drawn and shows.
In 508, record the relative position between business datum that above-mentioned each impact point and current application interface show.
In 509, persistent storage is carried out to the above-mentioned relative position information of record.
By flow process shown in Fig. 5, user can operate drawing lines on current application interface, and such as user can to modify following amendment to the wherein straight line section shown in Fig. 4 a:
The first amendment: the end points pinning straight-line segment pulls, and changes angle of inclination and/or the length of this straight-line segment, as shown in fig 4b.In fig. 4b, user points and grows by the A end points drawing lines and slide into the position shown in B point, pull just can modify to the angle of inclination of lines and length by this, the lines of drafting before amendment that what phantom line segments represented is, the lines of drafting after amendment that what real segment represented is, thick arrow represents the sliding trace that user points.
The second is revised: the medium position pinning straight-line segment drags, and changes the position of this straight-line segment, as shown in fig. 4c.In Fig. 4 c, user points long by the medium position drawing lines, slides into the position of D point, just the position of this straight-line segment can be moved by this slip from C point.The lines of drafting before amendment that what in figure, phantom line segments represented is, the lines of drafting that what real segment represented is after amendment, thick arrow represents the sliding trace that user points.
The third amendment: long recall submenu and deletion option on chooser menu by drawing lines, deletes and draws lines.As in Fig. 4 d, user points length by drawing lines, and interface can be ejected a submenu, submenu comprises deletion option, when user clicks deletion option, just can delete this and draw lines.
User is carrying out in the process of drawing, such problem may be run into, because screen is less, often granularity is very large when showing for business datum, or the business datum of display is limited, this just causes user usually can not accurately locate when drawing lines, needs to carry out convergent-divergent or movement to the business datum that screen shows.For this demand, carry out under needing user to be switched to non-drawing pattern.Process flow figure under the non-drawing pattern that Fig. 6 provides for the embodiment of the present invention, under supposing that current application is switched to non-drawing pattern by user in the present embodiment, as shown in Figure 6, this process can comprise the following steps:
In 601, the gesture operation of monitoring users.
In 602, the gesture operation listened under non-drawing pattern is filtered.
Equally, can pre-set the regional extent of gesture operation under non-drawing pattern and type, filter with the gesture operation not meeting the above-mentioned type for exceeding above-mentioned zone scope, only retaining effective gesture operation.
In 603, the new business datum obtained according to the gesture operation that listens to, to the point drawn on lines in operating system adopt the position coordinates in coordinate system to carry out adaptation processing.
Here the gesture operation listened to can include but not limited to slip screen operator, zoom in or out operation.
If slip screen operator, then current application needs to obtain new business datum according to this slip screen operator, and the business datum of acquisition is determined according to slip amplitude.Such as user (under being in non-drawing pattern with Fig. 4 a unlike this operation) on application interface as shown in fig. 4 a slides left, suppose this slip amplitude correspondence business datum in one week, then need the business datum obtaining new a week, the i.e. k line data in 3 ~ Dec 9 Dec, make the unification of the business datum on screen be moved to the left one week, show the k line data from 6 ~ Dec 9 September.Due to user lines may be depicted on the surface, so after moving screen, the position to drawing lines is also needed to carry out adaptation processing.
If amplifieroperation, then current application needs to obtain more fine-grained business datum according to the amplitude of this amplifieroperation.That is, the business datum scope that screen shows has diminished, but granularity is thinner.Equally, due to user lines may be depicted on the surface, so after moving screen, the position to drawing lines is also needed to carry out adaptation processing.
If reduction operation, then current application needs to obtain wider business datum according to the amplitude of this reduction operation, and that is, the business datum scope that screen shows becomes large, but granularity is thicker.This situation needs the position to drawing lines to carry out adaptation processing equally.
It is prior art that business datum caused by aforesaid operations obtains, and does not describe in detail, the adaptation processing focusing on carrying out the position of drawing lines of this step.Wherein adaptation processing utilizes the relative position drawn between lines and business datum recorded in fact exactly, and after carry out moving screen, zoom in or out etc. operates, the position coordinates according to business datum determines the position coordinates drawing lines.This position coordinates be in operating system adopt position coordinates in coordinate system.
In 604, by the point drawn after adaptation processing on lines in Android operation system adopt the position coordinates in coordinate system to be mapped in the coordinate system of OpenGL.
In 605, call OpenGL and the point drawn after adaptation processing on lines is drawn and shown.
It should be noted that, after shown in employing Fig. 6, mode operates current application interface, can further combined with flow process shown in Fig. 3 or Fig. 5.Such as, after user amplifies screen, according to more fine-grained business datum, the lines drawn are modified; After user moves screen, carry out the further drafting of lines according to the new business datum obtained, etc.
Can see from flow process shown in Fig. 3 and Fig. 5, persistent storage has been carried out to the relative position drawn between lines and business datum, so when user is when starting and show the interface of current application next time, the flow process of execution can as shown in Figure 7, comprise the following steps:
In 701, obtain the relative position information of persistent storage.
At 702, according to business datum and the above-mentioned relative position information of current application showing interface, the position coordinates drawing lines within the scope of current application showing interface is determined.
Due to persistent storage is the relative position drawn between lines and business datum, so the position coordinates (in the coordinate system of operating system) of the business datum of foundation current application showing interface just can be drawn the position coordinates of lines, is only taken within the scope of current application showing interface for the position coordinates drawing lines obtained.
In 703, position coordinates step 702 determined is converted to the position coordinates of the coordinate system at OpenGL.
In 704, call OpenGL and the lines of drafting within the scope of current application showing interface are drawn and shown.
By flow process shown in Fig. 7, after user completes the drafting of lines, if open this application software next time, still can show the lines drawn.
The structure drawing of device that Fig. 8 provides for the embodiment of the present invention, this device can be arranged to be had in the application software of drawing requirements, as shown in Figure 8, this device can comprise: monitoring unit 01, acquiring unit 02, map unit 03 and call unit 04, can further include switch unit 05, filter element 06, adaptation unit 07, storage unit 08 and start treatment unit 09.The major function of each component units is as follows:
Monitoring unit 01 is responsible for the gesture operation of monitoring users.
If monitoring unit 01 listens to gesture operation of effectively drawing under Graphics Mode, then acquiring unit 02 obtain each impact point corresponding to this drawing gesture operation in operating system adopt position coordinates in coordinate system.Wherein effectively drawing gesture operation can comprise: the gesture operation of drafting lines, amendment have been drawn the gesture operation of lines or deleted the gesture operation having drawn lines.The gesture operation drawing lines comprises: with the short slip gesture by starting; The gesture operation that lines have been drawn in amendment comprises: with the long slip gesture started by the point drawn on lines.Delete the gesture operation having drawn lines to comprise: longly recall submenu and the gesture operation of deletion option on chooser menu by drawing lines, or, choose the gesture operation clicking the delete button on interface after drawing lines.
Wherein, each impact point that the gesture operation of drafting lines is corresponding is with each point on the short sliding trace corresponding by the slip gesture started; Amendment has drawn each impact point corresponding to the gesture operation of lines for to draw each point obtained after line style or position are changed caused by the long slip gesture started by the point drawn on lines.
Cause with the long slip gesture started by the end points drawing lines and draw the angle of inclination of lines or the change of length; The change of the position of drawing lines is caused with the long slip gesture started by the middle part point drawing lines.
Map unit 03 be responsible for by each impact point in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts.Call unit 04 is responsible for calling figure drawing tool and is drawn each impact point and show.The graphic plotting instrument adopted in embodiments of the present invention can be but be not limited to OpenGL, and that is, OpenGL can provide interface to graphic plotting instrument, calls for graphic plotting instrument, thus the drafting completed impact point and display.
The application software of having carried this device can switch between two kinds of patterns, and the switching namely between Graphics Mode and non-drawing pattern, this switching is completed by switch unit 05.Particularly, when monitoring unit 01 listens to the gesture operation switching Graphics Mode under non-drawing pattern, switch unit 05 switches to Graphics Mode; Or when monitoring unit 01 listens to the gesture operation switching Graphics Mode under Graphics Mode, switch unit 05 switches to non-drawing pattern.
Wherein, the gesture operation wherein switching Graphics Mode can preset, as long as the gesture operation having a function with the operating system of current application and mobile terminal distinguishes.Such as can adopt and click the function button that user switches Graphics Mode.
Filter element 06 is responsible for filtering the drawing gesture operation that monitoring unit 01 listens under Graphics Mode, only retains gesture operation of effectively drawing; Wherein filter and can include but not limited to: filter out the gesture exceeding drafting scope, and/or, filter out the gesture not meeting default drawing gesture-type.
If monitoring unit 01 listens to effective gesture operation under non-drawing pattern, this effective gesture operation can comprise slip screen operator, zoom in or out operation etc., the then adaptation unit 07 new business datum that can obtain according to gesture operation, to the point drawn on lines in operating system adopt the position coordinates in coordinate system to carry out adaptation processing.Correspondingly, map unit 03 by the point drawn after adaptation processing on lines in operating system adopt the position coordinates in coordinate system to be mapped in the coordinate system of graphic plotting instrument.Call unit 04 calls figure drawing tool and draws the point drawn after adaptation processing on lines and show.
Particularly, adaptation unit 07 can utilize the relative position drawn between lines and business datum of record, after obtaining new business datum, according to business datum on application interface operating system adopt the position coordinates in coordinate system determine to draw lines in operating system adopt position coordinates in coordinate system.
Storage unit 08 is responsible for record and has been drawn relative position between each impact point and current application interface show lines business datum; Persistent storage is carried out to the relative position information of record.
When the application at drawing instrument place is activated, start treatment unit 09 can obtain the relative position information of persistent storage; According to the business datum of current application showing interface and the relative position information of acquisition, determine the position coordinates drawing lines within the scope of current application showing interface.Now, the position coordinates that start treatment unit 09 is determined is mapped in the coordinate system that graphic plotting instrument adopts by map unit 03.Call unit 04 calls figure drawing tool and draws the lines of drafting within the scope of current application showing interface and show.
Described as can be seen from above, method and apparatus provided by the invention can possess following advantage:
1) the present invention is by the monitoring to the effective drawing gesture operation of user under Graphics Mode, by each impact point corresponding for drawing gesture operation in operating system in adopt the position coordinates in coordinate system to be mapped to coordinate system that graphic plotting instrument adopts, and call figure drawing tool and each impact point is drawn and shows, thus realize user and drawn on the mobile apparatus easily by gesture operation.
2) user can modify to the figure drawn and delete under Graphics Mode, makes graphic plotting more flexibly with accurate.
3) under non-drawing pattern, user can be moved current application interface by effective gesture, mitigation and amplification, and carries out drafting and the amendment of figure on this basis, makes the drafting of figure more accurate.
4) persistent storage is carried out to the graph data that user draws, when making user again start application software, can show according to up-to-date business datum the figure drawn adaptively.
In several embodiment provided by the present invention, should be understood that, disclosed apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, and such as, the division of described unit, is only a kind of logic function and divides, and actual can have other dividing mode when realizing.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (Read-OnlyMemory, ROM), random access memory (RandomAccessMemory, RAM), magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.