CN111722823A - Method and device for self-adapting screen resolution, storage medium and electronic equipment - Google Patents

Method and device for self-adapting screen resolution, storage medium and electronic equipment Download PDF

Info

Publication number
CN111722823A
CN111722823A CN201910221773.5A CN201910221773A CN111722823A CN 111722823 A CN111722823 A CN 111722823A CN 201910221773 A CN201910221773 A CN 201910221773A CN 111722823 A CN111722823 A CN 111722823A
Authority
CN
China
Prior art keywords
resolution
screen
target
picture
proportion
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.)
Pending
Application number
CN201910221773.5A
Other languages
Chinese (zh)
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.)
Beijing Sanhao Interactive Education Science & Technology Co ltd
Original Assignee
Beijing Sanhao Interactive Education Science & Technology Co ltd
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 Beijing Sanhao Interactive Education Science & Technology Co ltd filed Critical Beijing Sanhao Interactive Education Science & Technology Co ltd
Priority to CN201910221773.5A priority Critical patent/CN111722823A/en
Publication of CN111722823A publication Critical patent/CN111722823A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/147Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0117Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level involving conversion of the spatial resolution of the incoming video signal

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides a method, a device, a storage medium and electronic equipment for self-adapting screen resolution, wherein the method comprises the following steps: the method comprises the steps of grouping screen resolutions in advance to generate a plurality of resolution groups, and allocating corresponding standard picture resources to each resolution group; determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard picture resource corresponding to the resolution group to which the target resolution belongs as a target picture resource; and zooming the target picture resource, and displaying the zoomed target picture resource on a screen of the target equipment. By the method, the device, the storage medium and the electronic equipment for self-adapting the screen resolution, screens with various resolutions can be adapted through a small amount of standard picture resources, so that the using amount of the picture resources is greatly reduced, the standard picture resources selected by the target equipment are the most suitable picture resources, and the distortion can be effectively avoided.

Description

Method and device for self-adapting screen resolution, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of self-adaptive screen resolution, in particular to a method and a device for self-adaptive screen resolution, a storage medium and electronic equipment.
Background
With the popularization of mobile terminals (such as smart phones, tablet computers and the like), various manufacturers have launched terminals of their own brands. Due to the fact that various brands and models are not uniform, screen resolution of the terminal device is increasingly fragmented, screen resolution (especially screen resolution of android devices) is different in size, and therefore the application program can only adapt to screens of terminals with partial models.
In order to adapt an application program to various screens, a common method is to provide picture resource files with different sizes according to different screens, and then match the screens with the picture resource files through configuration files. The method only enables the application program to adapt to the screen with the common resolution, but cannot adapt to all screens; moreover, the method also needs an art designer to provide a plurality of sets of picture resource files, which wastes resources.
Disclosure of Invention
To solve the foregoing problems, embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic device for adapting a screen resolution.
In a first aspect, an embodiment of the present invention provides a method for adapting a screen resolution, including:
grouping screen resolutions in advance to generate a plurality of resolution groups, and allocating corresponding standard picture resources to each resolution group, wherein each resolution group comprises one or more screen resolutions;
determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard picture resource corresponding to the resolution group to which the target resolution belongs as a target picture resource, wherein the target resolution is the screen resolution of target equipment;
and zooming the target picture resource according to the target resolution and the size of the target picture resource, and displaying the zoomed target picture resource on a screen of the target equipment.
In a second aspect, an embodiment of the present invention further provides an apparatus for adapting a screen resolution, including:
the system comprises a pre-grouping module, a standard image resource module and a display module, wherein the pre-grouping module is used for grouping screen resolutions in advance to generate a plurality of resolution groups and distributing corresponding standard image resources for each resolution group, and each resolution group comprises one or more screen resolutions;
the image resource determining module is used for determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard image resource corresponding to the resolution group to which the target resolution belongs as a target image resource, wherein the target resolution is the screen resolution of target equipment;
and the processing module is used for zooming the target picture resource according to the target resolution and the size of the target picture resource and displaying the zoomed target picture resource on a screen of the target equipment.
In a third aspect, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer-executable instructions for use in any one of the above-mentioned methods for adapting screen resolution
In a fourth aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the above-described methods of adapting screen resolution
In the solution provided by the first aspect of the embodiments of the present invention, the groups are performed by pre-dividing the screen resolution, and a corresponding standard picture resource is allocated to each group; when the target equipment needs to display the picture resources, the corresponding standard picture resources are determined according to the screen resolution of the target equipment, and the scaled standard picture resources are displayed on the target equipment in a self-adaptive mode. The method can adapt to screens with various resolutions by a small amount of standard picture resources, thereby greatly reducing the using amount of the picture resources and effectively saving the resources; meanwhile, each standard picture resource is matched with one resolution group, so that the standard picture resource selected by the target equipment is the picture resource most suitable for the target equipment, and distortion can be effectively avoided in the subsequent zooming process.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for adapting screen resolution provided by an embodiment of the present invention;
fig. 2 is a flowchart illustrating a specific method for generating a plurality of resolution groups in the method for adapting screen resolutions according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a scaling process performed on a target picture resource according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram illustrating an apparatus for adapting screen resolution according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for performing a method for adapting screen resolution according to an embodiment of the present invention.
Detailed Description
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
The method for self-adapting the screen resolution provided by the embodiment of the invention, as shown in fig. 1, includes:
step 101: the method comprises the steps of grouping screen resolutions in advance, generating a plurality of resolution groups, and allocating corresponding standard picture resources to each resolution group, wherein each resolution group comprises one or more screen resolutions.
In the embodiment of the invention, the screen resolution refers to the number of pixel points of the screen of the device, and the pixel points comprise two dimensions of horizontal pixels and vertical pixels. For example, the screen resolution is 1920 × 1080, the corresponding horizontal pixel is 1920 and the vertical pixel is 1200. In this embodiment, a plurality of screen resolutions are grouped in advance, that is, divided into a plurality of resolution groups, and each resolution group includes one or more screen resolutions. For example, the screen resolutions include 320 × 240, 640 × 480, 1024 × 600, 1920 × 1080, and the four screen resolutions may be divided into two groups, with 320 × 240, 640 × 480 being elements in one resolution group and 1024 × 600, 1920 × 1080 being elements in another resolution group.
Meanwhile, a standard picture resource is allocated to each resolution group, and the standard picture resource is a source file used when the standard picture resource needs to be displayed subsequently. The standard picture resource comprises one or more pictures, and the picture can be a whole picture or a control picture. Meanwhile, the "picture" in the present embodiment is a broad range, which refers to a resource that can be displayed in the form of an image. For example, the text that can be displayed on the device also belongs to the "picture" in the present embodiment, the video resource is composed of a plurality of frames of images, and the video resource also belongs to the "picture" in the present embodiment.
Step 102: and determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard picture resource corresponding to the resolution group to which the target resolution belongs as a target picture resource, wherein the target resolution is the screen resolution of the target device.
In the embodiment of the invention, the target device is a device which needs to display the picture resource at present and is provided with a screen. The device may be a smart phone, a tablet computer, a personal computer, and the like, which is not limited in this embodiment. After the target device is determined, the screen resolution of the target device, i.e., the target resolution, may be determined. Meanwhile, in the present embodiment, a plurality of resolution groups are generated in advance, and after the target resolution is determined, which resolution group the target resolution belongs to can be determined. For example, the resolution group a includes resolutions 320 × 240 and 640 × 480, and the resolution group B includes resolutions 1024 × 600 and 1920 × 1080, and if the target resolution is 1024 × 600, it is determined that the resolution group to which the target resolution belongs is the resolution group B. Then, the standard picture resource of the resolution group B can be used as the target picture resource that needs to be used when the target device displays the standard picture resource.
Step 103: and zooming the target picture resource according to the target resolution and the size of the target picture resource, and displaying the zoomed target picture resource on a screen of the target equipment.
In the embodiment of the present invention, the size of the target picture resource refers to the size of the screen resolution corresponding to the target picture resource, a scaling ratio can be determined according to the difference between the target resolution and the size of the target picture resource, and then the target picture resource is scaled (including reduction processing and/or enlargement processing) according to the scaling ratio, so that the size of the scaled target picture resource matches the target resolution, that is, the scaled target picture resource can adapt to the target device, and the scaled target picture resource can be displayed on the target device. For example, the target resolution of the target device is 1920 × 1080, and the size of the target picture resource is 1024 × 600, at this time, the target picture resource can be enlarged to 1920 × 1080, that is, the size of the target picture resource after the zoom processing is 1920 × 1080, so that the target picture resource can be displayed on the screen of the target device perfectly.
The embodiment performs grouping for the screen resolution in advance, and allocates the most appropriate standard picture resource for each group, that is, only a few standard picture resources need to be provided in the development stage; when the target equipment needs to display, the standard picture resource corresponding to the target equipment is determined and is subjected to scaling processing, so that the standard picture resource can be adaptive to the screen resolution of the target equipment, and a photo can be displayed on more equipment with medium screen resolution by using a plurality of standard picture resources.
In the method for adapting to the screen resolution provided by this embodiment, the screen resolutions are grouped in advance, and a corresponding standard picture resource is allocated to each group; when the target equipment needs to display the picture resources, the corresponding standard picture resources are determined according to the screen resolution of the target equipment, and the scaled standard picture resources are displayed on the target equipment in a self-adaptive mode. The method can adapt to screens with various resolutions by a small amount of standard picture resources, thereby greatly reducing the using amount of the picture resources and effectively saving the resources; meanwhile, each standard picture resource is matched with one resolution group, so that the standard picture resource selected by the target equipment is the picture resource most suitable for the target equipment, and distortion can be effectively avoided in the subsequent zooming process.
On the basis of the above embodiment, referring to fig. 2, the step 101 "grouping the screen resolutions in advance, and generating a plurality of resolution groups" includes:
step 1011: determining the screen resolution of the sample device, and determining the corresponding screen proportion according to the screen resolution of the sample device.
In the embodiment of the present invention, the sample device is a device with a screen resolution known in advance, or the sample device is a device existing on the market. Meanwhile, as will be understood by those skilled in the art, after determining the screen resolution of the devices (including the sample device and the target device), a corresponding screen ratio, which is the ratio between horizontal pixels and vertical pixels of the screen resolution, can be calculated. For example, if the screen resolution of the device is 1920 × 1080, the screen ratio is 1920/1080, i.e., the screen ratio is 16/9.
Step 1012: and counting the screen proportion of the sample equipment, and selecting N screen proportions as the screen common proportion.
In the embodiment of the invention, a plurality of sample devices are selected in advance, and the sample devices can be selected randomly. After the screen proportion of each sample device is determined, the screen proportion can be counted, and then N screen common proportions are selected from the screen common proportions. Wherein, N is a preset numerical value, and the specific value of N can be determined according to the actual situation.
Optionally, the N most screen scales may be used as the screen common scale. For example, the screen ratios of the sample devices are 100, and if 3 screen ratios are required to be selected as the screen common ratio (i.e., N is 3), the number of each screen ratio (i.e., the number of sample devices corresponding to each screen ratio) may be counted, and then the 3 screen ratios with the largest number may be used as the screen common ratio. If the number corresponding to the screen ratio 4/3 is 9 (i.e., the screen ratio of 9 sample devices is 4/3), the number corresponding to the screen ratio 16/9 is 8 (i.e., the screen ratio of 8 sample devices is 16/9), the number corresponding to the screen ratio 25/9 is 7 (i.e., the screen ratio of 7 sample devices is 25/9), and the number corresponding to the remaining 97 screen ratios among the 100 screen ratios is 1 (i.e., each screen ratio corresponds to only 1 sample device among the other 97 screen ratios), then the screen ratios 4/3, 16/9, 25/9 can be regarded as three common screen ratios.
Step 1013: sorting all the screen common proportions according to the numerical value, and selecting a proportion value between two adjacent screen common proportions as a proportion segmentation value; the N-1 proportion division values divide the total value range of the screen proportion into N proportion ranges.
In the embodiment of the invention, after the N screen common proportions are determined, the total value range of the screen proportions is divided by utilizing the N screen common proportions. Optionally, the total value range of the screen ratio may be [0, + ∞ [ ]]The total value range [ r ] can also be determined according to the maximum value and the minimum value of the screen proportionmin,rmax]Wherein r isminAnd rmaxRespectively representing the minimum and maximum values of the screen scale.
Specifically, the number of sample devices corresponding to the screen common ratio is large, and in order to reduce picture distortion as much as possible when the target device displays the picture resource, the screen common ratio needs to be set in the middle of the scale range when the scale range is divided. In the embodiment, a ratio value between two sorted adjacent screen common ratios is selected as a ratio division value for dividing the ratio range. Alternatively, the average of the common ratios of the two adjacent screens may be used as the ratio division value. For example, the common screen scale is three, and the screen scales are 4/3, 16/9 and 25/9 in sequence after being sorted, then a scale value is selected between 4/3 (i.e. 12/9) and 16/9 as a scale division value, for example, 13/9 is used as the scale division value, or the average value (i.e. 14/9) of 4/3 and 16/9 is used as the scale division value; meanwhile, another proportional value is selected between 16/9 and 25/9 as another proportional division value, such as 20/9 as the proportional division value or the average of 16/9 and 25/9 (i.e., 41/18) as the proportional division value. The three screen common proportions can determine two proportion division values, the two proportion division values can divide the total value range into three proportion ranges, and each proportion range naturally contains a corresponding screen common proportion.
For example, the two scale division values are 14/9 and 20/9, and the total value range is [ r ]min,rmax]Due to rminMust not be larger than the minimum common ratio of screen, so rminMust also be smaller than any proportional division value, and, for the same reason, rmaxIs also larger than any one of the proportional dividing values, so that the three proportional ranges divided by the two proportional dividing values can be respectively [ rmin,14/9)、[14/9,20/9)、[20/9,rmax]Each scale range contains a corresponding screen normal scale 4/3, 16/9, 25/9, respectively.
Step 1014: and mapping the N proportional ranges into N corresponding resolution groups, wherein the screen proportion corresponding to the screen resolution in one resolution group falls into the corresponding same proportional range.
In the embodiment of the present invention, because the screen resolution and the screen ratio are in a many-to-one mapping relationship, that is, a plurality of screen resolutions correspond to one screen ratio, for example, the screen resolutions 800 × 600 and 1024 × 768 both correspond to the screen ratio 4/3; therefore, the resolution group and the scale range are also in a mapping relationship, that is, all the scale values in one scale range correspond to a plurality of screen resolutions, and the plurality of screen resolutions form one resolution group; alternatively, all screen resolutions within a resolution group correspond to the same scale range.
In this embodiment, in the step 101, when the screen resolutions are grouped, the screen resolutions are grouped according to the screen ratios corresponding to the screen resolutions, and it is determined in which ratio range the screen ratio of each screen resolution falls, that is, which resolution group the screen resolution belongs to.
Meanwhile, when determining the standard picture resource corresponding to the resolution group, first determining the screen common proportion corresponding to the resolution group, and selecting the picture resource with the size ratio consistent with the screen common proportion as the standard picture resource of the resolution group, that is, the size ratio of the standard picture resource is the screen common proportion. For example, the ratio ranges are three, each being [ r ]min,14/9)、[14/9,20/9)、[20/9,rmax]Three scale ranges correspond to three resolution sets(ii) a If the common screen scales in the three scale ranges are 4/3, 16/9, and 25/9, the size ratios of the standard image resources corresponding to the three resolution groups are 4/3, 16/9, and 25/9, respectively.
In the embodiment of the invention, the screen proportions are used for grouping, the total value range of the screen proportions can be divided, and each screen resolution falls into a corresponding proportion range, so that the proportion division mode provided by the embodiment can cover all screen resolutions, namely, target equipment with any screen resolution can determine the resolution group to which the target equipment belongs by using the method provided by the embodiment, and further, corresponding picture resources are displayed on the target equipment. Meanwhile, a ratio between two screen common ratios and the size ratio of the standard picture resource are the screen common ratios in the division value of the ratio range, so that the standard picture resource covers most of devices on the market, and the scaling degree can be reduced as much as possible when the standard picture resource is scaled, thereby effectively avoiding the distortion of the picture resource.
On the basis of the foregoing embodiment, the step 103 of "performing scaling processing on the target picture resource according to the target resolution and the size of the target picture resource" specifically includes:
determining the original size and the original position of a control picture in a target picture resource, adjusting the original size and the original position of the control picture according to the target resolution and the size of the target picture resource, and determining the display size and the display position of the adjusted control picture;
wherein, the horizontal pixel of the display size of control picture is a, the vertical pixel of display size is b, the horizontal coordinate of display position is x, the vertical coordinate of display position is y, and:
Figure BDA0002003838170000091
wherein, a0、b0Horizontal and vertical pixels, x, of the original size of the control picture, respectively0Y0 is the horizontal and vertical coordinates of the original position of the control picture, respectivelyP, Q respectively represent the horizontal and vertical pixels of the target picture asset, M, N respectively represent the horizontal and vertical pixels of the target resolution.
In the embodiment of the present invention, the target picture resource has a parameter for representing a size, that is, a size ratio, where the size ratio is an overall size of the target picture resource. Meanwhile, the target picture resource may include a plurality of control pictures, the control pictures are only a part of the target picture resource, and the size of the control pictures may not be the same as that of the standard picture resource. For example, for an application, it may contain a picture resource, and the picture resource may contain multiple control pictures, such as a complete background picture, a picture corresponding to a certain button or icon, and the like. The size of the complete background picture can be regarded as being consistent with the size of the picture resource, and the picture corresponding to the button or icon is generally different from the size of the picture resource.
As shown in FIG. 3, the large rectangle in the left half of FIG. 3 represents the target picture resource, the overall size of the target picture resource is P × Q, i.e. the horizontal pixel is P and the vertical pixel is Q, the target picture resource contains a control picture, i.e. the small rectangle in the left half of FIG. 3, and the original size of the control picture is a0×b0I.e. the original size horizontal pixel of the control picture is a0Vertical pixel is b0And the original position of the control picture is (x)0,y0) (ii) a The position (including the original position and the display position) of the control picture refers to a position of a reference point in the control picture in the whole picture resource, a position a at the upper left corner of the control picture in fig. 3 represents the original position, and a position B represents the display position of the control picture after the scaling processing.
The right half of FIG. 3 shows a target device with a screen and a screen resolution of M × N. when scaling a target picture resource, the target picture resource with an overall size of P × Q is scaled to M × N to fit the screen resolution of the target deviceOriginal size a of0×b0And home position (x)0,y0) After the display size and the display position of the control picture are determined, the control picture can be displayed at the display position (x, y) of the screen of the target device, and the size of the displayed control picture is a × b.
Meanwhile, if the control picture is not a regular rectangle (for example, a circle), the control picture may be processed by a rectangle that can cover the control picture, that is, the size of the control picture is converted into the size of the rectangle that can cover the control picture. Therefore, the zooming processing of the control pictures with various sizes in the picture resources is realized, different controls are displayed at proper positions, the layout of all the control pictures in the picture resources in a target equipment screen is completed, and the distortion of the display effect can be avoided.
In the method for adapting to the screen resolution provided by this embodiment, the screen resolutions are grouped in advance, and a corresponding standard picture resource is allocated to each group; when the target equipment needs to display the picture resources, the corresponding standard picture resources are determined according to the screen resolution of the target equipment, and the scaled standard picture resources are displayed on the target equipment in a self-adaptive mode. The method can adapt to screens with various resolutions by a small amount of standard picture resources, thereby greatly reducing the using amount of the picture resources and effectively saving the resources; meanwhile, each standard picture resource is matched with one resolution group, so that the standard picture resource selected by the target equipment is the picture resource most suitable for the target equipment, and distortion can be effectively avoided in the subsequent zooming process. The proportional division manner provided by this embodiment may cover all screen resolutions, that is, a target device having any screen resolution may determine a resolution group to which the target device belongs by using the method provided by this embodiment, and further display a corresponding picture resource on the target device. Meanwhile, a ratio between two screen common ratios and the size ratio of the standard picture resource are the screen common ratios in the division value of the ratio range, so that the standard picture resource covers most of devices on the market, and the scaling degree can be reduced as much as possible when the standard picture resource is scaled, thereby effectively avoiding the distortion of the picture resource. The method can realize the zooming processing of the control pictures with various sizes in the picture resources, display different controls at proper positions, complete the layout of all the control pictures in the picture resources in a target equipment screen, and avoid the distortion of the display effect.
The above describes in detail the flow of the method for adapting the screen resolution, which may also be implemented by a corresponding apparatus, and the structure and function of the apparatus are described in detail below.
An apparatus for adapting to a screen resolution provided in an embodiment of the present invention is shown in fig. 4, and includes:
a pre-grouping module 41, configured to group screen resolutions in advance, generate a plurality of resolution groups, and allocate a corresponding standard picture resource to each resolution group, where each resolution group includes one or more screen resolutions;
a picture resource determining module 42, configured to determine a target resolution and a resolution group to which the target resolution belongs, and use a standard picture resource corresponding to the resolution group to which the target resolution belongs as a target picture resource, where the target resolution is a screen resolution of a target device;
and the processing module 43 is configured to perform scaling processing on the target picture resource according to the target resolution and the size of the target picture resource, and display the scaled target picture resource on the screen of the target device.
On the basis of the above embodiment, the pre-grouping module 41 includes:
the screen ratio determining unit is used for determining the screen resolution of the sample equipment and determining the corresponding screen ratio according to the screen resolution of the sample equipment;
the statistical unit is used for carrying out statistics on the screen proportion of the sample equipment and selecting N screen proportions as the screen common proportion;
the dividing unit is used for sequencing all the screen common proportions according to the numerical value, and selecting a proportion value between two adjacent screen common proportions as a proportion dividing value; the total value range of the screen proportion is divided into N proportion ranges by the N-1 proportion division values;
and the mapping unit is used for mapping the N proportional ranges into N corresponding resolution groups, and the screen proportion corresponding to the screen resolution in one resolution group falls into the same corresponding proportional range.
On the basis of the above embodiment, the dividing unit selects a ratio value between two adjacent screen common ratios as a ratio division value, including:
and taking the average value of the common proportions of two adjacent screens as a proportion segmentation value.
On the basis of the above embodiment, the allocating, by the picture resource determining module 42, the corresponding standard picture resource for each resolution group includes:
and determining the screen common proportion uniquely corresponding to the resolution group, and taking the picture resource with the size ratio consistent with the screen common proportion as the standard picture resource of the corresponding resolution group.
On the basis of the above embodiment, the processing module 43 is configured to:
determining the original size and the original position of a control picture in the target picture resource, adjusting the original size and the original position of the control picture according to the target resolution and the size of the target picture resource, and determining the display size and the display position of the adjusted control picture;
wherein, the horizontal pixel of the display size of the control picture is a, the vertical pixel of the display size is b, the horizontal coordinate of the display position is x, the vertical coordinate of the display position is y, and:
Figure BDA0002003838170000131
wherein, a0、b0Respectively the original size of the control pictureSmall horizontal and vertical pixels, x0、y0P, Q respectively represent horizontal pixels and vertical pixels of the target picture resource, and M, N respectively represent horizontal pixels and vertical pixels of the target resolution.
In the method for adapting to the screen resolution provided by this embodiment, the screen resolutions are grouped in advance, and a corresponding standard picture resource is allocated to each group; when the target equipment needs to display the picture resources, the corresponding standard picture resources are determined according to the screen resolution of the target equipment, and the scaled standard picture resources are displayed on the target equipment in a self-adaptive mode. The method can adapt to screens with various resolutions by a small amount of standard picture resources, thereby greatly reducing the using amount of the picture resources and effectively saving the resources; meanwhile, each standard picture resource is matched with one resolution group, so that the standard picture resource selected by the target equipment is the picture resource most suitable for the target equipment, and distortion can be effectively avoided in the subsequent zooming process. The proportional division manner provided by this embodiment may cover all screen resolutions, that is, a target device having any screen resolution may determine a resolution group to which the target device belongs by using the method provided by this embodiment, and further display a corresponding picture resource on the target device. Meanwhile, a ratio between two screen common ratios and the size ratio of the standard picture resource are the screen common ratios in the division value of the ratio range, so that the standard picture resource covers most of devices on the market, and the scaling degree can be reduced as much as possible when the standard picture resource is scaled, thereby effectively avoiding the distortion of the picture resource. The method can realize the zooming processing of the control pictures with various sizes in the picture resources, display different controls at proper positions, complete the layout of all the control pictures in the picture resources in a target equipment screen, and avoid the distortion of the display effect.
Embodiments of the present invention also provide a computer storage medium storing computer-executable instructions including a program for performing the method of adaptive screen resolution described above, where the computer-executable instructions may perform the method in any of the above method embodiments.
The computer storage medium may be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical memory (e.g., CD, DVD, BD, HVD, etc.), and semiconductor memory (e.g., ROM, EPROM, EEPROM, nonvolatile memory (NANDFLASH), Solid State Disk (SSD)), etc.
Fig. 5 shows a block diagram of an electronic device according to another embodiment of the present invention. The electronic device 1100 may be a host server with computing capabilities, a personal computer PC, or a portable computer or terminal that is portable, or the like. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
The electronic device 1100 includes at least one processor (processor)1110, a Communications Interface 1120, a memory 1130, and a bus 1140. The processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the bus 1140.
The communication interface 1120 is used for communicating with network elements including, for example, virtual machine management centers, shared storage, etc.
Processor 1110 is configured to execute programs. Processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 1130 is used for executable instructions. The memory 1130 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1130 may also be a memory array. The storage 1130 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules. The instructions stored by the memory 1130 are executable by the processor 1110 to enable the processor 1110 to perform the method of adapting screen resolution in any of the method embodiments described above.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method of adapting screen resolution, comprising:
grouping screen resolutions in advance to generate a plurality of resolution groups, and allocating corresponding standard picture resources to each resolution group, wherein each resolution group comprises one or more screen resolutions;
determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard picture resource corresponding to the resolution group to which the target resolution belongs as a target picture resource, wherein the target resolution is the screen resolution of target equipment;
and zooming the target picture resource according to the target resolution and the size of the target picture resource, and displaying the zoomed target picture resource on a screen of the target equipment.
2. The method of claim 1, wherein the pre-grouping screen resolutions to generate multiple resolution groups comprises:
determining the screen resolution of the sample equipment, and determining the corresponding screen proportion according to the screen resolution of the sample equipment;
counting screen proportions of sample equipment, and selecting N screen proportions as screen common proportions;
sorting all the screen common proportions according to the numerical value, and selecting a proportion value between two adjacent screen common proportions as a proportion segmentation value; the total value range of the screen proportion is divided into N proportion ranges by the N-1 proportion division values;
and mapping the N proportional ranges into N corresponding resolution groups, wherein the screen proportion corresponding to the screen resolution in one resolution group falls into the same corresponding proportional range.
3. The method according to claim 2, wherein the selecting a ratio value between two adjacent screen common ratios as the ratio division value comprises:
and taking the average value of the common proportions of two adjacent screens as a proportion segmentation value.
4. The method of claim 2, wherein said assigning a corresponding standard picture resource to each of said resolution groups comprises:
and determining the screen common proportion uniquely corresponding to the resolution group, and taking the picture resource with the size ratio consistent with the screen common proportion as the standard picture resource of the corresponding resolution group.
5. The method according to any one of claims 1 to 4, wherein the scaling the target picture resource according to the target resolution and the size of the target picture resource comprises:
determining the original size and the original position of a control picture in the target picture resource, adjusting the original size and the original position of the control picture according to the target resolution and the size of the target picture resource, and determining the display size and the display position of the adjusted control picture;
wherein, the horizontal pixel of the display size of the control picture is a, the vertical pixel of the display size is b, the horizontal coordinate of the display position is x, the vertical coordinate of the display position is y, and:
Figure FDA0002003838160000021
wherein, a0、b0Horizontal and vertical pixels, x, respectively, of the original size of the control picture0、y0P, Q respectively represent horizontal pixels and vertical pixels of the target picture resource, and M, N respectively represent horizontal pixels and vertical pixels of the target resolution.
6. An apparatus for adapting screen resolution, comprising:
the system comprises a pre-grouping module, a standard image resource module and a display module, wherein the pre-grouping module is used for grouping screen resolutions in advance to generate a plurality of resolution groups and distributing corresponding standard image resources for each resolution group, and each resolution group comprises one or more screen resolutions;
the image resource determining module is used for determining a target resolution and a resolution group to which the target resolution belongs, and taking a standard image resource corresponding to the resolution group to which the target resolution belongs as a target image resource, wherein the target resolution is the screen resolution of target equipment;
and the processing module is used for zooming the target picture resource according to the target resolution and the size of the target picture resource and displaying the zoomed target picture resource on a screen of the target equipment.
7. The apparatus of claim 6, wherein the pre-grouping module comprises:
the screen ratio determining unit is used for determining the screen resolution of the sample equipment and determining the corresponding screen ratio according to the screen resolution of the sample equipment;
the statistical unit is used for carrying out statistics on the screen proportion of the sample equipment and selecting N screen proportions as the screen common proportion;
the dividing unit is used for sequencing all the screen common proportions according to the numerical value, and selecting a proportion value between two adjacent screen common proportions as a proportion dividing value; the total value range of the screen proportion is divided into N proportion ranges by the N-1 proportion division values;
and the mapping unit is used for mapping the N proportional ranges into N corresponding resolution groups, and the screen proportion corresponding to the screen resolution in one resolution group falls into the same corresponding proportional range.
8. The apparatus of any of claims 6 or 7, wherein the processing module is configured to:
determining the original size and the original position of a control picture in the target picture resource, adjusting the original size and the original position of the control picture according to the target resolution and the size of the target picture resource, and determining the display size and the display position of the adjusted control picture;
wherein, the horizontal pixel of the display size of the control picture is a, the vertical pixel of the display size is b, the horizontal coordinate of the display position is x, the vertical coordinate of the display position is y, and:
Figure FDA0002003838160000031
wherein, a0、b0Horizontal and vertical pixels, x, respectively, of the original size of the control picture0、y0P, Q respectively represent horizontal pixels and vertical pixels of the target picture resource, and M, N respectively represent horizontal pixels and vertical pixels of the target resolution.
9. A computer storage medium having computer-executable instructions stored thereon for performing the method for adapting screen resolution of any of claims 1-5.
10. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of adapting screen resolution of any one of claims 1-5.
CN201910221773.5A 2019-03-22 2019-03-22 Method and device for self-adapting screen resolution, storage medium and electronic equipment Pending CN111722823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910221773.5A CN111722823A (en) 2019-03-22 2019-03-22 Method and device for self-adapting screen resolution, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910221773.5A CN111722823A (en) 2019-03-22 2019-03-22 Method and device for self-adapting screen resolution, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111722823A true CN111722823A (en) 2020-09-29

Family

ID=72562912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910221773.5A Pending CN111722823A (en) 2019-03-22 2019-03-22 Method and device for self-adapting screen resolution, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111722823A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590537A (en) * 2021-07-30 2021-11-02 平安普惠企业管理有限公司 Picture resource loading method, device and equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101068333A (en) * 2006-05-04 2007-11-07 新泰辉煌公司 Method for scaling and cropping images for television display
CN103970436A (en) * 2013-01-25 2014-08-06 人人游戏网络科技发展(上海)有限公司 Method and device for displaying on screen of electronic equipment
CN105511725A (en) * 2015-12-09 2016-04-20 网易(杭州)网络有限公司 Method and device for displaying controls in interface
CN108363604A (en) * 2018-02-06 2018-08-03 四川虹美智能科技有限公司 A kind of resolution adaptation method, apparatus and operation system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101068333A (en) * 2006-05-04 2007-11-07 新泰辉煌公司 Method for scaling and cropping images for television display
EP1853060A1 (en) * 2006-05-04 2007-11-07 Syntax Brillian Corp. Method for scaling and cropping images for television display
CN103970436A (en) * 2013-01-25 2014-08-06 人人游戏网络科技发展(上海)有限公司 Method and device for displaying on screen of electronic equipment
CN105511725A (en) * 2015-12-09 2016-04-20 网易(杭州)网络有限公司 Method and device for displaying controls in interface
CN108363604A (en) * 2018-02-06 2018-08-03 四川虹美智能科技有限公司 A kind of resolution adaptation method, apparatus and operation system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590537A (en) * 2021-07-30 2021-11-02 平安普惠企业管理有限公司 Picture resource loading method, device and equipment and storage medium

Similar Documents

Publication Publication Date Title
TWI637355B (en) Methods of compressing a texture image and image data processing system and methods of generating a 360-degree panoramic video thereof
US20220230338A1 (en) Depth image generation method, apparatus, and storage medium and electronic device
CN107103890B (en) The method and apparatus of application is shown on fixed-direction display
CN112102164B (en) Image processing method, device, terminal and storage medium
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN110908762B (en) Dynamic wallpaper implementation method and device
CN103702032A (en) Image processing method, device and terminal equipment
CN113126937A (en) Display terminal adjusting method and display terminal
CN111859874B (en) Form generation method and system, video playing device and computer readable medium
CN108932703B (en) Picture processing method, picture processing device and terminal equipment
CN113721879B (en) Image processing method, device, equipment and computer readable storage medium
CN111722823A (en) Method and device for self-adapting screen resolution, storage medium and electronic equipment
CN115129278A (en) Image display control method, system, readable storage medium and electronic device
CN112927163A (en) Image data enhancement method and device, electronic equipment and storage medium
CN114493988A (en) Image blurring method, image blurring device and terminal equipment
JP4854746B2 (en) Buffer management in vector graphics hardware
JP5563545B2 (en) Information processing apparatus and method
CN108898169B (en) Picture processing method, picture processing device and terminal equipment
WO2020124454A1 (en) Font switching method and related product
CN113742430B (en) Method and system for determining number of triangle structures formed by nodes in graph data
CN108540726B (en) Method and device for processing continuous shooting image, storage medium and terminal
CN111223105B (en) Image processing method and device
CN113703653A (en) Image processing method, device, equipment and computer readable storage medium
CN111712833B (en) Method and device for screening local feature points
CN109242763B (en) Picture processing method, picture processing device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination