Summary of the invention
The technical problem to be solved in the present invention provides a kind of device that can show and receive input on screen, and it can rotate on screen and to keep importing the function of receiving area constant.
For solving the problems of the technologies described above, the invention provides a kind of device that can on screen, show and receive input, comprise and be used on screen, showing that this device has the display unit of the figure of input receiving area, imports the input block of various control informations and the control module that said units is controlled for the user, it is characterized in that, described device also comprises a rotation processing unit, wherein:
Described input block also is used to receive the Spin Control instruction of user's input, and notifies described rotation processing unit;
Described rotation processing unit is used for according to described Spin Control instruction, calculates this and installs the Spin Control information of whole figure and input receiving area thereof and send to described control module;
Described control module also is used for controlling the location parameter that described input block is preserved postrotational input receiving area according to described Spin Control information, and controls described display unit and upgrade the display graphics of this device on screen according to postrotational location parameter.
Further, said apparatus also can have following characteristics: described device is entity analogue means or media player.
Further, said apparatus also can have following characteristics: described input block comprises keyboard input block and/or touch-screen input block, wherein:
Described keyboard input block is used to preserve the location parameter and the pairing identification number of each button of the viewing area of button on screen, when judging the user and click certain button viewing area, according to this marking keys number generation corresponding signal, carry out corresponding actions by described control module.
Described touch-screen input block is used to preserve touch-screen can receive the location parameter of the viewing area of input area on screen and the control command that touch-screen can receive the input area correspondence, when judging the user and click certain touch-screen and can receive input area, produce corresponding input of control commands and give described control module and carry out corresponding actions.
Further, said apparatus also can have following characteristics: described rotation processing unit be according to sense of rotation, the anglec of rotation and rotation in the Spin Control instruction based on central point calculate, the location parameter of the whole figure of device comprises one or more angular coordinates after the rotation that calculates, and the location parameter of the input receiving area in the figure of rotation back comprises the coordinate of these zones with respect to certain angle of whole figure.
Further, said apparatus also can have following characteristics: described input block is to preserve importing the location parameter of receiving area and setting up incidence relation with rotation back before the rotation simultaneously after rotation, and anglec of rotation mark is set, when judging the user and click postrotational input receiving area, determine earlier the location parameter of the preceding corresponding region of rotation, find this to import pairing control information again according to location parameter that should the zone after the rotation.
Further, said apparatus also can have following characteristics: also comprise a convergent-divergent adjustment unit, be used to receive the convergent-divergent steering order of user's input, calculating and sending send scalability information to give described control module, described control module sends control information to described input block and display unit according to this scalability information, and the whole figure of device and the demonstration of input receiving area thereof are carried out the convergent-divergent adjustment.
Another technical matters that the present invention will solve provides a kind of spinning solution of device that can show and receive input on screen, and the function that can keep importing the receiving area after rotation is constant.
For solving the problems of the technologies described above, the invention provides a kind of spinning solution that can on screen, show and receive the device of input, described device comprises input block, display unit, control module and rotation processing unit, this spinning solution may further comprise the steps:
(a) user imports Spin Control and instructs to described device;
(b) described device calculates this and installs the Spin Control information of whole figure and input receiving area thereof and send to described control module according to the Spin Control instruction that receives;
(c) described device is according to the display graphics of described this device of Spin Control information updating on screen, and preserves the location parameter of rotation whole figure in back and input receiving area.
Further, said method also can have following characteristics: the Spin Control instruction of user's input in the step (a) comprises following parameter: sense of rotation, the anglec of rotation and rotation based on central point.
Further, said method also can have following characteristics: the location parameter of the whole figure of device comprises one or more angular coordinates after the rotation that step (b) calculates, and the location parameter of the input receiving area in the figure of rotation back comprises the coordinate of these zones with respect to certain angle of whole figure.
Further, said method also can have following characteristics: when step (c) is preserved the location parameter of input receiving area, rotation back, be to preserve preceding import the location parameter of receiving area and set up incidence relation of rotation simultaneously, and anglec of rotation mark is set with the rotation back; Device is determined the location parameter of the preceding corresponding region of rotation earlier according to location parameter that should the zone after the rotation when judging the user and click postrotational input receiving area, find this to import pairing control information again.
Further, said method also can have following characteristics: described device is entity analogue means or media player, and described input receiving area comprises the viewing area of button and/or touch-screen.
Compared to prior art, apparatus of the present invention have rotatable characteristic, and still can keep the function of input receiving areas such as button and touch-screen constant after the rotation, function and the operational effect that can show actual product more intuitively, easy to use, simple to operate, save cost of development.
Embodiment
In order to illustrate that the present invention can show and receive the device and the spinning solution thereof of input on screen, this device can be entity analogue means or media player or the like, the entity analogue means here is meant by additive method or instrument (as PC), imitate the device of real-world object outward appearance and behaviour, real-world object can be mobile phone, MP3, electronic dictionary, trivial games machine or the like.Be that example describes with entity analogue means and media playing apparatus below, but apparatus of the present invention are not limited to these two kinds.
First embodiment
As shown in Figure 5, first embodiment of the invention learning machine analogue means comprises the analogue display unit that is used for explicit user interface and operation result; Be used for the analog input unit that the user imports various control informations; Be used to carry out the simulated time control module of time control; The simulated sound that is used to play sound is handled and broadcast unit; Be used to finish other device processes unit that miscellaneous equipment is handled; And the simulation CPU (central processing unit) that the above-mentioned functions unit is controlled, and above-mentioned each functional unit all can respond windows messaging.Wherein:
Analogue display unit is used for the figure of display simulation device, comprises the various buttons that analogue means has and the viewing area of touch-screen in this figure, especially, comprises a viewing area that is used to import the button or the touch-screen of rotate command.These viewing areas are the input receiving area of this device, when the user uses click analogue-key or simulate input area, are handled by the analog input unit.
The analog input unit comprises simulating keyboard input block and simulate input block, the simulating keyboard input block is preserved the location parameter and ID number pre-set (identification number) of the pairing user of each button of the viewing area of button on screen, and the simulate input block is preserved touch-screen can receive the location parameter of the viewing area of input area (present embodiment screen displaying zone is input area) on screen and the control command that touch-screen can receive the input area correspondence.And when judging the user and click certain analogue-key viewing area, the simulating keyboard input block intends producing the high or low level of corresponding row, column (keyboard matrix is required) according to ID number of this button at corresponding port patrix.The simulation CPU (central processing unit) produces keyboard scancode by judging the ranks high-low level, removes to carry out this button and presses the corresponding actions that will carry out.Processing for touch-screen is also very similar, after the simulate input block judges that the user clicks the simulate viewing area, select corresponding input of control commands according to click on area, give the simulation CPU (central processing unit) after this order is handled through the analog converter unit (not shown) and carry out corresponding actions.
This learning machine analogue means also comprises a rotation processing unit, is used to produce the control information of control analogue means figure rotation, comprises the Spin Control information of each button viewing area and screen displaying zone rotation, mainly is postrotational location parameter.
After the user clicks spinfunction corresponding key or touch-screen, by the instruction of analog input unit input Spin Control, notify described rotation processing unit by this analog input unit, rotation processing unit is rotated processing according to received steering order, calculate corresponding Spin Control information, and Spin Control information sent to described simulation CPU (central processing unit), described simulation CPU (central processing unit) sends instruction to analog input unit and analogue display unit, the location parameter in control postrotational button of analog input unit record or screen displaying zone, and the control analogue display unit upgrades the demonstration of analogue means on screen according to postrotational location parameter, the positional information of whole figure after display unit is also preserved and rotated.
As shown in Figure 6, the generation of above-mentioned learning machine analogue means and rotational programme may further comprise the steps:
Step 1: the outward appearance picture (image editing tools can be FONTSHOP) that produces the different shape of the learning machine or the imagination by the graphics edition instrument;
Step 2: editor is generated as the file of data messages such as recording the required outward appearance picture of analogue means, LCD viewing area and key area with test pattern file (as * .BMP etc.);
Step 3: the data message file that loads the generation of simulator maker and step 2 forms simulation CPU (central processing unit) module and comprises that other each functional simulation module of rotation processing unit produces the learning machine analogue means;
Step 4: the user imports the instruction of control rotation and gives described learning machine analogue means;
The user can be by clicking spinfunction corresponding key or touch-screen, and the instruction of input control rotation in dialog box then comprises following information in this instruction: sense of rotation promptly turns clockwise or is rotated counterclockwise; The anglec of rotation, the anglec of rotation can be arbitrarily angled; Rotation based on central point, can or be specified point on the analogue means for a coordinate figure, this coordinate figure or specified point can set in advance also and can be selected by user flexibility.
Step 5: after described learning machine analogue means receives the control rotate instruction, call the Spin Control information such as location parameter that algorithm computation goes out the whole figure of rotation back analogue means and button and screen displaying zone according to the information in the instruction;
The figure of present embodiment analogue means is roughly rectangular, the location parameter of the whole figure of device comprises the upper left corner and lower right corner coordinate after the rotation that goes out according to the information calculations in the Spin Control instruction, and the location parameter of button and touch-screen comprises the position of these input receiving areas with respect to the whole figure upper left corner in the figure.Described position is meant pixel coordinate.
For example, be the initial point of rotation with the upper left corner of analogue means figure, coordinate axis x, y are set, promptly its upper left corner coordinate is (0,0); In described coordinate, in the figure coordinate of certain pixel of screen displaying zone (touch-screen) and each key area be (x1, y1); According to anglec of rotation α calculate the described pixel in figure rotation back coordinate (x2, y2), computing formula is as follows: x2=x1.cos (α)+y1.sin (α); Y2=y1.cos (α)-x1.sin (α), α is the anglec of rotation, reuse this formula and calculate,, can calculate all locations of pixels coordinates of screen displaying zone, figure rotation back and each button viewing area in order to make postrotational figure more accurate.Turn 90 degrees with dextrorotation and to be example, before the figure rotation in the figure coordinate of certain pixel be (x, y), the coordinate of this pixel in the figure of figure rotation back (x1, y1).Correspondingly algorithm can simply be written as x1=y, y1=-x.
Step 6: according to the postrotational location parameter that calculates whole analogue means figure is rotated, upgrading figure is postrotational figure, and preserves postrotational location parameter;
When postrotational location parameter is preserved in the analog input unit, be to preserve before the rotation with location parameter screen displaying zone, rotation back and each button and set up incidence relation simultaneously, anglec of rotation mark (variable) is set.When the user clicks postrotational button or screen displaying zone, the analog input unit according to rotation after the incidence relation of the position of screen displaying zone and button when not rotating, the position of this screen displaying zone and button, obtain the touch-screen control command of screen displaying zone correspondence and ID number of this button correspondence again.
Just finished the rotation of analogue means figure on screen by above step, and still can simulate generation and the high or low level of original on all four port row, column of this button behavior (keyboard matrix is required) to the button operation of this analogue means, to guarantee the constant of the arbitrarily angled back of rotation keypress function.Also still can simulate generation and click the identical control command of former touch screen zone and finish the respective value conversion the operation of touch-screen, guarantee the constant of its original function by analog-converted unit (not shown).
Fig. 7 to Fig. 9 is the synoptic diagram that the foregoing description learning machine analogue means is rotated, analogue means wherein shown in Figure 7 is the learning machine analogue means that is presented on the graphoscope, this analogue means user program enters a certain function, it laterally shows and becomes vertical demonstration, in order to meet the custom needs that literal watches above-mentioned analogue means is rotated.
Fig. 8 counterclockwise revolves according to user's request to turn 90 degrees later learning machine analogue means, and function such as touch-screen of postrotational analogue means, button remains unchanged.
Fig. 9 is an analogue means shown in Figure 7, enters leading figure function interface and clockwise direction and revolves and turn 90 degrees later synoptic diagram, and functions such as touch-screen wherein and button still exist.
Second embodiment
As shown in figure 10, present embodiment is with the example that rotates to be of the media playing apparatus of screen display, this device comprise the picture that is used to display the play display unit, be used for input block, broadcast unit that is used to play sound that the user imports various control informations and the control module that said units is controlled.Input block is preserved the location parameter of each button viewing area (the button here comprised be used for menu and the icon that the user clicks) and is pre-set ID number of each button, and these information are kept in the file of data message.When judging the user and click certain button viewing area, input block finds button ID number of setting, produce corresponding ranks high-low level on this button corresponding port, control module produces keyboard scancode by judging the ranks high-low level, carries out this button and presses the corresponding actions that will carry out.
The present embodiment media playing apparatus also comprises a rotation processing unit, be used to produce the control information of control media playing apparatus figure rotation, comprising the Spin Control information of each button viewing area and screen displaying zone rotation, mainly is postrotational location parameter.
After the user clicks the spinfunction corresponding key, notify described rotation processing unit by input block input Spin Control instruction and by this input block, rotation processing unit is rotated processing according to received steering order, calculate corresponding Spin Control information, and Spin Control information sent to described control module, described control module sends instruction to input block and display unit, the control input block is preserved postrotational key position parameter, and the control display unit upgrades the demonstration of media playing apparatus on screen according to postrotational location parameter, the positional information of whole figure after display unit is also preserved and rotated.
As shown in figure 11, the flow process of present embodiment media playing apparatus rotation may further comprise the steps:
Step 10: the user imports Spin Control and instructs to described media player;
The user can be by clicking the spinfunction corresponding key, and the instruction of input control rotation in dialog box then comprises in this instruction: sense of rotation promptly turns clockwise or is rotated counterclockwise; The anglec of rotation, the anglec of rotation can be arbitrarily angled; Rotation based on central point, can or be specified point on the analogue means for a coordinate figure, this coordinate figure or specified point can set in advance also and can be selected by user flexibility.
Step 20: after described media playing apparatus receives the instruction of control rotation, call the Spin Control information such as location parameter that algorithm computation goes out whole figure of rotation back media playing apparatus and button viewing area thereof according to the information in the instruction;
The figure of present embodiment media playing apparatus is roughly rectangular, the location parameter of the whole figure of device comprises the upper left corner and lower right corner coordinate after the rotation that goes out according to the information calculations in the Spin Control instruction, and the location parameter of button and touch-screen comprises the position of these input receiving areas with respect to the whole figure upper left corner in the figure.Described position is meant pixel coordinate.
Below be that initial point is that example describes with the figure upper left corner:
With the figure upper left corner is initial point, and coordinate axis x, y are set, and promptly its lower left corner coordinate is (0,0); In described coordinate, the coordinate of certain pixel of display unit and each button is (x in the figure
1, y
1); Calculate the coordinate (x of the described pixel in figure rotation back according to anglec of rotation α
2, y
2); Coordinate (the x of described pixel
2, y
2) computing formula as follows: x
2=x
1.cos (α)+y
1.sin (α); y
2=y
1.cos (α)-x
1.sin (α), α are the anglec of rotation, according to above-mentioned algorithm computation all locations of pixels coordinates up to acquisition figure rotation back display unit and each button.
Step 30: be rotated according to the figure (comprising the button viewing area) of the postrotational location parameter that calculates to media playing apparatus, upgrading figure is postrotational figure, and preserves the location parameter of button viewing area, rotation back;
When preserving postrotational location parameter, preserve before the rotation with location parameter each button of rotation back and set up incidence relation simultaneously, anglec of rotation mark (variable) is set.When the user clicks postrotational button viewing area, input block according to rotation after the incidence relation of this key position this key position when not rotating, ID number of finding this button correspondence.Operation to this button still produces and original this button behavior port ranks in full accord high-low level thus, to guarantee the constant of the arbitrarily angled back of media player rotation keypress function.
In sum, the present invention is owing to increased rotation processing unit, when the user imports Spin Control when instruction, the user can obtain a kind ofly can carry out entity simulator or the media player that arbitrarily angled rotation and button and touch-screen (touch panel) function remain unchanged.It can show the function and the operational effect of actual product more intuitively, and is easy to use, simple to operate, saves cost of development.
The present invention is that example is introduced with learning machine analogue means and media playing apparatus, and certainly, the present invention also is applicable to other virtual benchs at other entities of simulation with input block of computer screen demonstration.
In addition, first and second embodiment of the present invention can also increase by a convergent-divergent adjustment unit, to realize functions such as convergent-divergent adjustment, profile variation.After this unit receives the convergent-divergent steering order of user by the input of analog input unit, send scalability information to give the control corresponding unit according to convergent-divergent steering order calculating and sending, described control module sends control information and to input block and demonstration touch screen unit the whole figure of device and the demonstration of input receiving area thereof is carried out the convergent-divergent adjustment.
Described convergent-divergent adjustment unit carries out pantography can use algorithm: width behind the convergent-divergent (Width1)=﹠amp; Width (Width) before the 1* convergent-divergent, height (Height1)=﹠amp behind the convergent-divergent; Height (Height) before the 2* convergent-divergent; (for rectangle).Or x1=﹠amp; 1*x, y1=﹠amp; 2*y; (for coordinate).﹠amp; 1 and ﹠amp; 2 are respectively the zoom factor of x and y direction.Work as ﹠amp; 1 Huo ﹠amp; 2 greater than 1 o'clock, then is amplification on this direction; Work as ﹠amp; 1 and ﹠amp; 2 less than 1 o'clock, on this direction for dwindling.Calling Windows API drawing function afterwards can realize the amplification of figure and dwindle.The location parameter of this screen displaying zone and button viewing area behind the preservation convergent-divergent, incidence relation according to this information screen displaying zone and position, button viewing area when not having convergent-divergent obtains corresponding touch-screen control command in screen displaying zone and ID number of this button correspondence.Still can simulate the operation of this button thus and produce and the high or low level of original this button behavior port row, column in full accord (keyboard matrix), to guarantee the constant of keypress function after the convergent-divergent adjustment.The operation of touch-screen also still produced with clicking identical control command of former touch screen zone and analog-converted unit (not shown) finish the respective value conversion, guarantee the constant of its original function.