CN102707946A - Application program interface processing method and device - Google Patents

Application program interface processing method and device Download PDF

Info

Publication number
CN102707946A
CN102707946A CN2012101137002A CN201210113700A CN102707946A CN 102707946 A CN102707946 A CN 102707946A CN 2012101137002 A CN2012101137002 A CN 2012101137002A CN 201210113700 A CN201210113700 A CN 201210113700A CN 102707946 A CN102707946 A CN 102707946A
Authority
CN
China
Prior art keywords
coordinate
interface
application program
breadth ratio
original
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.)
Granted
Application number
CN2012101137002A
Other languages
Chinese (zh)
Other versions
CN102707946B (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

Images

Abstract

The invention is applicable to the technical field of application program interface display, and provides an application program interface processing method and a device. The method comprises acquiring the length-width ratio of an original interface and the length-width ratio of a target interface of the application program; acquiring displacement parameters of an object on the original interface in a visual coordinate system according to the relationship of the numerical size between the length-width ratios of the original interface and the target interface when the length-width ratios of the original interface and the target interface are different; adjusting the coordinates of the object in the visual coordinate system; projecting the adjusted visual coordinates to visual plane coordinates; and converting the visual plane coordinates of the object into screen coordinates in a screen coordinate system of the target interface, and displaying the object on the screen of the target interface. According to the application program interface processing method and device provided by the invention, the application program interface is adaptive to multi-platform and multi-screen resolutions.

Description

A kind of disposal route of Application Program Interface and device
Technical field
The invention belongs to Application Program Interface display technique field, relate in particular to a kind of disposal route and device of Application Program Interface.
Background technology
At present, along with the screen resolution of terminal devices such as smart mobile phone, televisor, computer and the variation of system platform, the engineering of adaptive diversified screen of application program and system platform becomes increasingly complex.For example; Operate in the same application on the different platform; Because the resolution that different system platform is supported can be different; Usually need the different interface layout of design, with assurance user's experience and screen display effect, thereby there is the problem that can't adapt to multi-platform multiresolution in the existing application interface.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of disposal route and device of Application Program Interface, is intended to solve because the existing application interface is can't be adaptive multi-platform, the problem of multi-screen resolution.
The embodiment of the invention is achieved in that a kind of disposal route of Application Program Interface, and said method comprises the steps:
Obtain the original interface length breadth ratio and the target interface length breadth ratio of application program;
When the original interface length breadth ratio of judging said application program and said target interface length breadth ratio not simultaneously; According to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of said application program;
According to said displacement parameter, adjust the coordinate of said object in said visual coordinate is;
Adjusted visual coordinate is projected as the view plane coordinate;
Being tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate, is the screen coordinate in said target interface screen coordinate system with the view plane coordinate conversion of said object, so that said object shows on said target interface screen.
Another purpose of the embodiment of the invention is to provide a kind of treating apparatus of Application Program Interface, and said device comprises:
The interface parameter acquiring unit is used to obtain the original interface length breadth ratio and the target interface length breadth ratio of application program;
The displacement parameter acquiring unit; Be used for when the original interface length breadth ratio of judging said application program and said target interface length breadth ratio not simultaneously; According to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of said application program;
The coordinate adjustment unit is used for according to said displacement parameter, adjusts the coordinate of said object in said visual coordinate is;
The planimetric coordinates converting unit is used for adjusted visual coordinate is projected as the view plane coordinate; And
The screen coordinate converting unit; Be used for being tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate; With the view plane coordinate conversion of said object is the screen coordinate in said target interface screen coordinate system, so that said object shows on said target interface screen.
Original interface length breadth ratio and the target interface length breadth ratio of the embodiment of the invention through obtaining application program; Magnitude relationship between combining target interface length breadth ratio and the original interface length breadth ratio; According to the displacement parameter that gets access to; Adjust the current coordinate of this object in this visual coordinate system, and adjusted visual coordinate is projected as the view plane coordinate, be tied to the coordinate transform relation of target interface screen coordinate system again based on the view plane coordinate; Realization is the screen coordinate in this target interface screen coordinate system with the view plane coordinate conversion of this object; Solved because the existing application interface is can't be adaptive multi-platform, the problem of multi-screen resolution, realized that this application program does not rely on any one operating system, can adaptively adaptively be installed in differently differentiate, the purpose in the different system platform.
Description of drawings
Fig. 1 is the realization flow figure of the disposal route of the Application Program Interface that provides of first embodiment of the invention;
Fig. 2 is the synoptic diagram of view frustums model among Fig. 1;
Fig. 3 is a projection relation synoptic diagram among Fig. 1;
Fig. 4 (a), 4 (b) are respectively the length and width synoptic diagram of view plane and display screen among Fig. 1;
Fig. 5 is the structural drawing of the treating apparatus of the Application Program Interface that provides of second embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The embodiment of the invention only need pre-set the original interface length breadth ratio of same application; Through should original interface length breadth ratio and the target interface length breadth ratio compare; Then adjust the displacement of the object on the original interface according to comparative result; Make application developer only need develop a kind of interface layout with best-fit screen resolution; Just can be installed on the different system platforms and adaptive different screen resolution, reduce developer's workload, also promote user's experience.
Below in conjunction with specific embodiment concrete realization of the present invention is described in detail:
Embodiment one:
Fig. 1 shows the realization flow of the disposal route of the Application Program Interface that first embodiment of the invention provides, and details are as follows:
In step S101, obtain the original interface length breadth ratio and the target interface length breadth ratio of application program.
In the practical implementation process; Because the original interface of same application often pre-sets an original best-fit screen resolution; And this application program often need be installed in the middle of the different systems; All might there be the perhaps length breadth ratio of different interface display of different resolution in the different interfaces of same system platform or the different interfaces of different system platform; If the display interface with the different resolution of different system platform is an example; When pre-setting this application program one original best-fit screen resolution; This best-fit screen resolution can adaptive a certain system platform, and when on the system platform that this application program is installed to another concrete different resolution, the disposal route that then need utilize the embodiment of the invention to provide is at first obtained the original best-fit screen resolution of this application program; And the resolution of from current system platform, obtaining the target device physical screen; Such as 720P, 1080P etc., then can obtain this target interface length and width ratio easily according to the resolution of target device physical screen, the resolution of this target device physical screen or title target interface resolution are meant the screen resolution of the portable terminal support that this system platform is installed.Generally speaking; In this application program use; Can detect the resolution of the display interface that obtains physical screen automatically, if can not obtain through the application program interface function of calling system platform according to interface function; Generally speaking, it is identical with the screen physical resolution manual this target interface resolution to be set.And the step of obtaining the original interface length breadth ratio of application program is specially the original interface length breadth ratio of obtaining application program according to original best-fit screen resolution, promptly can obtain screen aspect ratio according to the long dimension of this resolution and the Pixel Information of wide dimension.
In step S102; When the original interface length breadth ratio of judging this application program and this target interface length breadth ratio not simultaneously; According to the magnitude relationship between this original interface length breadth ratio and this target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of this application program.
In the practical implementation process; Need to judge whether this target interface length breadth ratio that gets access to is identical with the original interface length breadth ratio of this application program; When being judged as when identical; Then need not make any change this moment to the coordinate figure of the object on this Application Program Interface in the view plane coordinate system; Can be the view plane coordinate with the current coordinate projection of the object on this Application Program Interface in this visual coordinate system directly, be tied to the coordinate transform relation of target interface screen coordinate system again based on the view plane coordinate, be this target interface screen coordinate with this view plane coordinate conversion; The original best-fit screen resolution of the target interface resolution of current system platform for this application program perhaps directly is set, so that the target interface of Application Program Interface and system platform adapts.
In step S103,, adjust the coordinate of this object in this visual coordinate system according to this displacement parameter.
In this step S102:
Length, the width of remembering original interface are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws, if judge Lp/Wp and Ls/Ws all greater than 1 or all less than 1 o'clock, this displacement parameter is (Lp/Wp)/(Ls/Ws);
Then this moment, this step S103 specifically may further comprise the steps:
If (Lp/Wp) greater than (Ls/Ws), then adjusting the Y axial coordinate y of this object in visual coordinate system is y ', y '=y * displacement parameter;
If (Lp/Wp) less than (Ls/Ws), then adjusting the X axial coordinate x of this object in visual coordinate system is x ', x '=x * displacement parameter.
As the present invention's one instance, this step S102 is specially:
Length, the width of remembering original interface are respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws, if judge Lp/Wp and Ls/Ws one of them greater than 1, another was less than 1 o'clock, this displacement parameter is (Wp/Lp)/(Ls/Ws);
Then this moment, this step S103 specifically may further comprise the steps:
If (Wp/Lp) greater than (Ls/Ws), then adjusting the Y axial coordinate y of this object in visual coordinate system is y ', y '=y * displacement parameter;
If (Wp/Lp) less than (Ls/Ws), then adjusting the X axial coordinate x of this object in visual coordinate system is x ', x '=x * displacement parameter.
In embodiments of the present invention; For convenience; Below with the original interface of this application program or claim that length, the width at the interface that the best-fit screen resolution is corresponding represent with Lp, Wp respectively; And the target interface of this application program system to be installed or physical screen length, width represent with Ls, Ws that respectively then this original interface length breadth ratio and this target interface length breadth ratio are represented with Lp/Wp and Ls/Ws respectively.
Particularly; If original best-fit screen resolution size 720P that application program is preset; This application program is installed in the goal systems platform that target interface resolution is 1080P; The perhaps current interface of application program size 1080P is installed in the situation in the goal systems platform of 720P with it, if corresponding interface length breadth ratio and this target interface length breadth ratio of original best-fit screen resolution that should be preset is 16: 9; Then because their length breadth ratio is identical; The ratio (Lp/Wp)/(Ls/Ws) of this current interface length breadth ratio and this target interface length breadth ratio is 1, and the displacement parameter of object in the view plane coordinate system on this Application Program Interface is the ratio of this original interface length breadth ratio and this target interface length breadth ratio so, and also promptly this displacement parameter is 1; Thereby need not make any change to the coordinate figure of this object in the view plane coordinate system, only need directly carry out the coordinate step that the imaging of this application program on the view plane is converted on the target interface screen and get final product.
Particularly; When this original interface length breadth ratio and this target interface length breadth ratio all greater than 1 or all less than 1 the time, if also promptly Lp/Wp and Ls/Ws are divided into following two kinds of situation all greater than 1 perhaps all less than 1 o'clock; Suppose that the coordinate of object p under visual coordinate system is (x; Y), adjusted coordinate is (x ', y '):
1) if. Lp/Wp is greater than Ls/Ws; Explain that then this application program is on the screen of broad that compares, to move; If do not do any operation this moment, then final effect such as the same fat person who shows drawn high by broad ways, and this moment, camera camera remained unchanged from the distance of view plane; Because Aspect Ratio changes Ls/Ws into, need the ordinate y value of this object in visual coordinate system increased.Therefore the object of view frustums the inside should be done corresponding mobile; Be appreciated that for actual object move to y ' position along Y axial coordinate direction, otherwise possibly can't show that is: displacement parameter is (Lp/Wp)/(Ls/Ws); Y '=y * (Lp/Wp)/(Ls/Ws); And the x value is constant, and adjusted respective coordinates is (x, y ').
2) if. Lp/Wp is less than Ls/Ws, and then explanation is will operate on the relatively narrow screen to move, if do not do any operation this moment; Then final effect that shows such as same lean person by along length to elongation, for head it off, need the x value of this object is diminished; Therefore the object of view frustums the inside should be done corresponding mobile, otherwise possibly can't show, reduces X axial coordinate value; That is: x '=x * (Lp/Wp)/(Ls/Ws); And the y value is constant, the coordinate of adjusted correspondence in visual coordinate system be (x ', y).
Particularly, in this original interface length breadth ratio and this target interface length breadth ratio one another is greater than 1 o'clock less than 1, if also promptly there is among Lp/Wp and the Ls/Ws one also to be divided into two kinds of situation less than 1 o'clock, as following greater than 1, one:
In this preset original interface length breadth ratio and this target interface length breadth ratio one less than 1; Another was greater than 1 o'clock; If also promptly have among Lp/Wp and the Ls/Ws one greater than, one less than 1 o'clock, also is divided into following two kinds of situation; Then at first need be with the object in 3D or the 2.5D Application Program Interface; Be the axle center to anticlockwise 90 degree all with view plane normal vector direction as shown in Figure 2 (camera coordinates is the Z axle), then this each object again with separately center Z axle be the axle center to right rotation 90 degree, carry out as judging after being provided with:
1) if. Wp/Lp is greater than Ls/Ws, explains that then this application program is will operate on the screen of the broad that compares to move, if do not do any operation this moment, then final effect such as the same fat person who shows drawn high by broad ways.Camera remains unchanged from the distance of view plane at this moment; Because Aspect Ratio need change Ls/Ws into; Therefore the object of view frustums the inside should be done corresponding mobile, otherwise then possibly can't show, so only need the y axial coordinate is increased; Be adjusted into: y '=y * (Wp/Lp)/(Ls/Ws), the x coordinate figure is constant.
2) if. Wp/Lp is less than Ls/Ws; Then explanation is will operate on the relatively narrow screen to move, and this moment, camera remained unchanged from the distance of view plane, because Aspect Ratio need change Ls/Ws into; Then need the object of view frustums the inside should be done corresponding mobile; So only need the x axial coordinate is diminished, be adjusted into: x '=x * (Wp/Lp)/(Ls/Ws), the y coordinate figure is constant.
And then, can obtain the coordinate of all objects after the renewal under the visual coordinate on this Application Program Interface.
In step S104, adjusted visual coordinate is projected as the view plane coordinate.
In embodiments of the present invention; Application Program Interface to 3D or 2.5D; Need set up view frustums model as shown in Figure 2 according to the method for the perspective projection in the computer graphics, wherein, view frustums is made up of eye position eye (camera position that perhaps is called camera), nearly cutting Plane n p (near clipping plane), yonder clipping plane fp (far clipping plane); Left representes the distance of np plane left margin apart from this np planar central; Right representes the distance of np plane right margin apart from this np planar central, and left and right are reverse, and top representes the distance of coboundary, np plane apart from this np planar central; Bottom representes the distance of np plane lower boundary apart from this np planar central, and top and bottom are reverse.If select nearly cutting plane as projection plane or title view plane; For the coordinate p (x of the arbitrary object p in the view frustums in visual coordinate system; Y, z) projecting to point behind this view plane is p ' (x ', y '); The coordinate of wherein arbitrary object in visual coordinate system is when needs are adjusted according to step S103, adjusted coordinate figure.As shown in Figure 3, N is the distance of eye to np, and F is the distances of eyes to yonder clipping plane; Through similar triangles character; Can obtain the coordinate of p ', also promptly can obtain the coordinate of project objects in this view plane coordinate system on this 3D or the original interface of 2.5D application program, the center that this view plane coordinate system also is with this np plane is an initial point; Level is left the positive dirction of horizontal ordinate x, is the two-dimensional coordinate system that positive dirction constituted of ordinate y vertically upward.Need to prove that the coordinate of the object on the original interface of this application program in visual coordinate system is adjusted coordinate, according to step S104, adjusted visual coordinate is projected as the view plane coordinate.
In step S105, be tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate, be the screen coordinate in this target interface screen coordinate system with the view plane coordinate conversion of this object, so that this object shows on this target interface screen.
Wherein, the coordinate transform that is tied to the target interface screen coordinate system of this view plane coordinate concerns shown in the following formula:
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 length, the width at the original interface of this Application Program Interface respectively; Ls, Ws represent length, the width of the target interface of this Application Program Interface respectively, and (xp yp) representes the coordinate of object in the view plane coordinate system of this Application Program Interface; (xs ys) representes the coordinate of object in the target interface screen coordinate system of this Application Program Interface.
In the practical implementation process; This above-mentioned formula (1), (2) are to set up according to the method for existing perspective projection in the computer graphics etc., and are as shown in Figure 2, again according to projection relation shown in Figure 3; Through similar triangles character; Can draw the current coordinate under visual coordinate system of P ',, can adjusted visual coordinate be projected as the view plane coordinate in the view plane coordinate system in conjunction with the relation of view frustums and view plane, the master pattern of perspective projection etc.; Again the result of imaging on this view plane or title perspective projection is converted into the screen display of target interface; Shown in Fig. 4 (a), 4 (b), be respectively the length and width synoptic diagram of view plane and display screen, finally can obtain above-mentioned formula (1), (2), so that this view plane coordinate system is transformed into screen coordinate system.Because this transformational relation is a prior art, repeats no more at this.And then, can also promptly be tied to the coordinate transform relation of target interface screen coordinate system according to this formula (1), (2) based on this view plane coordinate, be this target interface screen coordinate with the coordinate conversion of this object in this view plane coordinate system after upgrading.
In embodiments of the present invention; The disposal route of this Application Program Interface is according to the target interface length breadth ratio; The original interface length and width value of presetting in this application program, the coordinate figure of object under visual coordinate system on this original interface etc. are adjusted, and adjusted visual coordinate is projected as the view plane coordinate in the view plane coordinate system, be tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate; Adjusted coordinate figure is mapped to the screen coordinate of target interface; Be implemented in the accurate demonstration on the display screen, thereby reach the purpose that same application adapts to the display interface of the multiple resolution of kinds of platform, improved application program installation, the adaptability of operation, dirigibility; Also save the application development cost, promoted user's experience.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be stored in the computer read/write memory medium; Described storage medium is like ROM/RAM, disk, CD etc.
Embodiment two:
Fig. 5 shows the structure of the treating apparatus of the Application Program Interface that second embodiment of the invention provides, and for the ease of explanation, only shows the part relevant with the embodiment of the invention.
The treating apparatus of this Application Program Interface comprises interface parameter acquiring unit 51, displacement parameter acquiring unit 52, coordinate adjustment unit 53, planimetric coordinates converting unit 54 and screen coordinate converting unit 55 wherein:
Interface parameter acquiring unit 51 is used to obtain the original interface length breadth ratio and the target interface length breadth ratio of application program.
Interface parameter acquiring unit 51 specifically comprises:
Original interface parameter acquiring unit is used for obtaining according to original best-fit screen resolution the original interface length breadth ratio of application program; And
The target interface parameter acquiring unit is used for obtaining the target interface length breadth ratio according to the resolution of target device physical screen.
Displacement parameter acquiring unit 52; Be used for when the original interface length breadth ratio of judging this application program and this target interface length breadth ratio not simultaneously; According to the magnitude relationship between this original interface length breadth ratio and this target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of this application program.
In embodiments of the present invention, the treating apparatus of this Application Program Interface also comprises:
Comparing unit is used to judge whether this target interface length breadth ratio is identical with the original interface length breadth ratio of this application program;
First converting unit, be used for when this comparing unit output result when being, be the view plane coordinate with the current coordinate projection of the object on this Application Program Interface in this visual coordinate system, and triggering screen coordinate converting unit 55; And
Second converting unit, be used for when this comparing unit output result for not the time, trigger this displacement parameter acquiring unit 52.
And when the original interface length breadth ratio of judging this application program and this target interface length breadth ratio not simultaneously, this displacement parameter acquiring unit 52 specifically comprises:
Judging unit 521 is used to judge that Lp/Wp and Ls/Ws whether all greater than 1 or all less than 1, wherein, remember that length, the width at this original interface is respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws;
First parameter acquiring unit 522, be used for when this judging unit 521 output results when being, it is (Lp/Wp)/(Ls/Ws) that this displacement parameter is set; And
Second parameter acquiring unit 523, be used for when this judging unit 521 output results for not the time, this displacement parameter is set is (Wp/Lp)/(Ls/Ws).
In embodiments of the present invention; Display interface with the different length breadth ratios of different system platform is an example; When pre-setting the corresponding interface length breadth ratio of this application program one original best-fit screen resolution; This preferable original interface length breadth ratio can adaptive a certain system platform; And when on the system platform that this application program is installed to another concrete different length breadth ratios; The disposal route that then need utilize the embodiment of the invention to provide is at first obtained the original best-fit screen resolution of this application program, and the resolution of from this current system platform, obtaining the target device physical screen, such as 720P, 1080P etc.; Then can obtain this target interface length and width ratio easily according to the resolution of target device physical screen, the resolution of this target device physical screen or title target interface resolution are meant the screen resolution of the portable terminal support that this system platform is installed.Generally speaking; In this application program use; Can detect the resolution of the display interface that obtains physical screen automatically, if can not obtain through the application program interface function of calling system platform according to interface function; Generally speaking, it is identical with the best-fit screen resolution manual this target interface resolution to be set.And the original interface length breadth ratio of obtaining application program is specially the original interface length breadth ratio of obtaining application program according to original best-fit screen resolution.
And then; Need to judge whether this target interface length breadth ratio that gets access to is identical with the original interface length breadth ratio of this application program; When being judged as when identical; Then need not make any change to the coordinate figure of the object on this Application Program Interface in the view plane coordinate system; Can be the view plane coordinate with the current coordinate projection of the object on the Application Program Interface in this visual coordinate system directly, be tied to the coordinate transform relation of target interface screen coordinate system again based on the view plane coordinate, be this target interface screen coordinate with the current coordinate conversion of the object on this Application Program Interface in this view plane coordinate system; The original best-fit screen resolution of the target interface resolution of current system platform for this application program perhaps also can directly be set, so that the target interface of Application Program Interface and system platform adapts.
And when judging this original interface length breadth ratio and this target interface length breadth ratio not simultaneously; Application Program Interface to 3D or 2.5D; The view frustums model as shown in Figure 2 that need set up according to the method for the perspective projection in the computer graphics, projection relation synoptic diagram as shown in Figure 3 can obtain the current coordinate of object under the view plane coordinate system on the original interface of this application program; Can obtain the displacement parameter of this object according to judging unit 521, first parameter acquiring unit 522, second parameter acquiring unit 523 etc.; So that its current coordinate conversion is adjusted, make visual coordinate adapt to the length of target interface, width.
Coordinate adjustment unit 53 is used for according to this displacement parameter, adjusts the coordinate of this object in this visual coordinate system.
This coordinate adjustment unit 53 specifically comprises:
The coordinate processing unit is used for this object multiply by this displacement parameter at the current X coordinate or the Y coordinate of this visual coordinate system; And
Coordinate upgrades subelement, is used to upgrade this current coordinate and is the coordinate that multiply by behind this displacement parameter.
Planimetric coordinates converting unit 54 is used for adjusted visual coordinate is projected as the view plane coordinate.
In embodiment of the present invention; Based on the above-mentioned displacement parameter that gets access to; Upgrade current ordinate or the horizontal ordinate of this object in this visual coordinate system; Make the coordinate of this object do corresponding displacement, and adjusted visual coordinate is projected as the view plane coordinate according to the original interface length breadth ratio of this application program and the magnitude relationship between this target interface length breadth ratio.
Screen coordinate converting unit 55 is used for being tied to based on the view plane coordinate coordinate transform relation of target interface screen coordinate system, is the screen coordinate in this target interface screen coordinate system with the view plane coordinate conversion of this object.
The coordinate transform that the view plane coordinate is tied to the target interface screen coordinate system in this screen coordinate converting unit 55 concerns shown in the following formula:
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 length, the width at the original interface of this Application Program Interface respectively; Ls, Ws represent length, the width of the target interface of this Application Program Interface respectively, and (xp yp) representes the coordinate of object in the view plane coordinate system of this Application Program Interface; (xs ys) representes the coordinate of object in the target interface screen coordinate system of this Application Program Interface.
In embodiments of the present invention; Owing to finally will this application program be operated in the display screen of goal systems platform; Object after renewal after horizontal ordinate or the ordinate, utilizes planimetric coordinates converting unit 54 to carry out projection and changes, according to this formula (1), (2) in this visual coordinate system; Also promptly being tied to the coordinate transform relation of target interface screen coordinate system based on this view plane coordinate, is this target interface screen coordinate with the coordinate conversion of this object in this view plane coordinate system after upgrading.
In embodiments of the present invention, the treating apparatus of this Application Program Interface obtains the target interface length breadth ratio and the target interface length breadth ratio of application program according to the interface parameter acquiring unit; When the original interface length breadth ratio of judging this application program and this target interface length breadth ratio not simultaneously; The displacement parameter acquiring unit obtains the displacement parameter of object in visual coordinate system on the original interface of this application program according to the original interface length breadth ratio of this application program and the magnitude relationship between this target interface length breadth ratio; The coordinate adjustment unit is adjusted the coordinate of this object in this visual coordinate system according to this displacement parameter; The planimetric coordinates converting unit is projected as the view plane coordinate with adjusted visual coordinate; The coordinate transform that is tied to the target interface screen coordinate system based on the view plane coordinate concerns that coordinate transformation unit is the screen coordinate in this target interface screen coordinate system with the view plane coordinate conversion of this object.Thereby; Only need the original interface length breadth ratio and the original interface length breadth ratio of preset application program; Just can this application program be installed in the identical or different system platform with different resolution; Do not rely on any one operating system, solved the location problem of Application Program Interface under the different resolution, also having solved application program can't adaptive diversified screen and the problem of system platform.
The disposal route of this Application Program Interface that the embodiment of the invention provides; Through in a certain application program, pre-setting a kind of original best-fit screen resolution, a best interface length breadth ratio also promptly is set, just can be according to the relation between itself and the target interface length breadth ratio; It is identical with target interface length and width value that self-adaptation is adjusted original interface length and width value; And can self-adaptation adjust the displacement of object on the original interface, finally can be presented in the target interface exactly, and have good display; In prior art; Application developer need be developed corresponding a kind of application program specially for each resolution or each system platform, has the problem that workload is big, the maintenance work difficulty is big, and the embodiment of the invention also makes user's experience and screen display effect all be improved.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the disposal route of an Application Program Interface is characterized in that, said method comprises the steps:
Obtain the original interface length breadth ratio and the target interface length breadth ratio of application program;
When the original interface length breadth ratio of judging said application program and said target interface length breadth ratio not simultaneously; According to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of said application program;
According to said displacement parameter, adjust the coordinate of said object in said visual coordinate is;
Adjusted visual coordinate is projected as the view plane coordinate in the view plane coordinate system;
Being tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate, is the screen coordinate in said target interface screen coordinate system with the view plane coordinate conversion of said object, so that said object shows on said target interface screen.
2. the method for claim 1; It is characterized in that; Said according to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, the step of obtaining the displacement parameter of object in the view plane coordinate system on the original interface of said application program is specially:
Length, the width of remembering original interface are respectively Lp, Wp; The length of target interface, width are respectively Ls, Ws; If judge that Lp/Wp and Ls/Ws are all greater than 1 or all less than 1 o'clock; Said displacement parameter is (Lp/Wp)/(Ls/Ws), and is then said according to said displacement parameter, and the step of adjusting the coordinate of said object in said visual coordinate is specifically may further comprise the steps:
If (Lp/Wp) greater than (Ls/Ws), then adjusting the Y axial coordinate y of said object in visual coordinate system is y ', y '=y * displacement parameter;
If (Lp/Wp) less than (Ls/Ws), then adjusting the X axial coordinate x of said object in visual coordinate system is x ', x '=x * displacement parameter.
3. the method for claim 1; It is characterized in that; Said according to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, the step of obtaining the displacement parameter of object in the view plane coordinate system on the original interface of said application program is specially:
Length, the width of remembering original interface are respectively Lp, Wp; The length of target interface, width are respectively Ls, Ws; If judge Lp/Wp and Ls/Ws one of them greater than 1, another was less than 1 o'clock, said displacement parameter is (Wp/Lp)/(Ls/Ws); Then said according to said displacement parameter, the step of adjusting the coordinate of said object in said visual coordinate is specifically may further comprise the steps:
If (Wp/Lp) greater than (Ls/Ws), then adjusting the Y axial coordinate y of said object in visual coordinate system is y ', y '=y * displacement parameter;
If (Wp/Lp) less than (Ls/Ws), then adjusting the X axial coordinate x of said object in visual coordinate system is x ', x '=x * displacement parameter.
4. the method for claim 1 is characterized in that, the coordinate transform that said view plane coordinate is tied to the target interface screen coordinate system concerns shown in the following formula:
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 length, the width at the original interface of said Application Program Interface respectively; Ls, Ws represent length, the width of the target interface of said Application Program Interface respectively, (xp, yp) coordinate of object in the view plane coordinate system of the said Application Program Interface of expression; (xs, ys) coordinate of object in the target interface screen coordinate system of the said Application Program Interface of expression.
5. the method for claim 1 is characterized in that, saidly obtains the original interface length breadth ratio of application program and the step of target interface length breadth ratio is specially:
Obtain the original interface length breadth ratio of application program according to original best-fit screen resolution, obtain the length breadth ratio of target display interface according to the resolution of target device physical screen.
6. the treating apparatus of an Application Program Interface is characterized in that, said device comprises:
The interface parameter acquiring unit is used to obtain the original interface length breadth ratio and the target interface length breadth ratio of application program;
The displacement parameter acquiring unit; Be used for when the original interface length breadth ratio of judging said application program and said target interface length breadth ratio not simultaneously; According to the magnitude relationship between said original interface length breadth ratio and the said target interface length breadth ratio, obtain the displacement parameter of object in visual coordinate system on the original interface of said application program;
The coordinate adjustment unit is used for according to said displacement parameter, adjusts the coordinate of said object in said visual coordinate is;
The planimetric coordinates converting unit is used for adjusted visual coordinate is projected as the view plane coordinate; And
The screen coordinate converting unit; Be used for being tied to the coordinate transform relation of target interface screen coordinate system based on the view plane coordinate; With the view plane coordinate conversion of said object is the screen coordinate in said target interface screen coordinate system, so that said object shows on said target interface screen.
7. device as claimed in claim 6 is characterized in that, said displacement parameter acquiring unit specifically comprises:
Judging unit is used to judge that Lp/Wp and Ls/Ws whether all greater than 1 or all less than 1, wherein, remember that length, the width at original interface is respectively Lp, Wp, and the length of target interface, width are respectively Ls, Ws;
First parameter acquiring unit, be used for when said judging unit output result when being, it is (Lp/Wp)/(Ls/Ws) that said displacement parameter is set; And
Second parameter acquiring unit, be used for when said judging unit output result for not the time, said displacement parameter is set is (Wp/Lp)/(Ls/Ws).
8. device as claimed in claim 6 is characterized in that, said coordinate adjustment unit specifically comprises:
The coordinate processing unit is used for said object multiply by said displacement parameter at current X coordinate or the Y coordinate that said visual coordinate is; And
Coordinate upgrades subelement, is used to upgrade said current coordinate and is the coordinate that multiply by behind the said displacement parameter.
9. device as claimed in claim 6 is characterized in that, the coordinate transform that view plane coordinate described in the said screen coordinate converting unit is tied to the target interface screen coordinate system concerns shown in the following formula:
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 length, the width at the original interface of said Application Program Interface respectively; Ls, Ws represent length, the width of the target interface of said Application Program Interface respectively, (xp, yp) coordinate of object in the view plane coordinate system of the said Application Program Interface of expression; (xs, ys) coordinate of object in the target interface screen coordinate system of the said Application Program Interface of expression.
10. device as claimed in claim 6 is characterized in that, said interface parameter acquiring unit specifically comprises:
Original interface parameter acquiring unit is used for obtaining according to original best-fit screen resolution the original interface length breadth ratio of application program; And
The target interface parameter acquiring unit is used for obtaining the target interface length breadth ratio according to the resolution of 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 true CN102707946A (en) 2012-10-03
CN102707946B 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)

Cited By (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
CN102981793A (en) * 2012-11-22 2013-03-20 Tcl集团股份有限公司 Screen synchronization method and device
CN103546689A (en) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 Resolution ratio acquiring method and device of external camera of android system
CN103559096A (en) * 2013-09-05 2014-02-05 澳门岭南投资有限公司 Computer software port seamless connection technology
CN104423950A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Information processing method and electronic equipment
CN104516703A (en) * 2013-09-30 2015-04-15 中国电信股份有限公司 Method and system for achieving automatic adaption of virtual desktop screen resolution on Android terminal
CN105187634A (en) * 2015-08-07 2015-12-23 北京思特奇信息技术股份有限公司 Method and system for enabling terminal application to dynamically adapt to intelligent terminal screen
CN105225201A (en) * 2015-09-06 2016-01-06 网易(杭州)网络有限公司 A kind of method and system of display object adaptive resolution display
CN106339061A (en) * 2015-07-16 2017-01-18 华为技术有限公司 Mobile terminal and method of run application thereof
CN106528273A (en) * 2016-10-31 2017-03-22 北京小米移动软件有限公司 Application management method and device
CN107506163A (en) * 2017-08-31 2017-12-22 努比亚技术有限公司 Adjust method, terminal and the computer-readable recording medium of screen display
CN108334391A (en) * 2017-12-31 2018-07-27 广州金十信息科技有限公司 A kind of multisystem shows adaptation method, electronic equipment and storage medium
CN108765582A (en) * 2018-04-28 2018-11-06 青岛海信电器股份有限公司 A kind of panoramic pictures display methods and equipment
CN110928407A (en) * 2019-10-30 2020-03-27 维沃移动通信有限公司 Information display method and device
WO2020155785A1 (en) * 2019-01-31 2020-08-06 掌阅科技股份有限公司 Screen adaptive display method, electronic device and computer storage medium
CN112667343A (en) * 2021-01-07 2021-04-16 苏州沁游网络科技有限公司 Interface adjusting method, device, equipment and storage medium
CN112822157A (en) * 2020-12-25 2021-05-18 广州朗国电子科技有限公司 Data sharing method and device between electronic whiteboards and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050093893A1 (en) * 2003-10-31 2005-05-05 Jay Senior Aspect ratio conversion of video content
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050093893A1 (en) * 2003-10-31 2005-05-05 Jay Senior Aspect ratio conversion of video content
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期》 *

Cited By (27)

* 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
CN102981793A (en) * 2012-11-22 2013-03-20 Tcl集团股份有限公司 Screen synchronization method and device
CN102981793B (en) * 2012-11-22 2017-02-15 深圳Tcl工业研究院有限公司 Screen synchronization method and device
CN104423950A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Information processing method and electronic equipment
CN104423950B (en) * 2013-09-02 2021-05-18 联想(北京)有限公司 Information processing method and electronic equipment
CN103559096A (en) * 2013-09-05 2014-02-05 澳门岭南投资有限公司 Computer software port seamless connection technology
CN104516703A (en) * 2013-09-30 2015-04-15 中国电信股份有限公司 Method and system for achieving automatic adaption of virtual desktop screen resolution on Android terminal
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
CN103546689A (en) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 Resolution ratio acquiring method and device of external camera of android system
CN110888521A (en) * 2015-07-16 2020-03-17 华为技术有限公司 Mobile terminal and method for running application program thereof
CN106339061A (en) * 2015-07-16 2017-01-18 华为技术有限公司 Mobile terminal and method of run application thereof
CN106339061B (en) * 2015-07-16 2019-11-05 华为技术有限公司 A kind of mobile terminal and its method for running application program
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
CN105225201A (en) * 2015-09-06 2016-01-06 网易(杭州)网络有限公司 A kind of method and system of display object adaptive resolution display
CN106528273A (en) * 2016-10-31 2017-03-22 北京小米移动软件有限公司 Application management method and device
CN107506163A (en) * 2017-08-31 2017-12-22 努比亚技术有限公司 Adjust method, terminal and the computer-readable recording medium of screen display
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
CN108765582A (en) * 2018-04-28 2018-11-06 青岛海信电器股份有限公司 A kind of panoramic pictures display methods and equipment
WO2020155785A1 (en) * 2019-01-31 2020-08-06 掌阅科技股份有限公司 Screen adaptive display method, electronic device and computer storage medium
CN110928407A (en) * 2019-10-30 2020-03-27 维沃移动通信有限公司 Information display method and device
CN112822157A (en) * 2020-12-25 2021-05-18 广州朗国电子科技有限公司 Data sharing method and device between electronic whiteboards and storage medium
CN112667343A (en) * 2021-01-07 2021-04-16 苏州沁游网络科技有限公司 Interface adjusting method, device, equipment and storage medium
CN112667343B (en) * 2021-01-07 2024-03-01 苏州沁游网络科技有限公司 Interface adjustment method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN102707946B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN102707946A (en) Application program interface processing method and device
CN107168712B (en) Interface drawing method, mobile terminal and computer readable storage medium
TWI490772B (en) Method and apparatus for adapting custom control components to a screen
CN103226453B (en) Method for mapping display and operation of mobile phone screen to computer terminal
US11087436B2 (en) Method and apparatus for controlling image display during image editing
CN104035664A (en) Display method and device for user interface of application program
CN102023849A (en) Processing method and device for multi-platform multi-resolution application program interface
CN103634650A (en) Intelligent television platform-based picture processing method and intelligent television platform-based picture processing system
CN103530117A (en) Method and device for adapting to screens, of different sizes, of mobile terminals
CN103713821A (en) Mobile terminal screen display method and mobile terminal
US20190286310A1 (en) Widget Area Adjustment Method and Apparatus
CN106648581B (en) Page display method and device
CN104866206A (en) Method for moving picture data, and mobile terminal
CN102760027A (en) Display processing method and device as well as electronic equipment
CN107122104B (en) Data display method and device
US20140022167A1 (en) Projection apparatus and projection method
CN103905752A (en) Method and device for remote control of remote control terminal and method and device for display of display terminal
US20240040093A1 (en) Method, apparatus, device, and system for customizing motion-based projection
CN104020925A (en) Projection method and device
CN106126057B (en) Screen capture method and device and terminal equipment
US20130283192A1 (en) Generation of Canvas Elements for Drawing Objects
CN109933323A (en) A kind of method and device that user interface is set
CN105760177A (en) Control text arrangement and display method and device applicable to Mac system
CN105376510A (en) Projection method and projection device
CN104598156A (en) Touch method and electronic equipment

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