The content of the invention
The invention provides a kind of method that picture segmentation shows, the method can be adaptively right according to screen resolutionDisplay screen is split, and the picture for making display is all standard proportional.
The invention provides the client that a kind of picture segmentation shows, the client can be according to screen resolution self adaptationGround is split to display screen, and the picture for making display is all standard proportional.
A kind of method that picture segmentation shows, the method include:
Calling system parameter interface function, obtains the screen resolution of display screen, calculates display screen by screen resolutionThe ratio of width to height;
Corresponding picture partitioning scheme is obtained by number of pictures and the ratio of width to height, picture partitioning scheme includes that widescreen picture is splitDisplay screen is divided into multiple unit rectangular configurations according to picture partitioning scheme by mode and standard screen picture partitioning scheme, eachThe ratio of width to height of unit rectangular configuration is standard proportional;
Receiving data source and corresponding unit rectangle mark, data source are shown and identified with unit rectangle on a display screenIn corresponding unit rectangular configuration.
The client that a kind of picture segmentation shows, the client include the ratio of width to height determining unit, cutting unit and show singleUnit;
The ratio of width to height determining unit, calling system parameter interface function obtain the screen resolution of display screen, by screenResolution calculates display screen the ratio of width to height, sends cutting unit to;
The cutting unit, obtains corresponding picture partitioning scheme, picture partitioning scheme bag by number of pictures and the ratio of width to heightWidescreen picture partitioning scheme and standard screen picture partitioning scheme are included, display screen is divided into into multiple units according to picture partitioning schemeRectangular configuration, the ratio of width to height of each unit rectangular configuration is standard proportional;
Data source is shown by the display unit, receiving data source and corresponding unit rectangle mark on a display screenIn unit rectangular configuration corresponding with unit rectangle mark.
From such scheme as can be seen that in the present invention, obtaining corresponding picture partitioning scheme by number of pictures and the ratio of width to height,Picture partitioning scheme includes widescreen picture partitioning scheme and standard screen picture partitioning scheme, according to picture partitioning scheme by display screenMultiple unit rectangular configurations are divided into, the ratio of width to height of each unit rectangular configuration is standard proportional.So, according to screen resolutionAdaptively display screen is split, either standard screen or widescreen, the picture that can make display is standard proportional.
Specific embodiment
To make the object, technical solutions and advantages of the present invention become more apparent, with reference to embodiment and accompanying drawing, to thisInvention is further described.
Referring to Fig. 3, it is the indicative flowchart of picture segmentation display of the present invention, which comprises the following steps:
Step 301, calling system parameter interface function obtain the screen resolution of display screen, are calculated by screen resolutionGo out display screen the ratio of width to height.
Step 302, obtains corresponding picture partitioning scheme by number of pictures and the ratio of width to height, and picture partitioning scheme includes widescreenDisplay screen is divided into multiple unit rectangle knots according to picture partitioning scheme by picture partitioning scheme and standard screen picture partitioning schemeStructure, the ratio of width to height of each unit rectangular configuration is standard proportional.
When the present invention carries out display screen picture segmentation, no longer uniquely picture segmentation is carried out according to decile mode, as long as dividingThe unit rectangular configuration the ratio of width to height for going out is standard proportional.
Specifically, the picture partitioning scheme can adopt the four angular coordinate formula of unit rectangular configuration to represent, four angular coordinateFormula includes screen resolution width variance and screen resolution height variable;Correspondingly, it is described to incite somebody to action according to picture partitioning schemeDisplay screen is divided into multiple unit rectangular configurations to be included:The width and height of the screen resolution for obtaining are substituted into into four angular coordinate publicFormula, obtains the four angular coordinate of each unit rectangular configuration.
It is different with the combination of the ratio of width to height by number of pictures, by correspondence different picture partitioning schemes.Below with number of picturesFor 4, the ratio of width to height is respectively 4:3 and 16:9 are illustrated.
If number of pictures is 4, the ratio of width to height is 16:9, then the four angular coordinate formula of each unit rectangular configuration is that following coordinates are publicFormula group(1):
Window 1:(0,0)、(Y/3 × 4,0)、(0, Y)With(Y/3 × 4, Y);
Window 2:(Y/3 × 4+1,0)、(X, 0)、(Y/3 × 4+1, Y/3)With(X, Y/3);
Window 3:(Y/3 × 4+1, Y/3+1)、(X, Y/3+1)、(Y/3 × 4+1, Y/3 × 2)With(X, Y/3 × 2);
Window 4:(Y/3 × 4+1, Y/3 × 2+1)、(X, Y/3 × 2+1)、(Y/3 × 4+1, Y)With(X, Y);Wherein, X is screenCurtain resolution width, Y are screen resolution height.
Assume that screen resolution is 1920:1080,1920/1080=16:9, it is widescreen, now according to four shown in Fig. 1Picture etc. point mode is split, and the Aspect Ratio of four for obtaining window is all 16:9, as during collection, image data source is compiledCode mode is 4:3, image will be made to be stretched, cause anamorphose.Thus it is shown in Fig. 4, by X=that the present invention changes partitioning scheme1920th, Y=1080 substitutes into coordinate formula group above(1), the coordinate for obtaining four windows is respectively:
Window 1:(0,0),(1440,0),(0,1080),(1440,1080);
Window 2:(1441,0),(1920,0),(1441,360),(1920,360);
Window 3:(1441,361),(1920,361),(1441,720),(1920,720);
Window 4:(1441,721),(1920,721),(1441,1080),(1920,1080).The four angular coordinate of each windowSequentially it is:Lower-left angular coordinate, bottom right angular coordinate, top left co-ordinate and upper right angular coordinate.
If number of pictures is 4, the ratio of width to height is 4:3, then the four angular coordinate formula of each unit rectangular configuration is that following coordinates are publicFormula group(2):
Window 1:(0,0)、(X/2,0)、(0, Y/2)With(X/2, Y/2);
Window 2:(X/2+1,0)、(X, 0)、(X/2+1, Y/2)With(X, Y/2);
Window 3:(0, Y/2+1)、(X/2, Y/2+1)、(0, Y)With(X/2, Y);
Window 4:(X/2+1, Y/2+1)、(X, Y/2+1)、(X/2+1, Y)With(X, Y);Wherein, X is screen resolution widthDegree, Y are screen resolution height.
Specifically, it is assumed that screen resolution is 1024:768,1024/768=4:3, it is standard screen, can now adopts Fig. 1 institutesFour pictures for showing etc. point mode, by X=1024, Y=768 substitution coordinate formula group above(2), obtain each unit rectangular configurationFour angular coordinate be respectively:
Window 1:(0,0),(512,0),(0,384)With(512,384);
Window 2:(513,0),(1024,0),(512,384)With(1024,384);
Window 3:(0,385),(512,385),(0,768)With(512,768);
Window 4:(513,385),(1024,385),(513,768)With(1024,768).The four angular coordinate order of each windowFor:Lower-left angular coordinate, bottom right angular coordinate, top left co-ordinate and upper right angular coordinate.
Illustrated with number of pictures as 4 above.If number of pictures is other values, similar drawing can be carried outPoint.For example, for 16:Window 1 in Fig. 4, if number of pictures is 16, can be divided into 4 wickets by 9 widescreen, willThe right window 2,3 and 4 each be divided into four wickets, as shown in figure 5,16 windows for obtaining all are 4:3 standard ratioExample;Each window coordinates in Fig. 5, can be by coordinate formula group(1)In each formula carry out simple conversion Calculation after obtain.
Step 303, receiving data source and corresponding unit rectangle mark, by data source show on a display screen with unitRectangle is identified in corresponding unit rectangular configuration.
When carrying out data source display, if data source resolution and unit rectangular configuration resolution are differed, logarithm is neededZoom in and out according to source, specifically:By data source resolution and the proportionate relationship of unit rectangular configuration resolution, data source is carried outScaling, by the data display after scaling on a display screen unit rectangular configuration corresponding with unit rectangle mark.Resolution,It is exactly the precision of screen picture, refers to the number of the pixel that display can show.Here, data source is scaled into unit rectangleThe size of structural resolution, then shown.
Referring to Fig. 6, it is that picture of the present invention splits the client terminal structure schematic diagram for showing, the client includes that the ratio of width to height determinesUnit, cutting unit and display unit;
The ratio of width to height determining unit, calling system parameter interface function obtain the screen resolution of display screen, by screenResolution calculates display screen the ratio of width to height, sends cutting unit to;
The cutting unit, obtains corresponding picture partitioning scheme, picture partitioning scheme bag by number of pictures and the ratio of width to heightWidescreen picture partitioning scheme and standard screen picture partitioning scheme are included, display screen is divided into into multiple units according to picture partitioning schemeRectangular configuration, the ratio of width to height of each unit rectangular configuration is standard proportional;
Data source is shown by the display unit, receiving data source and corresponding unit rectangle mark on a display screenIn unit rectangular configuration corresponding with unit rectangle mark.
Alternatively, the picture partitioning scheme represents that using the four angular coordinate formula of unit rectangular configuration four angular coordinate is publicFormula includes screen resolution width variance and screen resolution height variable;The cutting unit includes computation subunit, will obtainThe width and height of the screen resolution for taking substitutes into four angular coordinate formula, obtains the four angular coordinate of each unit rectangular configuration.
Alternatively, the display unit includes scaling subelement and shows subelement;
The scaling subelement, by data source resolution and the proportionate relationship of unit rectangular configuration resolution, to data sourceZoom in and out, send the data after scaling to the display subelement;
The display subelement, by the unit square corresponding with unit rectangle mark on a display screen of the data display after scalingIn shape structure.
In the present invention, corresponding picture partitioning scheme is obtained by number of pictures and the ratio of width to height, picture partitioning scheme includes widthDisplay screen is divided into multiple unit rectangles according to picture partitioning scheme by screen picture partitioning scheme and standard screen picture partitioning schemeStructure, the ratio of width to height of each unit rectangular configuration is standard proportional.So, adaptively display screen is entered according to screen resolutionRow is split, either standard screen or widescreen, and the picture that can make display is standard proportional, can preferably play the aobvious of widebandIt is shown as using.
Presently preferred embodiments of the present invention is the foregoing is only, not to limit the present invention, all essences in the present inventionWithin god and principle, any modification, equivalent substitution and improvements done etc. are should be included within the scope of protection of the invention.