Method and apparatus for adjusting screen resolution
Patent Information
- Application Number
- CN202310574443.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-05-19
AI Technical Summary
[0005]本公开提供一种屏幕分辨率的调整方法及设备,以解决现有技术中针对用户手动调整屏幕步骤繁琐的情况
[0019] This disclosure provides a screen resolution adjustment method and apparatus. The method is applied to an electronic device. It determines a target PPI on the screen of the electronic device, and then determines a target scaling factor based on the target PPI and a preset mapping relationship. This mapping relationship indicates the scaling factors corresponding to multiple PPI threshold ranges. Finally, it adjusts the logical resolution of the screen based on the physical resolution and the target scaling factor. In this technical solution, after determining the target PPI, a suitable scaling factor is automatically matched from the pre-configured scaling factors corresponding to the PPI threshold ranges, thereby automatically setting a suitable physical resolution for the user, improving user experience, and avoiding tedious manual operations.
Smart Images

Figure CN119007690B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for adjusting screen resolution. Background Technology
[0002] With the widespread use of electronic products and the advancement of technology, the size and resolution of screens in electronic devices are becoming increasingly diverse. On different screens, icons or fonts of the same size may be displayed completely differently, causing inconvenience to users.
[0003] In existing technologies, to address this issue, electronic device operating systems provide scaling functions, allowing users to adapt to different screens by adjusting the scaling factor. Specifically, users need to manually control the screen's control mechanism to adjust the scaling factor, relying on their own judgment to find a suitable scaling factor for optimal screen display. In other words, the electronic device renders page data on the screen based on the resolution corresponding to that scaling factor.
[0004] However, manual adjustment requires users to continuously select the scaling factor using the control device, and most users do not have the relevant technical knowledge, which increases the difficulty of manual scaling. Summary of the Invention
[0005] This disclosure provides a method and apparatus for adjusting screen resolution to solve the problem of cumbersome manual screen adjustment steps in the prior art.
[0006] In a first aspect, embodiments of this disclosure provide a method for adjusting screen resolution, applied to an electronic device, the method comprising:
[0007] Determine the target number of pixels per inch (PPI) in the screen of the electronic device;
[0008] The target scaling factor of the screen is determined based on the target PPI and the preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively;
[0009] The logical resolution of the screen is adjusted according to the physical resolution of the screen and the target scaling factor.
[0010] Secondly, embodiments of this disclosure provide a screen resolution adjustment device, applied to an electronic device, the adjustment device comprising:
[0011] The first determining module is used to determine the number of pixels per inch (PPI) of the target in the screen of the electronic device;
[0012] The second determining module is used to determine the target scaling factor of the screen based on the target PPI and a preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively;
[0013] An adjustment module is used to adjust the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor.
[0014] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0015] The memory stores computer-executed instructions;
[0016] The processor executes computer execution instructions stored in the memory to implement the screen resolution adjustment method as described in the first aspect above.
[0017] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the screen resolution adjustment method described in the first aspect.
[0018] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the screen resolution adjustment method described in the first aspect above.
[0019] This disclosure provides a screen resolution adjustment method and apparatus. The method is applied to an electronic device. It determines a target PPI on the screen of the electronic device, and then determines a target scaling factor based on the target PPI and a preset mapping relationship. This mapping relationship indicates the scaling factors corresponding to multiple PPI threshold ranges. Finally, it adjusts the logical resolution of the screen based on the physical resolution and the target scaling factor. In this technical solution, after determining the target PPI, a suitable scaling factor is automatically matched from the pre-configured scaling factors corresponding to the PPI threshold ranges, thereby automatically setting a suitable physical resolution for the user, improving user experience, and avoiding tedious manual operations. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0021] Figure 1 A schematic diagram illustrating an application scenario of a screen resolution adjustment method provided in this embodiment of the disclosure;
[0022] Figure 2 Flowchart of the screen resolution adjustment method provided in this embodiment of the disclosure Figure 1 ;
[0023] Figure 3 Flowchart of the screen resolution adjustment method provided in this embodiment of the disclosure Figure 2 ;
[0024] Figure 4 A schematic diagram of the structure of a screen resolution adjustment device provided in an embodiment of this disclosure;
[0025] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0026] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0028] Before introducing the embodiments of this disclosure, the terms and application background involved in the embodiments of this disclosure will be explained first:
[0029] Dots per inch (DPI): This usually refers to the number of printed dots per inch at logical resolution. For example, a 300 DPI printer can print 300 dots per inch, while a 600 DPI printer can print more detailed images.
[0030] Pixels per inch (PPI): This is commonly used to describe the resolution of a screen or digital image. For example, a 1920x1080 resolution screen can display approximately 96 pixels per inch, while a 3840x2160 resolution screen can display a sharper image.
[0031] Physical resolution, also known as standard resolution, refers to the original resolution of the image displayed on an LED screen, also called the true resolution. The optimal resolution of the screen, expressed mathematically as the number of rows and columns of pixels actually present on the screen, is an inherent parameter of the display and cannot be adjusted. It refers to the maximum number of pixels the screen can display.
[0032] Logical resolution: The difference between the display resolution and the physical resolution, calculated using a scaling factor. Generally, physical resolution > logical resolution, and physical resolution * scaling factor = logical resolution.
[0033] Common logical resolutions (width, height) are: (768, 1024); (1024, 640); (1280, 800); (1200, 675); (1080, 675); (1200, 750); (1366, 768); (1280, 720); (1536, 864); (1440, 810); (1536, 960); (1920, 1200); (1920, 1080); (1600, 900); (1366, 912); (1280, 850); (1332, 888); (1410, 940).
[0034] Screen size: Usually measured by the length of the diagonal of the display area, in inches, while the maximum viewable area is the maximum area of graphics that the monitor can display.
[0035] With the widespread use of electronic devices and the advancement of technology, the screens of electronic devices, i.e., displays, are becoming increasingly diverse in size and resolution. On different displays, icons or fonts of the same size may appear completely different, causing inconvenience to users. Visually, the user experience is poor because the resolution is not suitable for the current viewing experience.
[0036] To address this issue, a common approach is for technicians to provide scaling functionality to the operating system of electronic devices at the factory. This allows users to adjust the scaling factor to determine the appropriate logical resolution for the current screen and render the data to be displayed at that resolution.
[0037] However, for many users, the following technical issues exist:
[0038] Firstly, the manual adjustment method is cumbersome and provides a poor user experience;
[0039] Secondly, for most users, without knowledge of scaling functions, it takes multiple attempts to determine the appropriate scaling factor to achieve the best screen rendering effect.
[0040] Based on the aforementioned technical problems, the inventor's technical concept is as follows: Although existing technologies provide scaling functions, i.e., scaling values for users to choose from, users need to try randomly or iteratively to obtain a suitable scaling factor to adjust the current screen's logical resolution. If prior knowledge can be used to determine the PPI based on the monitor's size and physical resolution, and for different PPIs, the most suitable scaling factor for the screen can be determined experimentally, when the user needs to adjust the screen, the current screen's PPI can be automatically matched to obtain the most suitable scaling factor. Then, based on this scaling factor, the relevant logical resolution can be determined, thereby displaying a better display interface for the user, improving the user experience, and eliminating the need for cumbersome manual operation.
[0041] Before introducing the method embodiments of this disclosure, an application scenario involving the method of this disclosure will be described first. Figure 1 This is a schematic diagram illustrating an application scenario of a screen resolution adjustment method provided in an embodiment of this disclosure, such as... Figure 1 As shown, the application scenario includes: electronic device 11, processing unit 12 of electronic device 11, screen 13 of electronic device 11, and storage unit 14 of electronic device 11.
[0042] Among them, screen 13 can be an external screen (i.e., a display outside of electronic device 11) or an internal screen of electronic device 11 (i.e., the display of electronic device 11 itself). This application scenario is explained using an external screen as an example. The implementation of the internal screen is similar and will not be described in detail here.
[0043] In one possible implementation, the processing unit 12 obtains parameters such as the physical resolution and size of the screen 13, calculates the PPI of the screen 13, and then determines a suitable scaling factor based on the PPI and the mapping relationship between multiple PPIs and scaling factors pre-stored in the storage unit 14 of the electronic device. After that, the processing unit 12 adjusts the resolution of the screen 13 according to the scaling factor to provide the user with a better screen display method.
[0044] The technical solutions of this disclosure will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0045] It is worth noting that the application field of the screen resolution adjustment method and device disclosed herein is not limited, and may include the field of screen resolution adjustment technology. The executing subject of this disclosure is an electronic device, specifically a mobile phone, tablet, computer, server, or other such device. In some implementations, the electronic device can connect to an external screen or may have its own built-in screen.
[0046] Figure 2 Flowchart of the screen resolution adjustment method provided in this embodiment of the disclosure Figure 1 ,like Figure 2 As shown, the method may include the following steps:
[0047] Step 21: Determine the target PPI on the screen of the electronic device;
[0048] In this step, the target PPI is the original PPI of the screen of the electronic device.
[0049] In other words, the original PPI of the screen can be the PPI corresponding to the physical resolution designed before leaving the factory, which is related to the size of the screen.
[0050] Step 22: Determine the target scaling factor of the screen based on the target PPI and the preset mapping relationship. The mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively.
[0051] In this step, the electronic device has a built-in mapping relationship for indicating the scaling factor corresponding to multiple PPI threshold ranges. This mapping relationship can be determined through multiple experiments, which can ensure that when the target PPI is placed within the corresponding PPI threshold range, its corresponding scaling factor is a scaling factor suitable for the current screen.
[0052] In one possible implementation, if the target PPI is determined to be 270, the various PPI threshold ranges can be traversed in the mapping relationship. For example, if a PPI threshold range is matched to be less than 290 and greater than or equal to 230, then the target scaling factor corresponding to the target PPI is determined to be the scaling factor 2.0 corresponding to that PPI threshold range, and the target scaling factor of the screen is determined to be 2.0.
[0053] Optionally, the screen may include a built-in screen and / or an external screen.
[0054] In practical applications, electronic devices can include one or more screens, i.e., the built-in screen of the electronic device, such as laptops and mobile phones; electronic devices can also connect to other displays wirelessly or via wired means, i.e., as external screens for the electronic device, for example, the host of a desktop computer can be connected to a monitor via a data cable.
[0055] Accordingly, the mapping relationships include: a first mapping relationship for the built-in screen and / or a second mapping relationship for the external screen. The first mapping relationship is the scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the built-in screen is closer to the second value than the first value. The second mapping relationship is the scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the external screen is closer to the first value than the second value.
[0056] It should be understood that since there are built-in screens and external screens, there are their own mapping relationships, namely the first mapping relationship for built-in screens and the second mapping relationship for external screens. The establishment of these two mapping relationships requires that after scaling the physical resolution by the corresponding scaling factor, the DPI corresponding to the logical resolution should be close to the second value and the first value, respectively. Multiple experiments have demonstrated that the screen display effect is better when the values are close to the corresponding values (this example is given in step 23, and the number of times will not be repeated).
[0057] Optionally, DPI can be calculated as follows:
[0058]
[0059] Where C is the width of the logical resolution, D is the height of the logical resolution, and E is the diagonal size of the screen.
[0060] In one possible implementation, the first value is less than the second value; the first value is 90 and the second value is 120.
[0061] Optionally, as an example, the first mapping relationship corresponding to the built-in screen includes:
[0062] The PPI threshold range is greater than or equal to 290, corresponding to a scaling factor of 2.5;
[0063] The scaling factor corresponding to the PPI threshold range of less than 290 and greater than or equal to 230 is 2;
[0064] The scaling factor corresponding to the PPI threshold range of less than 230 and greater than or equal to 200 is 1.666;
[0065] The scaling factor corresponding to a PPI threshold range of less than 200 and greater than or equal to 170 is 1.5;
[0066] The scaling factor corresponding to a PPI threshold range of less than 170 and greater than or equal to 140 is 1.25.
[0067] The PPI threshold range is less than 140 and greater than or equal to 0, corresponding to a scaling factor of 1.
[0068] That is, Table 1 is a schematic table of the first mapping relationship corresponding to the built-in screen provided in the embodiments of this disclosure, as shown in Table 1:
[0069] Table 1:
[0070] Greater than or equal to 290 2.5 Less than 290 and greater than or equal to 230 2 Less than 230 and greater than or equal to 200 1.666 Less than 200 and greater than or equal to 170 1.5 Less than 170 and greater than or equal to 140 1.25 Less than 140 and greater than or equal to 0 1
[0071] Generally, the scaling factor should meet the condition: scale = x / 8, where scale is the scaling factor and x is any natural number. The above scaling factor basically meets this condition (the same applies to the second mapping relationship diagram below). However, when the scaling factor is 1.666, in order to ensure that the logical resolution calculated later is one of the common logical resolutions (that is, to ensure that the horizontal and vertical logical resolutions are integers after scaling as much as possible), the corresponding scaling factor is set to 1.666 when the PPI threshold range is less than 230 and greater than or equal to 200.
[0072] Optionally, the second mapping relationship corresponding to the external screen includes:
[0073] The PPI threshold range is greater than or equal to 175, corresponding to a scaling factor of 2;
[0074] The scaling factor corresponding to the PPI threshold range of less than 175 and greater than or equal to 150 is 1.875;
[0075] The scaling factor corresponding to a PPI threshold range of less than 150 and greater than or equal to 125 is 1.5;
[0076] The scaling factor corresponding to a PPI threshold range of less than 125 and greater than or equal to 100 is 1.25;
[0077] The PPI threshold range is less than 100 and greater than or equal to 0, corresponding to a scaling factor of 1.
[0078] That is, Table 2 is a schematic table of the second mapping relationship corresponding to the built-in screen provided in the embodiments of this disclosure, as shown in Table 2:
[0079] Table 2:
[0080]
[0081]
[0082] It should also be understood that since the screen can be an internal screen and / or an external screen, in practical applications, adjusting the screen resolution can involve one or more internal screens, one or more external screens, or one or more internal screens and one or more external screens.
[0083] Step 23: Adjust the screen's logical resolution according to the screen's physical resolution and the target scaling factor.
[0084] In this step, the physical resolution is the original resolution of the screen when it was manufactured. After the target scaling factor is determined in the above steps, the physical resolution is scaled based on the target scaling factor to adjust the logical resolution of the screen.
[0085] Optionally, step 23 can be implemented as follows:
[0086] Step 1: Adjust the ratio of the physical resolution width to the target scaling factor to the logical resolution width;
[0087] Step 2: Adjust the ratio of the physical resolution height to the target scaling factor to the logical resolution height.
[0088] As an example, Table 3 is a schematic table illustrating the scaling of the built-in screen provided in the embodiments of this disclosure (also showing a DPI closer to the second value, such as 120, with a size of 14' as an example), as shown in Table 3:
[0089] Table 3:
[0090] 1920,1080 157.35 1.25 1536,864 125.88 2160,1440 185 1.5 1440,960 123.62 2560,1440 209.8 1.666 1536,864 125.88 3840,2160 314.7 2.5 1536,864 125.88
[0091] For example, if the width of the physical resolution is 1920, then the width of the logical resolution is 1920 / 1.25 = 1536; if the height of the physical resolution is 1080, then the height of the logical resolution is 1080 / 1.25 = 864; other examples follow the same principle.
[0092] As an example, Table 4 is a schematic table illustrating the scaling of the external screen provided in the embodiments of this disclosure (also showing a DPI closer to a first value, such as 90), as shown in Table 4:
[0093] Table 4:
[0094]
[0095]
[0096] For example, if the width of the physical resolution is 1920, then the width of the logical resolution is 1920 / 1 = 1920; if the height of the physical resolution is 1080, then the height of the logical resolution is 1080 / 1 = 1080; other examples follow the same principle.
[0097] It should be understood that the calculation process of PPI in Tables 3 and 4 is given in the following examples.
[0098] Optionally, the specific module that adjusts the screen's logical resolution to achieve screen scaling can be the computer's underlying Graphics module.
[0099] The screen resolution adjustment method provided in this disclosure is applied to an electronic device. This method determines a target PPI on the screen of the electronic device, and determines a target scaling factor for the screen based on the target PPI and a preset mapping relationship. This mapping relationship indicates the scaling factors corresponding to multiple PPI threshold ranges. The logical resolution of the screen is adjusted according to the physical resolution of the screen and the target scaling factor. In this technical solution, after determining the target PPI, a suitable scaling factor is automatically matched from the pre-configured scaling factors corresponding to the PPI threshold ranges, thereby automatically setting a suitable physical resolution for the user, thus improving the user experience and avoiding tedious manual operations.
[0100] Based on the above embodiments, Figure 3 Flowchart of the screen resolution adjustment method provided in this embodiment of the disclosure Figure 2 ,like Figure 3 As shown, step 21 above may include the following steps:
[0101] Step 31: Obtain the screen's physical resolution and diagonal size;
[0102] In this step, the screen's physical resolution and diagonal size can be obtained from the device information.
[0103] For example, the above can be used to obtain some screen physical resolution and screen diagonal size.
[0104] As an example, Table 5 is a schematic table illustrating the physical resolution and size of the built-in screen provided in the embodiments of this disclosure, as shown in Table 5:
[0105] Table 5:
[0106]
[0107]
[0108] As an example, Table 6 is a schematic table illustrating the physical resolution and size of the external screen provided in the embodiments of this disclosure, as shown in Table 6 (same as Table 4):
[0109] Table 6:
[0110] 24' 1920,1080 27' 1920,1080 27'2K 2560,1440 27'4K 3840,2160
[0111] Step 32: Determine the target PPI based on the physical resolution and diagonal size.
[0112] In this step, after determining the physical resolution and diagonal size as described above, the target PPI for the corresponding screen is determined.
[0113] Optionally, the PPI can be calculated as follows:
[0114]
[0115] Where A is the width of the physical resolution, B is the height of the physical resolution, and E is the diagonal size of the screen.
[0116] For example, if the width of the physical resolution is 1920, the height of the physical resolution is 1080, and the size is 14', the target PPI is 157.35 according to the above PPI calculation formula; if the width of the physical resolution is 1920, the height of the physical resolution is 1080, and the size is 24', the target PPI is 91.79 according to the above PPI calculation formula; other examples are similar and will not be listed here.
[0117] The screen resolution adjustment method provided in this disclosure obtains the screen's physical resolution and diagonal size, and then determines the target PPI based on the physical resolution and diagonal size. This technical solution achieves the determination of the current screen's PPI.
[0118] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.
[0119] Figure 4 This is a schematic diagram of the structure of a screen resolution adjustment device provided in an embodiment of this disclosure. Figure 4 As shown, the adjustment device includes:
[0120] The first determining module 41 is used to determine the number of pixels per inch (PPI) of the target in the screen of the electronic device;
[0121] The second determining module 42 is used to determine the target scaling factor of the screen based on the target PPI and the preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively;
[0122] Adjustment module 43 is used to adjust the logical resolution of the screen according to the screen's physical resolution and the target scaling factor.
[0123] In one possible design of this disclosure embodiment, the screen includes a built-in screen and / or an external screen;
[0124] Accordingly, the mapping relationships include: a first mapping relationship for the built-in screen and / or a second mapping relationship for the external screen. The first mapping relationship is the scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the built-in screen is closer to the second value than the first value. The second mapping relationship is the scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the external screen is closer to the first value than the second value.
[0125] The first value is less than the second value.
[0126] In another possible design of this disclosure embodiment, the first mapping relationship corresponding to the built-in screen includes:
[0127] The PPI threshold range is greater than or equal to 290, corresponding to a scaling factor of 2.5;
[0128] The scaling factor corresponding to the PPI threshold range of less than 290 and greater than or equal to 230 is 2;
[0129] The scaling factor corresponding to the PPI threshold range of less than 230 and greater than or equal to 200 is 1.666;
[0130] The scaling factor corresponding to a PPI threshold range of less than 200 and greater than or equal to 170 is 1.5;
[0131] The scaling factor corresponding to a PPI threshold range of less than 170 and greater than or equal to 140 is 1.25.
[0132] The PPI threshold range is less than 140 and greater than or equal to 0, corresponding to a scaling factor of 1.
[0133] In another possible design of this disclosure embodiment, the second mapping relationship corresponding to the external screen includes:
[0134] The PPI threshold range is greater than or equal to 175, corresponding to a scaling factor of 2;
[0135] The scaling factor corresponding to the PPI threshold range of less than 175 and greater than or equal to 150 is 1.875;
[0136] The scaling factor corresponding to a PPI threshold range of less than 150 and greater than or equal to 125 is 1.5;
[0137] The scaling factor corresponding to a PPI threshold range of less than 125 and greater than or equal to 100 is 1.25;
[0138] The PPI threshold range is less than 100 and greater than or equal to 0, corresponding to a scaling factor of 1.
[0139] In another possible design of this disclosure embodiment, the first determining module 41 determines the target PPI in the screen of the electronic device, specifically for:
[0140] Get the screen's physical resolution and diagonal size;
[0141] The target PPI is determined based on the physical resolution and diagonal size.
[0142] In another possible design of this embodiment, the adjustment module 43 adjusts the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor, specifically for:
[0143] Adjust the ratio of the physical resolution width to the target scaling factor to the logical resolution width;
[0144] Adjust the ratio of the physical resolution height to the target scaling factor to the logical resolution height.
[0145] In another possible design of this disclosure embodiment, the first value is 90 and the second value is 120.
[0146] The screen resolution adjustment device provided in this disclosure can be used to execute the screen resolution adjustment method involved in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0147] It should be noted that the division of the various modules in the above-described device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software through processing element calls; they can be fully implemented in hardware; or some modules can be implemented through processing element calls in software, while others are implemented in hardware. Additionally, these modules can be fully or partially integrated together, or implemented independently. The processing element mentioned here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0148] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this disclosure, such as... Figure 5The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of the present disclosure. This electronic device can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers.
[0149] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0150] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 51 (which may be the processing unit 12 described above), which can perform various appropriate actions and processes (which may be the storage unit 14 described above) according to a program stored in a read-only memory (ROM) 52 or a program loaded from a storage device 58 into a random access memory (RAM) 53. The RAM 53 also stores various programs and data required for the operation of the electronic device. The processing unit 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0151] Typically, the following devices can be connected to I / O interface 55: input devices 56 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 57 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 58 including, for example, magnetic tapes, hard disks, etc.; and communication devices 59. Communication device 59 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0152] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 59, or installed from a storage device 58, or installed from a ROM 52. When the computer program is executed by the processing device 51, it performs the functions defined in the methods of embodiments of this disclosure.
[0153] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0154] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0155] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0156] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0157] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0158] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0159] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0160] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0161] The electronic device provided in this disclosure can be used to execute the screen resolution adjustment method provided in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0162] This disclosure provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the screen resolution adjustment method described above.
[0163] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0164] Optionally, a readable storage medium can be coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. Both the processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components within the device.
[0165] This disclosure also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the above-described screen resolution adjustment method.
[0166] also:
[0167] In a first aspect, embodiments of this disclosure provide a method for adjusting screen resolution, applied to an electronic device, the method comprising:
[0168] Determine the target number of pixels per inch (PPI) in the screen of the electronic device;
[0169] The target scaling factor of the screen is determined based on the target PPI and the preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively;
[0170] The logical resolution of the screen is adjusted according to the physical resolution of the screen and the target scaling factor.
[0171] In one possible design of the first aspect, the screen includes a built-in screen and / or an external screen;
[0172] Accordingly, the mapping relationship includes: a first mapping relationship of the built-in screen and / or a second mapping relationship of the external screen. The first mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the built-in screen is closer to a second value than a first value. The second mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the external screen is closer to the first value than the second value.
[0173] Wherein, the first value is less than the second value.
[0174] In another possible design of the first aspect, the first mapping relationship corresponding to the built-in screen includes:
[0175] The PPI threshold range is greater than or equal to 290, and the scaling factor corresponding to this range is 2.5.
[0176] The scaling factor corresponding to the PPI threshold range of less than 290 and greater than or equal to 230 is 2;
[0177] The scaling factor corresponding to the PPI threshold range of less than 230 and greater than or equal to 200 is 1.666;
[0178] The scaling factor corresponding to the PPI threshold range of less than 200 and greater than or equal to 170 is 1.5;
[0179] The scaling factor corresponding to the PPI threshold range of less than 170 and greater than or equal to 140 is 1.25;
[0180] The scaling factor corresponding to the PPI threshold range being less than 140 and greater than or equal to 0 is 1.
[0181] In another possible design of the first aspect, the second mapping relationship corresponding to the external screen includes:
[0182] The PPI threshold range is greater than or equal to 175, and the scaling factor is 2.
[0183] The scaling factor corresponding to the PPI threshold range of less than 175 and greater than or equal to 150 is 1.875;
[0184] The scaling factor corresponding to the PPI threshold range of less than 150 and greater than or equal to 125 is 1.5;
[0185] The scaling factor corresponding to the PPI threshold range of less than 125 and greater than or equal to 100 is 1.25;
[0186] The scaling factor corresponding to the PPI threshold range being less than 100 and greater than or equal to 0 is 1.
[0187] In another possible design within the first aspect, determining the target PPI in the screen of the electronic device includes:
[0188] Obtain the physical resolution and diagonal size of the screen;
[0189] The target PPI is determined based on the physical resolution and the diagonal size.
[0190] In another possible design of the first aspect, adjusting the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor includes:
[0191] Adjust the ratio of the width of the physical resolution to the target scaling factor to the width of the logical resolution;
[0192] Adjust the ratio of the physical resolution height to the target scaling factor to the logical resolution height.
[0193] In another possible design of the first aspect, the first value is 90 and the second value is 120.
[0194] Secondly, embodiments of this disclosure provide a screen resolution adjustment device, applied to an electronic device, the adjustment device comprising:
[0195] The first determining module is used to determine the number of pixels per inch (PPI) of the target in the screen of the electronic device;
[0196] The second determining module is used to determine the target scaling factor of the screen based on the target PPI and a preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively;
[0197] An adjustment module is used to adjust the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor.
[0198] In one possible design of the second aspect, the screen includes a built-in screen and / or an external screen;
[0199] Accordingly, the mapping relationship includes: a first mapping relationship of the built-in screen and / or a second mapping relationship of the external screen. The first mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the built-in screen is closer to a second value than a first value. The second mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the external screen is closer to the first value than the second value.
[0200] Wherein, the first value is less than the second value.
[0201] In another possible design of the second aspect, the first mapping relationship corresponding to the built-in screen includes:
[0202] The PPI threshold range is greater than or equal to 290, and the scaling factor corresponding to this range is 2.5.
[0203] The scaling factor corresponding to the PPI threshold range of less than 290 and greater than or equal to 230 is 2;
[0204] The scaling factor corresponding to the PPI threshold range of less than 230 and greater than or equal to 200 is 1.666;
[0205] The scaling factor corresponding to the PPI threshold range of less than 200 and greater than or equal to 170 is 1.5;
[0206] The scaling factor corresponding to the PPI threshold range of less than 170 and greater than or equal to 140 is 1.25;
[0207] The scaling factor corresponding to the PPI threshold range being less than 140 and greater than or equal to 0 is 1.
[0208] In another possible design, the second mapping relationship corresponding to the external screen includes:
[0209] The PPI threshold range is greater than or equal to 175, and the scaling factor is 2.
[0210] The scaling factor corresponding to the PPI threshold range of less than 175 and greater than or equal to 150 is 1.875;
[0211] The scaling factor corresponding to the PPI threshold range of less than 150 and greater than or equal to 125 is 1.5;
[0212] The scaling factor corresponding to the PPI threshold range of less than 125 and greater than or equal to 100 is 1.25;
[0213] The scaling factor corresponding to the PPI threshold range being less than 100 and greater than or equal to 0 is 1.
[0214] In another possible design, the first determining module determines the target PPI in the screen of the electronic device, specifically for:
[0215] Obtain the physical resolution and diagonal size of the screen;
[0216] The target PPI is determined based on the physical resolution and the diagonal size.
[0217] In another possible design of the second aspect, the adjustment module adjusts the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor, specifically for:
[0218] Adjust the ratio of the width of the physical resolution to the target scaling factor to the width of the logical resolution;
[0219] Adjust the ratio of the physical resolution height to the target scaling factor to the logical resolution height.
[0220] In another possible design in the second aspect, the first value is 90 and the second value is 120.
[0221] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor, and a memory and a transceiver communicatively connected to the processor;
[0222] The memory stores computer-executed instructions; the transceiver is used for sending and receiving data.
[0223] The processor executes computer execution instructions stored in the memory to implement the screen resolution adjustment method as described in the first aspect and various possible designs above.
[0224] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the screen resolution adjustment method described in the first aspect and various possible designs.
[0225] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the screen resolution adjustment method described in the first aspect and various possible designs above.
[0226] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0227] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0228] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for adjusting screen resolution, characterized in that, Applied to electronic devices, the method includes: Determine the target number of pixels per inch (PPI) in the screen of the electronic device; The target scaling factor of the screen is determined based on the target PPI and the preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively; Based on the physical resolution of the screen and the target scaling factor, the logical resolution of the screen is adjusted so that the dots per inch (DPI) corresponding to the adjusted logical resolution approaches a preset value.
2. The method according to claim 1, characterized in that, The screen includes a built-in screen and / or an external screen; Accordingly, the mapping relationship includes: a first mapping relationship of the built-in screen and / or a second mapping relationship of the external screen. The first mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the built-in screen is closer to a second value than a first value. The second mapping relationship is a scaling factor corresponding to multiple PPI threshold ranges determined when the DPI corresponding to the logical resolution of the external screen is closer to the first value than the second value. Wherein, the first value is less than the second value.
3. The method according to claim 2, characterized in that, The first mapping relationship corresponding to the built-in screen includes: The PPI threshold range is greater than or equal to 290, and the scaling factor corresponding to this range is 2.
5. The scaling factor corresponding to the PPI threshold range of less than 290 and greater than or equal to 230 is 2; The scaling factor corresponding to the PPI threshold range of less than 230 and greater than or equal to 200 is 1.666; The scaling factor corresponding to the PPI threshold range of less than 200 and greater than or equal to 170 is 1.5; The scaling factor corresponding to the PPI threshold range of less than 170 and greater than or equal to 140 is 1.25; The scaling factor corresponding to the PPI threshold range being less than 140 and greater than or equal to 0 is 1.
4. The method according to claim 2, characterized in that, The second mapping relationship corresponding to the external screen includes: The PPI threshold range is greater than or equal to 175, and the scaling factor is 2. The scaling factor corresponding to the PPI threshold range of less than 175 and greater than or equal to 150 is 1.875; The scaling factor corresponding to the PPI threshold range of less than 150 and greater than or equal to 125 is 1.5; The scaling factor corresponding to the PPI threshold range of less than 125 and greater than or equal to 100 is 1.25; The scaling factor corresponding to the PPI threshold range being less than 100 and greater than or equal to 0 is 1.
5. The method according to any one of claims 1-4, characterized in that, Determining the target PPI in the screen of the electronic device includes: Obtain the physical resolution and diagonal size of the screen; The target PPI is determined based on the physical resolution and the diagonal size.
6. The method according to any one of claims 1-4, characterized in that, The step of adjusting the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor includes: Adjust the ratio of the width of the physical resolution to the target scaling factor to the width of the logical resolution; Adjust the ratio of the physical resolution height to the target scaling factor to the logical resolution height.
7. The method according to any one of claims 2-4, characterized in that, The first value is 90, and the second value is 120.
8. A screen resolution adjustment device, characterized in that, The adjustment device is applied to electronic devices and includes: The first determining module is used to determine the number of pixels per inch (PPI) of the target in the screen of the electronic device; The second determining module is used to determine the target scaling factor of the screen based on the target PPI and a preset mapping relationship, wherein the mapping relationship is used to indicate the scaling factor corresponding to multiple PPI threshold ranges respectively; The adjustment module is used to adjust the logical resolution of the screen according to the physical resolution of the screen and the target scaling factor, so that the DPI corresponding to the adjusted logical resolution approaches a preset value.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Application picture display method and device, storage medium and electronic device
CN111258704A
Display method and electronic equipment
CN114115769A