Embodiment
At length set forth to the main realization principle of embodiment of the invention technical scheme, embodiment and to the beneficial effect that should be able to reach below in conjunction with each accompanying drawing.
In order to solve the problem that prior art exists, the embodiment of the invention provides a kind of picture layout method, as shown in Figure 1, may further comprise the steps:
Step 101, obtain viewing area size, the original size of shown picture and the quantity of shown picture, the original size of each shown picture is identical;
Step 102, according to the viewing area size, adjust the size of each shown picture by same adjustment mode, size up to each shown picture reaches maximum, and the overall width of the whole shown pictures after adjusting is not more than the width of viewing area size, and overall height is not more than the height of viewing area size.
Concrete, obtain the viewing area size of display terminal, this size is predetermined by the operating system of display terminal, for example under the screen mode toggle, can obtain the size of entire display screen curtain; Under non-screen mode toggle, can obtain the current available display screen size of display terminal operating system.
And, obtain the original size of shown picture and the quantity of shown picture, wherein, the original size of each shown picture is identical.In order in the viewing area, to Show Picture, size that can the accommodation picture, for example picture is transferred the size of picture big after a little while; Picture for a long time, the size of picture is turned down, following mode is provided in the embodiment of the invention, can be according to the viewing area size, adjust the size of shown picture, size up to shown picture reaches maximum, and the whole overall widths that are shown pictures after adjusting are not more than the width of viewing area size, and overall height is not more than the height of viewing area size.
Mode one: according to the original size of viewing area size, shown picture, determine the picture columns that the viewing area holds; Be not more than under the situation of the width of viewing area size at whole overall widths of shown pictures, adjust the height of each shown picture, equal the height of viewing area size up to the overall heights of all shown pictures.
Mode two: according to the original size of viewing area size, shown picture, determine the picture line number that the viewing area holds; Be not more than under the situation of the height of viewing area size in whole overall heights of shown pictures, adjust the width of each shown picture, equal the width of viewing area size up to the overall widths of all shown pictures.
Aforesaid way one and mode two all adopt determines edge length of picture, the mode of another edge length that stretches after namely how many pictures definite every row places, is adjusted the height of every capable picture, make shown picture integral body all can be positioned at the viewing area, and reach the full-size under this kind condition.
Mode three: when the ratio of the height and the width of shown picture is constant, adopt the width means that is shown picture all to be shown overall width and the overall height of picture; With all the overall height of shown picture and the height of viewing area compare; When the overall height of whole shown pictures during less than the height of viewing area, the original width of each shown picture is begun to increase with 1 unit picture element, up to all being shown the overall width of picture greater than the width of viewing area size, and these overall widths that increase the preceding all shown pictures of unit picture element are not more than the width of viewing area size, perhaps all be shown the overall height of picture greater than the height of viewing area size, and these overall heights that increase the preceding all shown pictures of unit picture element are not more than the height of viewing area size; With the width of shown picture before this increase unit picture element, the width of the shown picture after being defined as adjusting; According to the ratio of the height and the width that are shown picture, and the width of the shown picture after adjusting, the height of definite shown picture; When the overall height of whole shown pictures during greater than the height of viewing area, the original width of shown picture is begun to reduce with 1 unit picture element, be not more than the height of viewing area size up to the overall height of whole shown pictures, and all be shown the overall heights of pictures greater than the height of viewing area size before this minimizing unit picture element; With the width of this shown picture, the width of the shown picture after being defined as adjusting; According to the ratio of the height and the width that are shown picture, and the width of the shown picture after adjusting, the height of definite shown picture.
Wherein, according to the original width of shown picture and the width of viewing area size, determine the picture columns that the viewing area holds; According to the original width of picture columns and shown picture, the overall width of all shown picture of expression; According to the quantity of shown picture, and the picture columns that holds of viewing area, determine that the desire of picture is arranged line number; According to the original width of desire arrangement line number and shown picture, determine the overall heights of all shown pictures.
Mode four: when the ratio of the height and the width of shown picture is constant, adopt the height of described shown picture to represent all to be shown overall width and the overall height of picture; The overall width of described all shown picture and the width of described viewing area are compared; When the overall width of described all shown pictures during less than the width of described viewing area, the original height of each shown picture is begun to increase with 1 unit picture element, up to the overall widths of the described all shown pictures width greater than described viewing area size, and these overall widths that increase the preceding described all shown pictures of unit picture element are not more than the width of described viewing area size, perhaps all be shown the overall height of picture greater than the height of described viewing area size, and these overall heights that increase the preceding described all shown pictures of unit picture element are not more than the height of described viewing area size; With the height of shown picture before this increase unit picture element, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the height of the shown picture after adjusting, determine the width of described shown picture; When the overall width of described shown picture during greater than the width of described viewing area, the original height of each shown picture is begun to reduce with 1 unit picture element, be not more than the width of described viewing area size up to whole overall widths of shown pictures, and this reduces the overall widths of described all shown pictures before unit picture element greater than the width of described viewing area size; With the height of this shown picture, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the height of the shown picture after adjusting, determine the width of described shown picture.
Wherein, according to the original height of shown picture and the height of viewing area size, determine the picture line number that the viewing area holds; According to the original height of picture columns and shown picture, the overall height of all shown picture of expression; According to the quantity of shown picture, and the picture line number held of viewing area, determine that the desire of picture is arranged columns; According to the original height that desire is arranged columns and shown picture, determine the overall width of all shown picture.
When shown picture can't folk prescription when stretching, namely the ratio of the height and the width of shown picture is constant, then can adopt aforesaid way three and mode four.Use the width that is shown picture or overall width and the overall height of highly representing all shown pictures in mode three and the mode four, like this by adjusting a parameter, can be so that all the overall width of shown picture be less than the width of viewing area, the overall height height less than the viewing area, and make the maximal value that is resized to permission of shown picture as much as possible.For example, suppose that the viewing area is of a size of: width is 1000 pixels, highly is 500 pixels; The original size of shown picture is: width is 100 pixels, highly is 75 pixels, and the quantity of shown picture is 100; Then use the original width of shown picture, can arrive the picture columns that the viewing area holds is the 1000/100=10 row, and the overall width that is shown picture is 1000 pixels; It is that 100/10=10 is capable that the desire of picture is arranged line number, the overall height of shown picture is 10*75=750, at this moment, the overall height of shown picture is greater than the height of viewing area, then the original width with each shown picture begins to reduce with 1 unit picture element, be not more than the height of viewing area size up to the overall height of shown picture, and be shown the overall height of picture greater than the height of viewing area size before this minimizing unit picture element.
After adjusting the width and height of shown picture, because may there be white space in the adjacent placement of picture in the viewing area, in order to strengthen aesthetic property, the width of the white space of the viewing area that obtains on average can be arrived the shown picture of every row, as the lateral separation of adjacent picture row; Height with the white space of the viewing area that obtains on average arrives the shown picture of every row, as the capable longitudinal separation of adjacent picture.
Pass through foregoing description, as can be seen, the picture layout method that uses the embodiment of the invention to provide, by viewing area size, picture number, the size of adaptive adjustment picture, guarantee all complete demonstrations of energy of all pictures, and reach possible full-size, thus, at picture more after a little while, the size that picture shows is bigger, guarantees sharpness; More for a long time, picture can completely show, guarantees monitor speed at picture.
Below by specific embodiment the picture layout method that the embodiment of the invention provides is elaborated, as shown in Figure 2, when the ratio of the height and the width of shown picture is constant, may further comprise the steps:
The original height of step 201, the shown picture of basis and the height of viewing area size are determined the picture line number that the viewing area holds;
Step 202, according to the original height of picture columns and shown picture, the overall heights of all shown pictures of expression;
Step 203, according to the quantity of shown picture, and the picture line number held of viewing area determines that the desire of picture is arranged columns;
Step 204, according to the original height that desire is arranged columns and shown picture, determine the overall widths of all shown pictures;
Step 205, will all be shown the overall width of picture and the width of viewing area compares, if less than, execution in step 206; If greater than, execution in step 208; If equal, then the original width of shown picture and highly be defined as adjusting after width and highly, execution in step 210.
Step 206, the original height that will be shown picture begin to increase with 1 unit picture element, up to all being shown the overall width of picture greater than the width of viewing area size, and these overall widths that increase the preceding all shown pictures of unit picture element are not more than the width of viewing area size, perhaps all be shown the overall height of picture greater than the height of viewing area size, and these overall heights that increase the preceding all shown pictures of unit picture element are not more than the height of viewing area size;
Step 207, this is increased the height of shown picture before unit picture element, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width that are shown picture, and the height of the shown picture after adjusting, the width of definite shown picture, execution in step 210;
Step 208, the original height that will be shown picture begin to reduce with 1 unit picture element, be not more than the width of viewing area size up to the overall width of all shown picture, and be shown the overall width of picture greater than the width of viewing area size before this minimizing unit picture element;
Step 209, with the height of this shown picture, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width that are shown picture, and the height of the shown picture after adjusting, the width of definite shown picture;
Step 210, with the width of the white space of the viewing area that obtains, on average arrive the shown picture of every row, as the lateral separation of adjacent picture row; Height with the white space of the viewing area that obtains on average arrives the shown picture of every row, as the capable longitudinal separation of adjacent picture.
The width means overall width of the shown picture of use and the principle of overall height are identical with the process that above-mentioned steps 201 to 210 is described, and do not repeat them here.
Wherein, during execution in step 206, realize that by a recycle ratio detailed process may further comprise the steps as shown in Figure 3:
Step 301, the original height that will be shown picture begin to increase with 1 unit picture element; Each pixel count that increases can according to circumstances be set, and for example increases by 1 unit picture element at every turn.
Step 302, increase the height of shown picture, obtain this height after increasing of shown picture;
Step 303, the overall height after will increasing and the height of viewing area compare, if less than, execution in step 304; If greater than, the height before then this being increased is as the shown picture height after adjusting, execution in step 305;
Step 304, according to the height after increasing, the overall width after determining to increase compares the width of overall width and viewing area; If less than, execution in step 302; If greater than, the height before then this being increased is as the shown picture height after adjusting;
Step 305, according to the height of the shown picture after adjusting, the width of the shown picture after determining to adjust.
Pass through foregoing description, as can be seen, the picture layout method that uses the embodiment of the invention to provide, by viewing area size, picture number, the size of adaptive adjustment picture, guarantee all complete demonstrations of energy of all pictures, and reach possible full-size, thus, at picture more after a little while, the size that picture shows is bigger, guarantees sharpness; More for a long time, picture can completely show, guarantees monitor speed at picture.
Based on same inventive concept, the embodiment of the invention also provides a kind of picture placement device, as shown in Figure 4, comprising:
Acquisition module 401 is used for obtaining viewing area size, the original size of shown picture and the quantity of shown picture, and the original size of each described shown picture is identical;
Adjusting module 402, be used for according to described viewing area size, adjust the size of each described shown picture by same adjustment mode, size up to each described shown picture reaches maximum, and the overall width of the whole shown pictures after adjusting is not more than the width of described viewing area size, and overall height is not more than the height of described viewing area size.
Preferable, described acquisition module 401 specifically is used for obtaining the size of entire display screen curtain under the screen mode toggle; Under non-screen mode toggle, obtain the current available display screen size of display terminal operating system.
Preferable, described adjusting module 402 is used for the original size according to described viewing area size, described shown picture, determines the picture columns that the viewing area holds; Be not more than under the situation of the width of described viewing area size at whole overall widths of shown pictures, adjust the height of each described shown picture, equal the height of described viewing area size up to the overall heights of all shown pictures; Perhaps
According to the original size of described viewing area size, described shown picture, determine the picture line number that the viewing area holds; Be not more than under the situation of the height of described viewing area size in whole overall heights of shown pictures, adjust the width of each described shown picture, equal the width of described viewing area size up to the overall widths of all shown pictures; Perhaps
When the ratio of the height and the width of described shown picture was constant, the width means that adopts described shown picture is overall width and the overall height of shown picture all;
The overall height of described all shown picture and the height of described viewing area are compared;
When the overall height of described all shown pictures during less than the height of described viewing area,
The original width of each shown picture is begun to increase with 1 unit picture element, up to all being shown the overall width of picture greater than the width of described viewing area size, and these overall widths that increase the preceding described all shown pictures of unit picture element are not more than the width of described viewing area size, perhaps all be shown the overall height of picture greater than the height of described viewing area size, and these overall heights that increase the preceding described all shown pictures of unit picture element are not more than the height of described viewing area size; With the width of shown picture before this increase unit picture element, the width of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the width of the shown picture after adjusting, determine the height of described shown picture;
When the overall height of described shown picture during greater than the height of described viewing area,
The original width of each shown picture is begun to reduce with 1 unit picture element, be not more than the height of described viewing area size up to whole overall heights of shown pictures, and this reduces the overall heights of described all shown pictures before unit picture element greater than the height of described viewing area size; With the width of this shown picture, the width of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the width of the shown picture after adjusting, determine the height of described shown picture; Perhaps
When the ratio of the height and the width of described shown picture is constant, adopt the height of described shown picture to represent all to be shown overall width and the overall height of picture;
The overall width of described all shown picture and the width of described viewing area are compared;
When the overall width of described all shown pictures during less than the width of described viewing area,
The original height of each shown picture is begun to increase with 1 unit picture element, up to the overall widths of the described all shown pictures width greater than described viewing area size, and these overall widths that increase the preceding described all shown pictures of unit picture element are not more than the width of described viewing area size, perhaps all be shown the overall height of picture greater than the height of described viewing area size, and these overall heights that increase the preceding described all shown pictures of unit picture element are not more than the height of described viewing area size; With the height of shown picture before this increase unit picture element, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the height of the shown picture after adjusting, determine the width of described shown picture;
When the overall width of described shown picture during greater than the width of described viewing area,
The original height of each shown picture is begun to reduce with 1 unit picture element, be not more than the width of described viewing area size up to whole overall widths of shown pictures, and this reduces the overall widths of described all shown pictures before unit picture element greater than the width of described viewing area size; With the height of this shown picture, the height of the shown picture after being defined as adjusting; According to the ratio of the height and the width of described shown picture, and the height of the shown picture after adjusting, determine the width of described shown picture.
Preferable, said apparatus also comprises:
Characterization module 403 is used for according to the original width of described shown picture and the width of described viewing area size, determines the picture columns that described viewing area holds; According to the original width of described picture columns and shown picture, the overall width of all shown picture of expression; According to the quantity of described shown picture, and the picture columns that holds of described viewing area, determine that the desire of picture is arranged line number; According to the original width of described desire arrangement line number and described shown picture, determine the overall heights of all shown pictures; Perhaps
According to the height of original height and the described viewing area size of described shown picture, determine the picture line number that described viewing area holds; According to the original height of described picture columns and shown picture, the overall height of all shown picture of expression; According to the quantity of described shown picture, and the picture line number held of described viewing area, determine that the desire of picture is arranged columns; According to the original height that described desire is arranged columns and described shown picture, determine the overall width of all shown picture.
Preferable, said apparatus also comprises:
Processing module 404 is used for the width of the white space of the viewing area that will obtain, and on average arrive the shown picture of every row, the lateral separation that is listed as adjacent picture; Height with the white space of the viewing area that obtains on average arrives the shown picture of every row, as the capable longitudinal separation of adjacent picture.
Pass through foregoing description, as can be seen, the picture layout method and the device that use the embodiment of the invention to provide, by viewing area size, picture number, the size of adaptive adjustment picture, guarantee all complete demonstrations of energy of all pictures, and reach possible full-size, thus, at picture more after a little while, the size that picture shows is bigger, guarantees sharpness; More for a long time, picture can completely show, guarantees monitor speed at picture.
Those skilled in the art should understand that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware embodiment, complete software embodiment or in conjunction with the form of the embodiment of software and hardware aspect.And the present invention can adopt the form of the computer program of implementing in one or more computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) that wherein include computer usable program code.
The present invention is that reference is described according to process flow diagram and/or the block scheme of method, equipment (system) and the computer program of the embodiment of the invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block scheme and/or square frame and process flow diagram and/or the block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out by the processor of computing machine or other programmable data processing device produce to be used for the device of the function that is implemented in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, make the instruction that is stored in this computer-readable memory produce the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
These computer program instructions also can be loaded on computing machine or other programmable data processing device, make and carry out the sequence of operations step producing computer implemented processing at computing machine or other programmable devices, thereby be provided for being implemented in the step of the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame in the instruction that computing machine or other programmable devices are carried out.
Although described the preferred embodiments of the present invention, in a single day those skilled in the art get the basic creative concept of cicada, then can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.