CN102707946B - A kind of processing method and processing device of Application Program Interface - Google Patents

A kind of processing method and processing device of Application Program Interface Download PDF

Info

Publication number
CN102707946B
CN102707946B CN201210113700.2A CN201210113700A CN102707946B CN 102707946 B CN102707946 B CN 102707946B CN 201210113700 A CN201210113700 A CN 201210113700A CN 102707946 B CN102707946 B CN 102707946B
Authority
CN
China
Prior art keywords
interface
coordinate
length
application program
width ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201210113700.2A
Other languages
Chinese (zh)
Other versions
CN102707946A (en
Inventor
卢伟超
张波
刘亚萍
黄雅琳
马静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Corp
Original Assignee
TCL Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Corp filed Critical TCL Corp
Priority to CN201210113700.2A priority Critical patent/CN102707946B/en
Publication of CN102707946A publication Critical patent/CN102707946A/en
Application granted granted Critical
Publication of CN102707946B publication Critical patent/CN102707946B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention is applicable to Application Program Interface Display Technique field, provide the processing method and processing device of a kind of Application Program Interface, described method includes: obtain the original interface length and width when target interface length-width ratio of application program, when this original interface length-width ratio is different from this target interface length-width ratio, according to the magnitude relationship between this original interface length-width ratio and this target interface length-width ratio, obtain the displacement parameter in visual coordinate system of the object on this original interface, adjust this object coordinate in this visual coordinate system, visual coordinate after adjusting is projected as view plane coordinate, based on coordinate conversion relation, it is the screen coordinate in this target interface screen coordinate system by the view plane Coordinate Conversion of this object, so that this object shows on this target interface screen.The invention enables this Application Program Interface can adaptive multi-platform, multi-screen resolution.

Description

A kind of processing method and processing device of Application Program Interface
Technical field
The invention belongs to Application Program Interface Display Technique field, particularly relate to the processing method of a kind of Application Program Interface And device.
Background technology
At present, various along with the screen resolution of the terminal units such as smart mobile phone, television set, computer and system platform Changing, the engineering of the adaptive diversified screen of application program and system platform becomes increasingly complex.Such as, operate in different platform Same application, the resolution supported due to different system platform can be different, it usually needs design different interface layouts, with Ensure experience and the Showing Effectiveness On Screen of user, thus existing application interface exists to adapt to multi-platform resolution more The problem of rate.
Summary of the invention
The purpose of the embodiment of the present invention is to provide the processing method and processing device of a kind of Application Program Interface, it is intended to solve by Cannot adaptive multi-platform, the problem of multi-screen resolution in existing application interface.
The embodiment of the present invention is achieved in that the processing method of a kind of Application Program Interface, described method include following Step:
Obtain original interface length-width ratio and the target interface length-width ratio of application program;
When the original interface length-width ratio judging described application program is different from described target interface length-width ratio, according to described Magnitude relationship between original interface length-width ratio and described target interface length-width ratio, obtains on described application program original interface Object displacement parameter in visual coordinate system;
According to described displacement parameter, adjust described object coordinate in described visual coordinate system;
Visual coordinate after adjusting is projected as view plane coordinate;
The coordinate conversion relation of target interface screen coordinate system it is tied to, by the view plane of described object based on view plane coordinate Coordinate Conversion is the screen coordinate in described target interface screen coordinate system, so that described object is at described target interface screen Upper display.
The another object of the embodiment of the present invention is to provide the processing means of a kind of Application Program Interface, described device bag Include:
Interface parameter acquiring unit, for obtaining original interface length-width ratio and the target interface length-width ratio of application program;
Displacement parameter acquiring unit, for when judging the original interface length-width ratio of described application program and described target interface During length-width ratio difference, according to the magnitude relationship between described original interface length-width ratio and described target interface length-width ratio, obtain institute State the displacement parameter in visual coordinate system of the object on application program original interface;
Coordinate Adjusting unit, for according to described displacement parameter, adjusts described object seat in described visual coordinate system Mark;
Two-dimensional assemblage unit, the visual coordinate after adjusting is projected as view plane coordinate;And
Screen coordinate converting unit, closes for being tied to the coordinate transform of target interface screen coordinate system based on view plane coordinate System, is the screen coordinate in described target interface screen coordinate system by the view plane Coordinate Conversion of described object, so that described Object shows on described target interface screen.
The embodiment of the present invention is by obtaining original interface length-width ratio and the target interface length-width ratio of application program, in conjunction with mesh Demarcate the magnitude relationship between face length-width ratio and original interface length-width ratio, according to the displacement parameter got, adjust this object and exist Changing coordinates in this visual coordinate system, and the visual coordinate after adjusting is projected as view plane coordinate, then sit based on view plane Mark is tied to the coordinate conversion relation of target interface screen coordinate system, it is achieved be in this target by the view plane Coordinate Conversion of this object Screen coordinate in interface screen coordinate system, solves owing to existing application interface cannot be divided by adaptive multi-platform, multi-screen The problem of resolution, it is achieved that this application program does not relies on any one operating system, can adaptation be arranged on not adaptively With the purpose in resolution, different system platform.
Accompanying drawing explanation
Fig. 1 is the flowchart of the processing method of the Application Program Interface that first embodiment of the invention provides;
Fig. 2 is the schematic diagram of view frustums model in Fig. 1;
Fig. 3 is projection relation schematic diagram in Fig. 1;
Fig. 4 (a), 4 (b) are view plane and the length and width schematic diagram of display screen in Fig. 1 respectively;
Fig. 5 is the structure chart of the processing means of the Application Program Interface that second embodiment of the invention provides.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, right The present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, and It is not used in the restriction present invention.
The embodiment of the present invention has only to pre-set the original interface length-width ratio of same application, by this is original Interface length-width ratio compares with target interface length-width ratio, then according to the displacement of the object on comparative result adjustment original interface, Application developer is made to have only to develop a kind of interface layout with optimal adaptive screen resolution, it is possible to be arranged on In different system platforms, the most adaptive different screen resolution, decreases the workload of developer, also improves user and uses Experience.
Below in conjunction with specific embodiment the present invention implemented and is described in detail:
Embodiment one:
Fig. 1 shows the flow process that realizes of the processing method of the Application Program Interface that first embodiment of the invention provides, and describes in detail As follows:
In step S101, obtain original interface length-width ratio and the target interface length-width ratio of application program.
In specific implementation process, due to the original interface of same application, often to pre-set one original optimal suitable Join screen resolution, and this application program it is frequently necessary to be installed in the middle of different systems, the different boundaries of same system platform The different interfaces of face or different system platform are likely to there are different resolution or the length and width of different interface display Ratio, if as a example by the display interface of the different resolution of different system platform, original when pre-setting this application program one Good adaptive screen resolution, this optimal adaptive screen resolution can adaptive a certain system platform, and when by this application program When being installed in the system platform of another concrete different resolution, then need the processing method utilizing the embodiment of the present invention to provide first First obtain the original optimal adaptive screen resolution of this application program, and from current system platform, obtain target device physics The resolution of screen, such as 720P, 1080P etc., then can easily obtain this mesh according to the resolution of target device physical screen Face length of demarcating width ratio, resolution or the title target interface resolution of this target device physical screen refer to install this system platform Mobile terminal support screen resolution.Generally, during this application program uses, can be by calling The application program interface function of system platform, the automatically resolution of the display interface of detection acquisition physical screen, if can not basis Interface function obtains, generally, it is also possible to arrange this target interface resolution by hand identical with screen physical resolution.And The step of the original interface length-width ratio obtaining application program is specially and obtains application journey according to original optimal adaptive screen resolution The original interface length-width ratio of sequence, i.e. can obtain screen aspect according to the long dimension of this resolution with the Pixel Information of wide dimension Ratio.
In step s 102, different from this target interface length-width ratio when the original interface length-width ratio judging this application program Time, according to the magnitude relationship between this original interface length-width ratio and this target interface length-width ratio, obtain the original boundary of this application program The object on face displacement parameter in visual coordinate system.
In specific implementation process, need to judge the original boundary of this target interface length-width ratio and this application program got Face length-width ratio is the most identical, when being judged as identical, the most now need not the object on this Application Program Interface at view plane Coordinate figure in coordinate system makes any change, directly can be by the object on this Application Program Interface in this visual coordinate system Changing coordinates is projected as view plane coordinate, then is tied to the coordinate transform pass of target interface screen coordinate system based on view plane coordinate System, is this target interface screen coordinate by this view plane Coordinate Conversion, or directly arranges the target interface of current system platform Resolution is the original optimal adaptive screen resolution of this application program, so that Application Program Interface and target circle of system platform Face adapts.
In step s 103, according to this displacement parameter, adjust this object coordinate in this visual coordinate system.
In this step S102:
The note length of original interface, width are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws, it is judged that If Lp/Wp Yu Ls/Ws is all higher than 1 or respectively less than 1, this displacement parameter is (Lp/Wp)/(Ls/Ws);
The most now, this step S103 specifically includes following steps:
If (Lp/Wp) more than (Ls/Ws), then adjusting this object Y-axis coordinate y in visual coordinate system is y ', y '=y × displacement parameter;
If (Lp/Wp) less than (Ls/Ws), then adjusting this object X-axis coordinate x in visual coordinate system is x ', x '=x × displacement parameter.
As the present invention one example, this step S102 particularly as follows:
The note length of original interface, width are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws, it is judged that If Lp/Wp Yu Ls/Ws one of them more than 1, when another is less than 1, this displacement parameter is (Wp/Lp)/(Ls/Ws);
The most now, this step S103 specifically includes following steps:
If (Wp/Lp) more than (Ls/Ws), then adjusting this object Y-axis coordinate y in visual coordinate system is y ', y '=y × displacement parameter;
If (Wp/Lp) less than (Ls/Ws), then adjusting this object X-axis coordinate x in visual coordinate system is x ', x '=x × displacement parameter.
In embodiments of the present invention, for convenience, below by optimal adaptive to original interface or the title of this application program The length at the interface that screen resolution is corresponding, width represent with Lp, Wp respectively, and the mesh of this application program system to be installed Demarcate face or physical screen length, width represents with Ls, Ws respectively, then this original interface length-width ratio is long with this target interface Wide ratio represents with Lp/Wp with Ls/Ws respectively.
Specifically, original optimal adaptive screen resolution size 720P preset if there is an application program, should Application program is arranged on the goal systems platform that target interface resolution is 1080P, or the current interface of an application program Size 1080P, is installed in the situation in the goal systems platform of 720P, if this original optimal adaptive screen preset is differentiated Interface length-width ratio and this target interface length-width ratio that rate is corresponding are 16: 9, then identical due to their length-width ratio, deserve prezone Face length-width ratio is 1 with ratio (Lp/Wp)/(Ls/Ws) of this target interface length-width ratio, then the object on this Application Program Interface Displacement parameter in view plane coordinate system is the ratio of this original interface length-width ratio and this target interface length-width ratio, namely this position Shifting parameter is 1, because making any change without to this object coordinate figure in view plane coordinate system, it is only necessary to directly carry out The imaging of this application program on view plane is converted into the coordinate step on target interface screen.
Specifically, when this original interface length-width ratio is all higher than 1 or respectively less than 1 with this target interface length-width ratio, namely If Lp/Wp Yu Ls/Ws is all higher than 1 or respectively less than 1, it is divided into following two situation, it is assumed that object p is under visual coordinate system Coordinate be (x, y), the coordinate after adjustment is (x ', y '):
1) if. Lp/Wp be more than Ls/Ws, then illustrate this application program be intended on the widest screen run, this Shi Ruguo does not do any operation, then the most same fat person of effect of final display is drawn high in the width direction, now camera Camera keeps constant from the distance of view plane, owing to Aspect Ratio changes Ls/Ws into, needs this object in visual coordinate system Vertical coordinate y value increase.Therefore the object inside view frustums should do corresponding mobile it can be understood as actual object along Y-axis Coordinate direction moves to y ' position, otherwise possibly cannot show, it may be assumed that displacement parameter is (Lp/Wp)/(Ls/Ws), y '=y × (Lp/Wp)/(Ls/Ws), and x value is constant, the respective coordinates after adjustment is (x, y ').
2) if. Lp/Wp be less than Ls/Ws, then explanation be intended to operate on the narrowest screen operation, if now Do not do any operation, then the most same lean person of effect of final display by along length to elongation, for this solution it is required that general The x value of this object diminishes, and therefore the object inside view frustums should do corresponding mobile, otherwise possibly cannot show, reduces X-axis and sits Scale value, it may be assumed that x '=x × (Lp/Wp)/(Ls/Ws), and y value is constant, the coordinate in visual coordinate system of the correspondence after adjustment is (x ', y).
Specifically, when in this original interface length-width ratio with this target interface length-width ratio, one is less than 1, and another is more than 1, Namely if Lp/Wp Yu Ls/Ws has one more than 1, one less than 1 time, be also classified into two kinds of situations, as following:
When in this original interface length-width ratio preset with this target interface length-width ratio, one is less than 1, when another is more than 1, Namely if Lp/Wp with Ls/Ws has one be more than, one less than 1 time, be also classified into following two situation, then firstly the need of will Object in 3D or 2.5D Application Program Interface, all with view plane normal vector direction (camera coordinates system Z axis) as shown in Figure 2 For axle center 90-degree rotation to the left, then this each object 90-degree rotation to the right with respective centre axis Z for axle center again, after setting Make the following judgment:
1) if. Wp/Lp be more than Ls/Ws, then illustrate that this application program is intended to operate on the widest screen fortune OK, if the most not doing any operation, then the most same fat person of effect of final display is drawn high in the width direction.Phase at this moment Machine keeps constant from the distance of view plane, and owing to Aspect Ratio needs to change Ls/Ws into, therefore the object inside view frustums should do phase The movement answered, the most possibly cannot show, so only need to be increased by y-axis coordinate, be adjusted to: y '=y × (Wp/Lp)/(Ls/ Ws), x coordinate value is constant.
2) if. Wp/Lp be less than Ls/Ws, then explanation be intended to operate on the narrowest screen operation, now camera Distance from view plane keeps constant, owing to Aspect Ratio needs to change Ls/Ws into, then needs the object inside by view frustums to do Corresponding mobile, so only x-axis coordinate need to be diminished, it is adjusted to: x '=x × (Wp/Lp)/(Ls/Ws), y-coordinate value is constant.
And then, the coordinate after the renewal under visual coordinate of all objects on this Application Program Interface can be obtained.
In step S104, the visual coordinate after adjusting is projected as view plane coordinate.
In embodiments of the present invention, for the Application Program Interface of 3D or 2.5D, need according in computer graphics The method of perspective projection set up view frustums model as shown in Figure 2, wherein, view frustums (or is referred to as by eye position eye The camera position of camera), nearly cutting plane np (near clipping plane), yonder clipping plane fp (far clipping Plane) composition, left represents the np plane left margin distance apart from this np planar central, right represent np plane right margin away from From the distance of this np planar central, left Yu right is reverse, top represent np plane coboundary apart from this np planar central away from From, bottom represents the np plane lower boundary distance apart from this np planar central, top with bottom is reverse.If selecting nearly cutting Plane is as projection plane or claims view plane, for the coordinate p in visual coordinate system of any object p in view frustums (x, y, Z) projecting to the point after this view plane is p ' (x ', y '), and any of which object coordinate in visual coordinate system is at needs root Coordinate figure when adjusting according to step S103, after adjustment.As it is shown on figure 3, N is the distance of eye to np, F be eyes arrive remote cutting put down The distance in face, by similar triangles character, can obtain the coordinate of p ', namely can obtain this 3D or 2.5D application program Project objects on original interface is to the coordinate in this view plane coordinate system, and this view plane coordinate system is also with this np plane Center is initial point, and level is the positive direction of abscissa x to the left, the two dimension seat constituted by the positive direction of vertical coordinate y vertically upward Mark system.It should be noted that the coordinate that the object on this application program original interface is in visual coordinate system is the seat after adjusting Mark, according to step S104, the visual coordinate after adjusting is projected as view plane coordinate.
In step S105, it is tied to the coordinate conversion relation of target interface screen coordinate system based on view plane coordinate, should The view plane Coordinate Conversion of object is the screen coordinate in this target interface screen coordinate system, so that this object is in this target circle Show on the screen of face.
Wherein, this view plane coordinate is tied to shown in the coordinate conversion relation equation below of target interface screen coordinate system:
xs = Ls - 1 Lp xp + Ls - 1 2 = ( Ls - 1 ) ( xp Lp + 0.5 ) , - - - ( 1 )
ys = Ws - 1 Wp yp + Ws - 1 2 = ( Ws - 1 ) ( yp Wp + 0.5 ) , - - - ( 2 )
Wherein, Lp, Wp represent the length of the original interface of this Application Program Interface, width respectively, and Ls, Ws represent this respectively The length of the target interface of Application Program Interface, width, (xp, yp) represents that the object of this Application Program Interface is at view plane coordinate Coordinate in system, (xs, ys) represents the object of this Application Program Interface coordinate in target interface screen coordinate system.
In specific implementation process, this above-mentioned formula (1), (2) are according to perspective projection existing in computer graphics Methods etc. are set up, as in figure 2 it is shown, further according to the projection relation shown in Fig. 3, by similar triangles character, it can be deduced that P ' The changing coordinates under visual coordinate system, in conjunction with view frustums and the relation of view plane, the master pattern etc. of perspective projection, permissible The view plane coordinate that visual coordinate after adjusting is projected as in view plane coordinate system, then by saturating to the imaging on this view plane or title Result depending on projecting is converted into the screen of target interface and shows, is respectively view plane and display screen as shown in Fig. 4 (a), 4 (b) The length and width schematic diagram of curtain, may finally obtain above-mentioned formula (1), (2), so that this view plane coordinate system is transformed into screen coordinate System.Owing to this transformational relation is prior art, do not repeat them here.And then, can be according to this formula (1), (2) namely based on this View plane coordinate is tied to the coordinate conversion relation of target interface screen coordinate system, and this object after updating is at this view plane coordinate Coordinate Conversion in system is this target interface screen coordinate.
In embodiments of the present invention, the processing method of this Application Program Interface is according to target interface length-width ratio, to this application The long width values of original interface preset in program, the coordinate figure etc. under visual coordinate system of the object on this original interface are adjusted Whole, and the view plane coordinate that is projected as in view plane coordinate system of visual coordinate after adjusting, it is tied to mesh based on view plane coordinate Demarcating the coordinate conversion relation of face screen coordinate system, the coordinate figure after adjusting is mapped to the screen coordinate of target interface, it is achieved Accurate display on the display screen, thus reach the display interface of the same application adaptation multiple resolution of kinds of platform Purpose, improves adaptability, motility that application program is installed, run, also saves application development cost, promote user Experience.
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method is permissible Instructing relevant hardware by program to complete, described program can be stored in a computer read/write memory medium, Described storage medium, such as ROM/RAM, disk, CD etc..
Embodiment two:
Fig. 5 shows the structure of the processing means of the Application Program Interface that second embodiment of the invention provides, for the ease of Illustrate, illustrate only the part relevant to the embodiment of the present invention.
The processing means of this Application Program Interface includes interface parameter acquiring unit 51, displacement parameter acquiring unit 52, sits Mark adjustment unit 53, two-dimensional assemblage unit 54 and screen coordinate converting unit 55 wherein:
Interface parameter acquiring unit 51, for obtaining original interface length-width ratio and the target interface length and width of application program Ratio.
Interface parameter acquiring unit 51 specifically includes:
Original interface parameter acquiring unit, for obtaining the original of application program according to original optimal adaptive screen resolution Interface length-width ratio;And
Target interface parameter acquiring unit, obtains target interface length and width for the resolution according to target device physical screen Ratio.
Displacement parameter acquiring unit 52, for when judging that the original interface length-width ratio of this application program and this target interface are long Wide than time different, according to the magnitude relationship between this original interface length-width ratio and this target interface length-width ratio, obtain this application journey The object on sequence original interface displacement parameter in visual coordinate system.
In embodiments of the present invention, the processing means of this Application Program Interface also includes:
Comparing unit, for judging the original interface length-width ratio whether phase of this target interface length-width ratio and this application program With;
First converting unit, for when this comparing unit output result is for being, by the object on this Application Program Interface Changing coordinates in this visual coordinate system is projected as view plane coordinate, and triggers screen coordinate converting unit 55;And
Second converting unit, for when this comparing unit output result is no, triggering this displacement parameter acquiring unit 52.
And when the original interface length-width ratio judging this application program is different from this target interface length-width ratio, this displacement parameter Acquiring unit 52 specifically includes:
Judging unit 521, is used for judging whether Lp/Wp Yu Ls/Ws is all higher than 1 or respectively less than 1, wherein, remembers that this is original The length at interface, width are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws;
First parameter acquiring unit 522, for when this judging unit 521 exports result for being, arranges this displacement parameter For (Lp/Wp)/(Ls/Ws);And
Second parameter acquiring unit 523, for when this judging unit 521 export result be no time, this displacement parameter is set For (Wp/Lp)/(Ls/Ws).
In embodiments of the present invention, as a example by the display interface of the different length-width ratios of different system platform, when pre-setting The interface length-width ratio that the original optimal adaptive screen resolution of this application program one good is corresponding, this preferably original interface length-width ratio energy Enough adaptive a certain system platforms, and when in the system platform that this application program is installed to another concrete different length-width ratios, The original optimal adaptive screen then needing the processing method utilizing the embodiment of the present invention to provide first to obtain this application program is differentiated Rate, and from this current system platform, obtain the resolution of target device physical screen, such as 720P, 1080P etc., then basis The resolution of target device physical screen can easily obtain this target interface length and width ratio, dividing of this target device physical screen The screen resolution that resolution or the mobile terminal claiming target interface resolution to refer to install this system platform are supported.Ordinary circumstance Under, during this application program uses, can be by the application program interface function of calling system platform, detection obtains automatically Take the resolution of the display interface of physical screen, if can not obtain according to interface function, generally, it is also possible to set by hand Put this target interface resolution identical with optimal adaptive screen resolution.And the original interface length-width ratio that obtains application program is concrete For obtaining the original interface length-width ratio of application program according to original optimal adaptive screen resolution.
And then, whether need to judge the original interface length-width ratio of this target interface length-width ratio of getting and this application program Identical, when being judged as identical, then need not the coordinate figure in view plane coordinate system of the object on this Application Program Interface Make any change, directly can be projected as the changing coordinates in this visual coordinate system of the object on Application Program Interface regarding putting down Areal coordinate, then it is tied to the coordinate conversion relation of target interface screen coordinate system based on view plane coordinate, by this Application Program Interface On object changing coordinates in this view plane coordinate system be converted to this target interface screen coordinate, or can also directly set The target interface resolution putting current system platform is the original optimal adaptive screen resolution of this application program, so that application journey Sequence interface adapts with the target interface of system platform.
And when judging that this original interface length-width ratio is different from this target interface length-width ratio, for the application of 3D or 2.5D Program interface, needs the view frustums model as shown in Figure 2 that the method according to the perspective projection in computer graphics is set up, as Projection relation schematic diagram shown in Fig. 3, can obtain the working as under view plane coordinate system of the object on this application program original interface Front coordinate, can obtain this thing according to judging unit the 521, first parameter acquiring unit the 522, second parameter acquiring unit 523 etc. The displacement parameter of body, to be adjusted the conversion of its changing coordinates so that visual coordinate adapts to the length of target interface, width.
Coordinate Adjusting unit 53, for according to this displacement parameter, adjusts this object coordinate in this visual coordinate system.
This Coordinate Adjusting unit 53 specifically includes:
Coordinates process unit, for being multiplied by this position by this object current X-coordinate in this visual coordinate system or Y coordinate Shifting parameter;And
Coordinate updates subelement, is the coordinate after being multiplied by this displacement parameter for updating this changing coordinates.
Two-dimensional assemblage unit 54, the visual coordinate after adjusting is projected as view plane coordinate.
In embodiment of the present invention, based on the above-mentioned displacement parameter got, update this object in this visual coordinate system In current vertical coordinate or abscissa so that the coordinate of this object is according to the original interface length-width ratio of this application program and this mesh The magnitude relationship between the length-width ratio of face of demarcating makees corresponding displacement, and the visual coordinate after adjusting is projected as view plane coordinate.
Screen coordinate converting unit 55, for being tied to the coordinate transform of target interface screen coordinate system based on view plane coordinate Relation, is the screen coordinate in this target interface screen coordinate system by the view plane Coordinate Conversion of this object.
In this screen coordinate converting unit 55, view plane coordinate is tied to the coordinate conversion relation of target interface screen coordinate system Shown in equation below:
xs = Ls - 1 Lp xp + Ls - 1 2 = ( Ls - 1 ) ( xp Lp + 0.5 ) ,
ys = Ws - 1 Wp yp + Ws - 1 2 = ( Ws - 1 ) ( yp Wp + 0.5 ) ,
Wherein, Lp, Wp represent the length of the original interface of this Application Program Interface, width respectively, and Ls, Ws represent this respectively The length of the target interface of Application Program Interface, width, (xp, yp) represents that the object of this Application Program Interface is at view plane coordinate Coordinate in system, (xs, ys) represents the object of this Application Program Interface coordinate in target interface screen coordinate system.
In embodiments of the present invention, owing to finally this application program to be operated in the display screen of goal systems platform In, object in the updated after abscissa or vertical coordinate, utilizes two-dimensional assemblage unit 54 in this visual coordinate system Carry out projection change, according to this formula (1), (2), namely be tied to the seat of target interface screen coordinate system based on this view plane coordinate Mark transformation relation, the Coordinate Conversion in this view plane coordinate system of this object after updating is this target interface screen coordinate.
In embodiments of the present invention, the processing means of this Application Program Interface obtains application according to interface parameter acquiring unit The target interface length-width ratio of program and target interface length-width ratio;When original interface length-width ratio and this mesh of judging this application program During face length-width ratio difference of demarcating, displacement parameter acquiring unit is according to the original interface length-width ratio of this application program and this target interface Magnitude relationship between length-width ratio, obtains the displacement parameter in visual coordinate system of the object on this application program original interface; Coordinate Adjusting unit, according to this displacement parameter, adjusts this object coordinate in this visual coordinate system;Two-dimensional assemblage unit Visual coordinate after adjusting is projected as view plane coordinate;The coordinate of target interface screen coordinate system it is tied to based on view plane coordinate Transformation relation, coordinate transformation unit is by screen that the view plane Coordinate Conversion of this object is in this target interface screen coordinate system Coordinate.Thus, only need to preset original interface length-width ratio and the original interface length-width ratio of application program, it is possible to by this application program It is arranged on and has in the identical of different resolution or different system platform, do not rely on any one operating system, solve The location problem of Application Program Interface under different resolution, also solving application program cannot adaptive diversified screen and system The problem of platform.
The processing method of this Application Program Interface that the embodiment of the present invention provides, by setting in advance in a certain application program Put a kind of original optimal adaptive screen resolution, namely an optimal interface length-width ratio has been set, it is possible to according to itself and target circle Relation between the length-width ratio of face, the long width values of self-adaptative adjustment original interface width values long with target interface is identical, and can self adaptation Adjust the displacement of object on original interface, finally can be accurately displayed in target interface, and there is preferable display effect, Relative in prior art, application developer needs to develop correspondence specially for each resolution or each system platform A kind of application program, there is workload compared with the problem big, maintenance work difficulty is big, the embodiment of the present invention also makes making of user All it is improved with Showing Effectiveness On Screen with experiencing.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention Any amendment, equivalent and the improvement etc. made within god and principle, should be included within the scope of the present invention.

Claims (7)

1. the processing method of an Application Program Interface, it is characterised in that described method comprises the steps:
Obtain original interface length-width ratio and the target interface length-width ratio of application program;
When the original interface length-width ratio judging described application program is different from described target interface length-width ratio, according to described original Magnitude relationship between interface length-width ratio and described target interface length-width ratio, obtains the object on described application program original interface Displacement parameter in visual coordinate system;
According to described displacement parameter, adjust described object coordinate in described visual coordinate system;
The view plane coordinate that visual coordinate after adjusting is projected as in view plane coordinate system;
The coordinate conversion relation of target interface screen coordinate system it is tied to, by the view plane coordinate of described object based on view plane coordinate Be converted to the screen coordinate in described target interface screen coordinate system, so that described object is aobvious on described target interface screen Show;
Wherein, described according to the magnitude relationship between described original interface length-width ratio and described target interface length-width ratio, obtain institute State the step of the displacement parameter in view plane coordinate system of the object on application program original interface particularly as follows:
The note length of original interface, width are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws, it is judged that if When Lp/Wp Yu Ls/Ws is all higher than 1 or respectively less than 1, described displacement parameter is (Lp/Wp)/(Ls/Ws), described in the most described basis Displacement parameter, adjusts the step of described object coordinate in described visual coordinate system and specifically includes following steps:
If (Lp/Wp) more than (Ls/Ws), then adjust described object Y-axis coordinate y in visual coordinate system be y ', y '=y × Displacement parameter;
If (Lp/Wp) less than (Ls/Ws), then adjust described object X-axis coordinate x in visual coordinate system be x ', x '=x × Displacement parameter;
If judge Lp/Wp Yu Ls/Ws one of them more than 1, when another is less than 1, described displacement parameter be (Wp/Lp)/ (Ls/Ws), the most described according to described displacement parameter, the step adjusting described object coordinate in described visual coordinate system is concrete Comprise the following steps:
If (Wp/Lp) more than (Ls/Ws), then adjust described object Y-axis coordinate y in visual coordinate system be y ', y '=y × Displacement parameter;
If (Wp/Lp) less than (Ls/Ws), then adjust described object X-axis coordinate x in visual coordinate system be x ', x '=x × Displacement parameter.
2. the method for claim 1, it is characterised in that described view plane coordinate is tied to target interface screen coordinate system Shown in coordinate conversion relation equation below:
x s = L s - 1 L p x p + L s - 1 2 = ( L s - 1 ) ( x p L p + 0.5 ) ,
y s = W s - 1 W p y p + W s - 1 2 = ( W s - 1 ) ( y p W p + 0.5 ) ,
Wherein, Lp, Wp represent the length of the original interface of described Application Program Interface, width respectively, and Ls, Ws represent described respectively The length of the target interface of Application Program Interface, width, (xp, yp) represents that the object of described Application Program Interface is sat at view plane Coordinate in mark system, (xs, ys) represents the object of described Application Program Interface coordinate in target interface screen coordinate system.
3. the method for claim 1, it is characterised in that the original interface length-width ratio of described acquisition application program and mesh The step of face length-width ratio of demarcating particularly as follows:
The original interface length-width ratio of application program is obtained, according to target device physics screen according to original optimal adaptive screen resolution The resolution of curtain obtains the length-width ratio of target display interface.
4. the processing means of an Application Program Interface, it is characterised in that described device includes:
Interface parameter acquiring unit, for obtaining original interface length-width ratio and the target interface length-width ratio of application program;
Displacement parameter acquiring unit, for when judging the original interface length-width ratio of described application program and described target interface length and width Than time different, according to the magnitude relationship between described original interface length-width ratio and described target interface length-width ratio, obtain described answering With the displacement parameter in visual coordinate system of the object on program original interface;
Coordinate Adjusting unit, for according to described displacement parameter, adjusts described object coordinate in described visual coordinate system;
Two-dimensional assemblage unit, the visual coordinate after adjusting is projected as view plane coordinate;And
Screen coordinate converting unit, for being tied to the coordinate conversion relation of target interface screen coordinate system based on view plane coordinate, It is the screen coordinate in described target interface screen coordinate system by the view plane Coordinate Conversion of described object, so that described object Described target interface screen shows;
Wherein, described displacement parameter acquiring unit specifically includes:
Judging unit, is used for judging whether Lp/Wp Yu Ls/Ws is all higher than 1 or respectively less than 1, wherein, the length of note original interface Degree, width are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws;
First parameter acquiring unit, for when described judging unit output result is for being, arranging described displacement parameter is (Lp/ Wp)/(Ls/Ws);And
Second parameter acquiring unit, for when described judging unit output result is no, arranging described displacement parameter is (Wp/ Lp)/(Ls/Ws)。
5. device as claimed in claim 4, it is characterised in that described Coordinate Adjusting unit specifically includes:
Coordinates process unit, described for the described object current X-coordinate in described visual coordinate system or Y coordinate are multiplied by Displacement parameter;And
Coordinate updates subelement, is the coordinate after being multiplied by described displacement parameter for updating changing coordinates.
6. device as claimed in claim 4, it is characterised in that view plane coordinate system described in described screen coordinate converting unit To shown in the coordinate conversion relation equation below of target interface screen coordinate system:
x s = L s - 1 L p x p + L s - 1 2 = ( L s - 1 ) ( x p L p + 0.5 ) ,
y s = W s - 1 W p y p + W s - 1 2 = ( W s - 1 ) ( y p W p + 0.5 ) ,
Wherein, Lp, Wp represent the length of the original interface of described Application Program Interface, width respectively, and Ls, Ws represent described respectively The length of the target interface of Application Program Interface, width, (xp, yp) represents that the object of described Application Program Interface is sat at view plane Coordinate in mark system, (xs, ys) represents the object of described Application Program Interface coordinate in target interface screen coordinate system.
7. device as claimed in claim 4, it is characterised in that described interface parameter acquiring unit specifically includes:
Original interface parameter acquiring unit, for obtaining the original interface of application program according to original optimal adaptive screen resolution Length-width ratio;And
Target interface parameter acquiring unit, obtains target interface length-width ratio for the resolution according to target device physical screen.
CN201210113700.2A 2012-04-17 2012-04-17 A kind of processing method and processing device of Application Program Interface Expired - Fee Related CN102707946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210113700.2A CN102707946B (en) 2012-04-17 2012-04-17 A kind of processing method and processing device of Application Program Interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210113700.2A CN102707946B (en) 2012-04-17 2012-04-17 A kind of processing method and processing device of Application Program Interface

Publications (2)

Publication Number Publication Date
CN102707946A CN102707946A (en) 2012-10-03
CN102707946B true CN102707946B (en) 2016-08-17

Family

ID=46900770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210113700.2A Expired - Fee Related CN102707946B (en) 2012-04-17 2012-04-17 A kind of processing method and processing device of Application Program Interface

Country Status (1)

Country Link
CN (1) CN102707946B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023849A (en) * 2009-09-22 2011-04-20 北京搜狗科技发展有限公司 Processing method and device for multi-platform multi-resolution application program interface
CN102981793B (en) * 2012-11-22 2017-02-15 深圳Tcl工业研究院有限公司 Screen synchronization method and device
CN104423950B (en) * 2013-09-02 2021-05-18 联想(北京)有限公司 Information processing method and electronic equipment
CN103559096B (en) * 2013-09-05 2017-07-11 香港四维软件有限公司 Computer software port slitless connection method
CN104516703B (en) * 2013-09-30 2018-02-16 中国电信股份有限公司 The method and system of virtual desktop screen resolution automatic adaptation is realized in android terminal
CN103546689B (en) * 2013-10-11 2018-02-13 Tcl集团股份有限公司 The resolution ratio acquisition methods and device of external camera of android system
CN110888521B (en) * 2015-07-16 2023-07-18 华为技术有限公司 Mobile terminal and application program running method thereof
CN105187634A (en) * 2015-08-07 2015-12-23 北京思特奇信息技术股份有限公司 Method and system for enabling terminal application to dynamically adapt to intelligent terminal screen
CN105225201B (en) * 2015-09-06 2018-07-06 网易(杭州)网络有限公司 A kind of method and system for showing object adaptive resolution and showing
CN106528273B (en) * 2016-10-31 2020-12-11 北京小米移动软件有限公司 Application program management method and device
CN107506163B (en) * 2017-08-31 2022-11-15 努比亚技术有限公司 Method for adjusting screen display, terminal and computer readable storage medium
CN108334391A (en) * 2017-12-31 2018-07-27 广州金十信息科技有限公司 A kind of multisystem shows adaptation method, electronic equipment and storage medium
CN108765582B (en) * 2018-04-28 2022-06-17 海信视像科技股份有限公司 Panoramic picture display method and device
CN109783181B (en) * 2019-01-31 2019-12-20 掌阅科技股份有限公司 Screen adaptive display method, electronic device and computer storage medium
CN110928407B (en) * 2019-10-30 2023-06-09 维沃移动通信有限公司 Information display method and device
CN112822157A (en) * 2020-12-25 2021-05-18 广州朗国电子科技有限公司 Data sharing method and device between electronic whiteboards and storage medium
CN112667343B (en) * 2021-01-07 2024-03-01 苏州沁游网络科技有限公司 Interface adjustment method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222570A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Image browser using for mobile terminal and image regulation method
CN101789132A (en) * 2010-01-22 2010-07-28 苏州领航自动化科技有限公司 Display method of single-view multiple OpenGL viewports
CN101853121A (en) * 2010-03-02 2010-10-06 深圳市同洲电子股份有限公司 Picture browsing method and device based on gravity sensor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6933954B2 (en) * 2003-10-31 2005-08-23 Microsoft Corporation Aspect ratio conversion of video content

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222570A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Image browser using for mobile terminal and image regulation method
CN101789132A (en) * 2010-01-22 2010-07-28 苏州领航自动化科技有限公司 Display method of single-view multiple OpenGL viewports
CN101853121A (en) * 2010-03-02 2010-10-06 深圳市同洲电子股份有限公司 Picture browsing method and device based on gravity sensor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于游戏引擎的3D图形系统的研究;胡丹桂;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑 第03期》;20060315;参见正文第8页,第14-18页,第44页 *

Also Published As

Publication number Publication date
CN102707946A (en) 2012-10-03

Similar Documents

Publication Publication Date Title
CN102707946B (en) A kind of processing method and processing device of Application Program Interface
CN103576973B (en) Display panel, portable device and control method applied thereto
CN109783181A (en) Screen is adapted to display methods, electronic equipment and computer storage medium
CN102368796B (en) Mobile phone unlocking interface switch control method
CN107273000B (en) Screen multi-resolution adaptation method of intelligent oscilloscope
CN106648511A (en) Self-adaptive display method and device of display resolutions
CN112099887B (en) Interface adjusting method and device, computer equipment and computer readable storage medium
CN104035664A (en) Display method and device for user interface of application program
CN103473737A (en) Image processing device, image processing method, and program
CN103544253A (en) Implementation method and system for displaying images in waterfall flow manner
CN103530117A (en) Method and device for adapting to screens, of different sizes, of mobile terminals
JP2012253736A (en) Vehicle display device and information display system
US20090009535A1 (en) Display processing device and display control method
JP3845386B2 (en) Correction method for off-screen area in geometric correction interface using auxiliary lines
CN105912314A (en) Layout method and system for user interface control, and control method and system for user interface control
CN106844521A (en) Cross-terminal three-dimensional digital earth exchange method based on B/S framework
CN107491028A (en) Pile type edit methods and device
CN105867800A (en) Display region adjustment method and apparatus
CN107861711B (en) Page adaptation method and device
CN104020925A (en) Projection method and device
CN102074025B (en) Image stylized drawing method and device
CN103744869A (en) Method, device and browser for displaying hotspot keyword
CN105069841A (en) Sea and land combined visualization method based on OSG three-dimensional engine
CN111580729B (en) Processing method and system for selecting overlapped graphics primitives, readable storage medium and electronic equipment
CN106126006A (en) A kind of data display method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160817