Display adaptation method, apparatus, computer readable storage medium, and electronic device

CN115934230BActive Publication Date: 2026-10-09WANGXU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211581023.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-10-09
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

目前在对应用二次开发时,开发人员往往需要重新对每个应用的页面布局重新进行改写,如此会花费大量的工作量

Benefits of technology

[0009] In the aforementioned display adaptation methods, devices, computer-readable storage media, and electronic devices, the first page with a portrait layout is generated according to a preset layout method. Only the specifications of the first page are adjusted and rotated according to the window controls to adapt the final displayed page to the view window. Therefore, portrait pages can be adapted for display on landscape display devices without changing the layout method within the portrait layout page, effectively solving the problem of landscape devices being unable to properly render portrait layout pages. Thus, there is no need to rewrite each page layout method individually to adapt for display on landscape display devices, greatly improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934230B_ABST
    Figure CN115934230B_ABST
Patent Text Reader

Abstract

The application provides a display adaptation method, a display adaptation device, a computer readable storage medium and an electronic device, and belongs to the technical field of display. The display adaptation method comprises the following steps: generating a first page with a preset vertical screen layout in a visible window according to a preset layout method; creating a window control according to the visible window and embedding the first page in the window control; adjusting the specification of the first page in the window control to obtain a second page; and displaying the window control with the second page after rotation, so that the second page after rotation is adapted to the visible window. The display adaptation method can adapt the vertical screen page to be displayed in a horizontal screen display device without changing the layout method in the vertical screen layout page, thereby effectively solving the problem that the horizontal screen device cannot normally render the page with the vertical screen layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of display technology, and in particular to a display adaptation method, apparatus, computer-readable storage medium, and electronic device. Background Technology

[0002] With the development of mobile internet technology, smart TVs and various customized smart large-screen display devices for different application scenarios are emerging in large numbers. These smart TVs or smart large-screen display devices come pre-installed with various apps to provide corresponding functions and display relevant activity pages. However, because the display window of these devices is fixed, unlike smartphones which allow for free switching between landscape and portrait modes, users installing pages with a portrait layout on a large-screen display device can only see the upper part of the portrait layout page and cannot properly render the entire page, resulting in a poor user experience.

[0003] To ensure that pages with portrait layouts display correctly on the large-screen display device, each application with a portrait layout needs to undergo secondary development. Currently, when performing secondary development on applications, developers often need to rewrite the page layout of each application, which consumes a significant amount of work. Summary of the Invention

[0004] This application provides a display adapter method, apparatus, and electronic device that offer high development efficiency.

[0005] In a first aspect, embodiments of this application provide a display adaptation method applied to a display device, the display device including a view window, the display adaptation method including: generating a first page with a preset vertical screen layout in the view window according to a preset layout method; creating a window control according to the view window and embedding the first page in the window control; adjusting the size of the first page in the window control to obtain a second page; rotating and displaying the window control with the second page, so that the rotated second page is adapted to the view window.

[0006] Secondly, embodiments of this application provide a display adaptation device applied to a display device, the display device including a view window. The display adaptation device includes a generation unit, a creation unit, an adjustment unit, and a rotation unit. A first page with a preset vertical screen layout is generated in the view window according to a preset layout method. The creation unit is used to create a window control based on the view window and embed the first page in the window control. The adjustment unit adjusts the specifications of the first page in the window control to obtain a second page. The rotation unit is used to rotate the window control containing the second page and display it, so that the rotated second page adapts to the view window.

[0007] Thirdly, embodiments of this application provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, which is executed by a processor to implement the above-described display adaptation method.

[0008] Fourthly, embodiments of this application provide an electronic device for implementing adaptive display, the electronic device including a memory and a processor. The memory stores computer program instructions. The processor executes the computer program instructions to implement the aforementioned display adaptation method.

[0009] In the aforementioned display adaptation methods, devices, computer-readable storage media, and electronic devices, the first page with a portrait layout is generated according to a preset layout method. Only the specifications of the first page are adjusted and rotated according to the window controls to adapt the final displayed page to the view window. Therefore, portrait pages can be adapted for display on landscape display devices without changing the layout method within the portrait layout page, effectively solving the problem of landscape devices being unable to properly render portrait layout pages. Thus, there is no need to rewrite each page layout method individually to adapt for display on landscape display devices, greatly improving development efficiency. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating the display adaptation method provided in this application embodiment.

[0012] Figure 2 This is a schematic diagram of a visual window provided in an embodiment of this application.

[0013] Figure 3 This is a schematic diagram of the first page provided for an embodiment of this application.

[0014] Figure 4 This is a schematic diagram of the window control provided in an embodiment of this application.

[0015] Figure 5 This is a schematic diagram illustrating the display adaptation process provided in an embodiment of this application.

[0016] Figure 6 This is a functional block diagram of the display adapter provided in the embodiments of this application.

[0017] Figure 7This is a schematic diagram illustrating the effect of page adaptation display provided in the embodiments of this application.

[0018] Figure 8 This is a schematic diagram of an electronic device for implementing adaptive display provided in an embodiment of this application.

[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0021] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar planned objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data are interchangeable where appropriate; in other words, the described embodiments are implemented according to a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, may also include other content; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0022] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0023] The method provided in this application allows portrait-oriented pages to be adapted for landscape display devices without changing the layout methods in the portrait layout, effectively solving the problem of landscape devices failing to render portrait-oriented pages correctly. Therefore, it eliminates the need to rewrite each page layout method to adapt for landscape display devices, greatly improving development efficiency.

[0024] Please refer to Figure 1 This is a flowchart of the display adaptation method provided in the embodiments of this application. The display adaptation method specifically includes the following steps.

[0025] Step S102: Generate a first page with a preset vertical screen layout in the visual window according to the preset layout method.

[0026] In this embodiment, the display device of the electronic device is configured with a viewing window of a first specification for displaying content. The viewing window is configured in the display device before step S102 is executed. The first specification includes a first height and a first width of the viewing window. If the value of the first height is less than the value of the first width, the viewing window is a landscape window. The display device is a landscape display device.

[0027] Figure 2 This is a schematic diagram of a visual window provided in an embodiment of this application. For example... Figure 2 As shown, a view window V is configured in a display device. The first height of the view window is H1; the first width of the view window is W1, and the value of the first height H1 is less than the value of the first width W1. It should be noted that in this embodiment, the specifications of the view window, i.e., the first specifications, are obtained by calling a preset control measurement method, such as the onMeasure method.

[0028] In this embodiment, the preset layout method is a method for making the page a portrait layout. Further, the preset layout method is used to plan the element size, page size, and position of all elements on the page according to portrait display. Accordingly, since the first page uses the preset layout method, the overall layout of the first page is a portrait layout.

[0029] In this embodiment, the first page has a second specification. The second specification includes a second height and a second width of the first page. Since the first page is in portrait orientation, the value of the second height is greater than the value of the second width. The second height and the second width are set according to the initial values ​​of a preset layout method. In this embodiment, the initial value is the ratio of the second height to the second width. The preset layout method obtains the second specification of the first page based on the value of the second width of the viewport and the ratio value.

[0030] Figure 3 This is a schematic diagram of the first page provided in an embodiment of this application. Figure 3Taking the first page as an example, the second height of the first page P1 is H2, and the second width is W2. The second height H2 and the second width W2 are set according to the initial values ​​of the preset layout method. The initial value of the preset layout method is 16:9 for the second height and the second width. If the value of the first width W1 is used as the height value in the preset layout method, that is, if the value of the second width W2 of the first page is used, then the value of the second height H2 of the first page is W1*9 / 16.

[0031] Step S104: Create a window control based on the visual window and embed the first page into the window control.

[0032] In step S104, the window control is a control defined outside the preset layout method and set as a visual graphical control in the view window. In this embodiment, the first page is embedded in the window control, so that the first page can be adjusted to fit the view window by operating the window control. Specifically, since the preset layout method is a portrait layout, in order to ensure that the generated first page can be fully displayed in the window control, it must be ensured that the minimum side of the window control is not less than the longest side of the first page. Since the longest side of the first page is related to the size of the view window, the size of the window control is preset to be related to the size of the view window.

[0033] In this embodiment, the longest side of the first page is equal to the first width. Therefore, the shortest side of the view control must be greater than or equal to the first width. The specifications of the view control are pre-set to be related to the first width of the visible window, which is the larger of the first height and the first width of the visible window.

[0034] In this embodiment, the value of the first width is used as the value of the minimum side of the window control. In some feasible embodiments, the minimum side of the window control may also be greater than the value of the first width.

[0035] In the specific implementation, the viewport control is configured as a square, and the side length of the square is equal to the first width. That is, the height of the viewport control is greater than the height of the viewport window, meaning that only a portion of the viewport control is displayed within the viewport window. In this embodiment, the top edge of the viewport control is aligned with the top edge of the viewport window, meaning the upper part of the viewport control is displayed within the viewport window. Of course, it is understandable that the lower part of the viewport control could also be displayed within the viewport window.

[0036] Since configuring the view control as a square makes it easier to implement the adaptation method, the specific details will be described below. That is, preferably, step S104 specifically includes: creating the view control based on the first width, wherein the view control is a square, and the side length of the square is the same as the first width.

[0037] Please refer to the following: Figure 4 , Figure 4 This is a schematic diagram of a window control. Figure 4 In the diagram, the view control C is square, and the side length of the view control is W1, which is equal to the first width. In other words, the first page P1 can be completely embedded within the view control.

[0038] Specifically, the window control also needs to be pre-configured with the position to be embedded in the first page. The first page can be set at any position in the window control. In this embodiment, embedding the first page at the far right of the window control facilitates the implementation of the display adaptation method, the details of which will be described below. That is, preferably, step S104 further includes: embedding the first page into the window control and making the right edge of the first page coincide with the right edge of the window control.

[0039] Please refer to the following: Figure 5 , Figure 5 This shows a schematic diagram of an embedded window control on the first page. Figure 5 In the first page P1, a window control C is embedded, and the right edge R1 of the first page P1 coincides with the right edge R2 of the window control C.

[0040] Step S106: Adjust the size of the first page in the visual window to obtain the second page.

[0041] Since the default layout is a portrait orientation, the values ​​of the second width and second height of the first page are not the same as the values ​​of the first width and first height in the viewport. To ensure the first page can be displayed appropriately within the viewport, the side lengths of the first page must first be numerically matched with the side lengths of the viewport. Therefore, the specifications of the first page need to be adjusted to obtain the second page; that is, the specifications of the second page need to be matched one-to-one with the values ​​of the first width and first height in the viewport. In this embodiment, the second page has a third specification. The third specification includes a third height and a third width, wherein the value of the third height is the same as the value of the first width, and the value of the third width is the same as the value of the first height. In other words, adjusting the specifications of the first page involves configuring the second height and second width of the first page with the first width and first height of the viewport, i.e., assigning the first width and first height of the viewport to the second height and second width of the first page, respectively, thus obtaining the second page, where the third height of the second page is the first width of the viewport, and the third width of the second page is the first height of the viewport. In other words, at this point, the second page is within the viewport control, and the width of the second page is adapted to the height of the viewport, while the height of the second page is adapted to the width of the viewport. Further, it can be understood that the second page and the viewport are set at a 90-degree angle. Specifically, step S106 preferably includes: assigning the first width and first height of the viewport to the second height and second width of the first page, respectively, thereby obtaining the second page.

[0042] Please refer to it again. Figure 5 , Figure 5 The diagram also illustrates the changing positional relationships of the second page, the view control, and the visible window. Taking the example of the first page P1 embedding the view control C, with the right edge R1 of the first page P1 coinciding with the right edge R2 of the view control C, as an example... Figure 5 In the context of the diagram, when the first page P1 is adjusted to become the second page, the third height of the second page P2 is W1, which is equal to the first width of the viewport V; the third width of the second page P2 is H1, which is equal to the first height of the viewport V. The second page P2 is positioned at a 90-degree angle to the viewport V, and the right edge R3 of the second page P2 still coincides with the right edge R2 of the viewport control C.

[0043] Understandably, since the viewport control uses the larger of the first height and first width of the visible window as its side length, when the first page is adjusted to the second page, the entire content of the second page can still be displayed. This makes it easier to adjust the size of the first page without having to consider the size of the viewport control.

[0044] Step S108: Rotate the window control containing the second page and display it so that the rotated second page is adapted to the visual window.

[0045] Since this embodiment does not change the preset layout method, the height and width of the first page are adjusted according to a preset ratio during the size adjustment. In other words, the ratio of the width to the height of the first page remains unchanged, thus ensuring that the shape of the second page matches the shape of the viewport, but its orientation is set at 90 degrees. Therefore, the second page needs to be rotated to fit the layout.

[0046] In step S108, in order to adapt the second page to the view window, the page containing the second page needs to be rotated, and the rotation needs to be a multiple of 90 degrees.

[0047] In this embodiment, since the viewport is square, rotating the viewport control by 90 degrees with the center of the viewport control as the rotation center will change the second page by exactly 90 degrees, thus adapting it to the viewport. Therefore, a square viewport makes it easier to adjust the angle of the second page to fit the viewport.

[0048] Furthermore, since the right edge of the second page coincides with the right edge of the viewport control, the second page, after being rotated 90 degrees, will be located above the viewport control and can therefore be directly displayed in the viewport. In other words, since the right edge of the second page coincides with the right edge of the viewport control, it only needs to be rotated 90 degrees to be displayed in the viewport, without needing to consider whether the second page is aligned with the viewport after rotation.

[0049] Please refer to it again. Figure 5 ,exist Figure 5 In the process of rotating and displaying the window control C with the second page P2, the window control C with the second page P2 is rotated 90 degrees with the center of the window control C as the rotation center and then displayed in the visible window V.

[0050] In the above embodiments, since the upper part of the visible window corresponds to the window control, aligning the first page with the right edge of the window control simplifies the problem of adjusting the position of the first page and the visible window.

[0051] Furthermore, it can be understood that the position between the view control and the visible window can also be adjusted. As mentioned above, it can be adjusted so that the lower part of the view control corresponds to the visible window. Accordingly, the first page can be aligned with the left edge of the view control. Similarly, rotating the view control with the second page 90 degrees to the left with the center of the view control as the rotation center can also quickly adjust the second page to fit the visible window.

[0052] It is further understood that setting the viewport to a square is just one example and should not be considered a limitation. The viewport can also be rectangular, as long as the smallest side of the viewport is not less than the longest side of the first page.

[0053] In practical implementation, the display adaptation method is associated with a preset layout method. Therefore, when the preset layout method is called, the display adaptation method is also called, thus adapting the first page generated according to the preset layout method to the visual window. In other words, the display adaptation method provided in this application can adapt a portrait-oriented page for display on a landscape-oriented display device without changing the layout method in the portrait layout page, effectively solving the problem of landscape devices being unable to properly render portrait-oriented layout pages. Furthermore, when a page using a portrait layout is displayed on a landscape-oriented device, the adaptation display method provided in this application only needs to be treated as a control and associated with the portrait layout method to adapt it for display on a landscape-oriented display device, without needing to rewrite the layout method of each page individually for landscape display, thereby greatly improving development efficiency.

[0054] Please refer to Figure 6 This is a functional module diagram of the display adapter device provided in the embodiments of this application. The display adapter device 100 includes a generation unit 10, a creation unit 20, an adjustment unit 30, and a rotation unit 40.

[0055] The generation unit 10 is used to generate a first page with a preset vertical screen layout in the visual window according to a preset layout method.

[0056] In this embodiment, the display device is configured with a view window of a first specification for displaying content. The view window has already been configured in the display device before step S102 is executed. The first specification includes a first height and a first width of the view window. If the first height is less than the first width, the view window is a horizontal view window.

[0057] Figure 2 This is a schematic diagram of a visual window provided in an embodiment of this application. For example... Figure 2As shown, a view window V is configured in a display device. The first height of the view window is H1; the first width of the view window is W1, and the value of the first height H1 is less than the value of the first width W1. It should be noted that in this embodiment, the specifications of the view window, i.e., the first specifications, are obtained by calling a preset control measurement method, such as the onMeasure method.

[0058] In this embodiment, the preset layout method is a method for making the page a portrait layout. Further, the preset layout method is used to plan the element size, page size, and position of all elements on the page according to portrait display. Accordingly, since the first page uses the preset layout method, the overall layout of the first page is a portrait layout.

[0059] In this embodiment, the first page has a second specification. The second specification includes a second height and a second width of the first page. Since the first page is in portrait orientation, the value of the second height is greater than the value of the second width. The second height and the second width are set according to the initial values ​​of a preset layout method. In this embodiment, the initial value is the ratio of the second height to the second width. The preset layout method obtains the second specification of the first page based on the value of the second width of the viewport and the ratio value.

[0060] Figure 3 This is a schematic diagram of the first page provided in an embodiment of this application. Figure 3 Taking the first page as an example, the second height of the first page P1 is H2, and the second width is W2. The second height H2 and the second width W2 are set according to the initial values ​​of the preset layout method. The initial value of the preset layout method is 16:9 for the second height and the second width. If the value of the first width W1 is used as the height value in the preset layout method, that is, if the value of the second width W2 of the first page is used, then the value of the second height H2 of the first page is W1*9 / 16.

[0061] The creation unit 20 is used to create a window control based on the visual window and embed the first page into the window control.

[0062] In this embodiment, the window control is a control defined outside of the preset layout method and set as a visual graphical control within the view window. In this embodiment, the first page is embedded within the window control, allowing the first page to be adjusted to fit the view window through operations on the window control. Specifically, since the preset layout method is a portrait layout, to ensure the generated first page is fully displayed within the window control, the minimum side of the window control must not be less than the longest side of the first page. Because the longest side of the first page is related to the view window's dimensions, the window control's dimensions are pre-set to be related to the view window's dimensions.

[0063] In this embodiment, the longest side of the first page is equal to the first width. Therefore, the shortest side of the view control must be greater than or equal to the first width. The specifications of the view control are pre-set to be related to the first width of the visible window, which is the larger of the first height and the first width of the visible window.

[0064] In this embodiment, the value of the first width is used as the value of the minimum side of the window control. In some feasible embodiments, the minimum side of the window control may also be greater than the value of the first width.

[0065] In the specific implementation, the viewport control is configured as a square, and the side length of the square is equal to the first width. That is, the height of the viewport control is greater than the height of the viewport window, meaning that only a portion of the viewport control is displayed within the viewport window. In this embodiment, the top edge of the viewport control is aligned with the top edge of the viewport window, meaning the upper part of the viewport control is displayed within the viewport window. Of course, it is understandable that the lower part of the viewport control could also be displayed within the viewport window.

[0066] Since configuring the view control as a square facilitates the implementation of the adaptation method, the details will be described below. Specifically, preferably, the creation unit 20 creates the view control based on the first width, and the view control is a square, with the side length of the square being the same as the first width.

[0067] Please refer to the following: Figure 4 , Figure 4 This is a schematic diagram of a window control. Figure 4 In the diagram, the view control C is square, and the side length of the view control is W1, which is equal to the first width. In other words, the first page P1 can be completely embedded within the view control.

[0068] Specifically, the window control also needs to be pre-configured with the position to be embedded in the first page. The first page can be set at any position in the window control. In this embodiment, embedding the first page at the far right of the window control facilitates the implementation of the display adaptation method, which will be described in detail below. That is, preferably, the creation unit 20 also embeds the first page into the window control and makes the right edge of the first page coincide with the right edge of the window control.

[0069] Please refer to the following: Figure 5 , Figure 5 This shows a schematic diagram of an embedded window control on the first page. Figure 5 In the first page P1, a window control C is embedded, and the right edge R1 of the first page P1 coincides with the right edge R2 of the window control C.

[0070] The adjustment unit 30 is used to adjust the specifications of the first page in the window control to obtain the second page.

[0071] Since the default layout is a portrait orientation, the values ​​of the second width and second height of the first page are not the same as the values ​​of the first width and first height in the viewport. To ensure the first page can be displayed appropriately within the viewport, the side lengths of the first page must first be numerically matched with the side lengths of the viewport. Therefore, the specifications of the first page need to be adjusted to obtain the second page; that is, the specifications of the second page need to be matched one-to-one with the values ​​of the first width and first height in the viewport. In this embodiment, the second page has a third specification. The third specification includes a third height and a third width, wherein the value of the third height is the same as the value of the first width, and the value of the third width is the same as the value of the first height. In other words, adjusting the specifications of the first page involves configuring the second height and second width of the first page with the first width and first height of the viewport, i.e., assigning the first width and first height of the viewport to the second height and second width of the first page, respectively, thus obtaining the second page, where the third height of the second page is the first width of the viewport, and the third width of the second page is the first height of the viewport. In other words, at this time, the second page is in the viewport control, and the width of the second page is adapted to the height of the viewport, while the height of the second page is adapted to the width of the viewport. Further, it can be understood that the second page and the viewport are set at a 90-degree angle. Specifically, preferably, the adjustment unit 30 assigns the first width and first height of the viewport to the second height and second width of the first page, respectively, thereby obtaining the second page.

[0072] Please refer to it again. Figure 5 , Figure 5 The diagram also illustrates the changing positional relationships of the second page, the view control, and the visible window. Taking the example of the first page P1 embedding the view control C, with the right edge R1 of the first page P1 coinciding with the right edge R2 of the view control C, as an example... Figure 5 In the context of the diagram, when the first page P1 is adjusted to become the second page, the third height of the second page P2 is W1, which is equal to the first width of the viewport V; the third width of the second page P2 is H1, which is equal to the first height of the viewport V. The second page P2 is positioned at a 90-degree angle to the viewport V, and the right edge R3 of the second page P2 still coincides with the right edge R2 of the viewport control C.

[0073] Understandably, since the viewport control uses the larger of the first height and first width of the visible window as its side length, when the first page is adjusted to the second page, the entire content of the second page can still be displayed. This makes it easier to adjust the size of the first page without having to consider the size of the viewport control.

[0074] The rotation unit 41 is used to rotate the window control with the second page and display it, so that the rotated second page is adapted to the visual window.

[0075] Since this embodiment does not change the preset layout method, the height and width of the first page are adjusted according to a preset ratio during the size adjustment. In other words, the ratio of the width to the height of the first page remains unchanged, thus ensuring that the shape of the second page matches the shape of the viewport, but its orientation is set at 90 degrees. Therefore, the second page needs to be rotated to fit the layout.

[0076] In addition, in this embodiment, in order to make the second page fit the view window, it is necessary to rotate the page containing the second page, and the rotation needs to be a multiple of 90 degrees.

[0077] In this embodiment, since the viewport is square, rotating the viewport control by 90 degrees with the center of the viewport control as the rotation center will change the second page by exactly 90 degrees, thus adapting it to the viewport. Therefore, a square viewport makes it easier to adjust the angle of the second page to fit the viewport.

[0078] Furthermore, since the right edge of the second page coincides with the right edge of the viewport control, the second page, after being rotated 90 degrees, will be located above the viewport control and can therefore be directly displayed in the viewport. In other words, since the right edge of the second page coincides with the right edge of the viewport control, it only needs to be rotated 90 degrees to be displayed in the viewport, without needing to consider whether the second page is aligned with the viewport after rotation.

[0079] Understandably, preferably, the rotation unit 41 rotates the window control carrying the second page by 90 degrees with the center of the window control as the rotation center. 0 Displayed later.

[0080] Please refer to Figure 7 , Figure 7 The diagram shows the effect obtained after using the adaptive display device provided in this application. Figure 7 In the middle, the horizontal display device D has a viewing window V1. The content of page P3 is still in a vertical layout, and the size of page P3 is adapted to the size of the viewing window V, so that page P3 is adapted to be displayed in the electronic device 90.

[0081] In the above embodiments, since the upper part of the visible window corresponds to the window control, aligning the first page with the right edge of the window control simplifies the problem of adjusting the position of the first page and the visible window.

[0082] Furthermore, it can be understood that the position between the view control and the visible window can also be adjusted. As mentioned above, it can be adjusted so that the lower part of the view control corresponds to the visible window. Accordingly, the first page can be aligned with the left edge of the view control. Similarly, rotating the view control with the second page 90 degrees to the left with the center of the view control as the rotation center can also quickly adjust the second page to fit the visible window.

[0083] It is further understood that setting the viewport to a square is just one example and should not be considered a limitation. The viewport can also be rectangular, as long as the smallest side of the viewport is not less than the longest side of the first page.

[0084] Please refer to Figure 8 This is a schematic diagram of an electronic device 90 for implementing adaptive display according to an embodiment of this application. The electronic device 90 includes a memory 901 and a processor 902. The processor 902 is used to run the display adaptation program in the memory 901 to implement the above-described adaptive display method.

[0085] The memory 901 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 901 can be an internal storage unit of a computer device, such as a hard disk. In other embodiments, the memory 901 can be an external storage device of a computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., configured in the computer device. Furthermore, the memory 901 can include both internal and external storage units of the computer device. The memory 901 can be used not only to store application software and various types of data installed on the computer device, such as code for display adaptation, but also to temporarily store data that has been output or will be output.

[0086] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

[0087] The above-listed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A display adaptation method, applied to a display device, characterized in that, The display device includes a view window, and the method includes: According to a preset layout method, a first page with a preset vertical screen layout is generated in the visual window. The visual window has a first specification, which includes a first height and a first width. The value of the first height is less than the value of the first width. The first page has a second specification, which includes a second height and a second width. A window control is created based on the visual window and the first page is embedded in the window control, wherein the minimum side of the window control cannot be less than the longest side of the first page; Adjusting the specifications of the first page in the window control yields a second page, wherein the second page has a third specification, the third specification including a third height and a third width, the value of the third height being the same as the value of the first width, and the value of the third width being the same as the value of the first height. The window control containing the second page is rotated and displayed so that the rotated second page fits the visual window.

2. The display adaptation method as described in claim 1, characterized in that, According to the preset layout method, before generating a first page with a preset portrait layout in the visual window, the display adaptation method further includes: The visual window is configured in the display device, the visual window having a first specification for displaying content.

3. The display adaptation method as described in claim 2, characterized in that, Creating window controls based on the aforementioned visual window includes: The view control is created based on the first width. The view control is a square, and the side length of the square is the same as the first width.

4. The display adaptation method as described in claim 3, characterized in that, Embedding the first page in the window control includes: embedding the first page in the window control such that the right edge of the first page coincides with the right edge of the window control.

5. The display adaptation method as described in claim 4, characterized in that, The window controls containing the second page are rotated and displayed, including: Rotate the window control containing the second page by 90 degrees, using the center of the window control as the rotation center. 0 Displayed later.

6. A display adapter, applied to a display device, the display device including a viewing window, characterized in that, The display adapter includes: The generation unit is used to generate a first page with a preset vertical screen layout in the visual window according to a preset layout method. The visual window has a first specification, which includes a first height and a first width of the visual window. The value of the first height is less than the value of the first width. The first page has a second specification, which includes a second height and a second width. A creation unit is used to create a window control based on the visual window and embed the first page in the window control, wherein the minimum side of the window control cannot be less than the longest side of the first page; An adjustment unit is configured to adjust the specifications of the first page in the view control to obtain a second page, wherein the second page has a third specification, the third specification including a third height and a third width, the value of the third height being the same as the value of the first width, and the value of the third width being the same as the value of the first height; and A rotation unit is used to rotate the window control containing the second page for display, so that the rotated second page is adapted to the visual window.

7. The display adapter as described in claim 6, characterized in that, The view control is square, and the side length of the square is the same as the first width.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that is executed by a processor to implement the display adaptation method as described in any one of claims 1-5.

9. An electronic device for implementing adaptive display, characterized in that, The electronic device includes: Memory is used to store computer program instructions; A processor for executing the computer program instructions to implement the display adaptation method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for displaying page on terminal and terminal

    CN106814989A

  • Method and device for adapting horizontal screen display terminal to vertical screen application program and terminal

    CN110244996A