Image display method, device, computer device and computer-readable storage medium
By detecting terminal displacement information in real time and scaling the image according to preset conditions, it solves the problem that users find it difficult to accurately view image details, and improves the accuracy and interactive experience of image display.
Patent Information
- Application Number
- CN202010135347.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-02
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2040-03-02
AI Technical Summary
When viewing images in the terminal, it is difficult for users to accurately view the details of the content. They need to operate their fingers or slide the screen to enlarge or reduce the image, resulting in less accurate display.
By detecting the displacement information of the terminal in real time, when the displacement information that meets the preset scaling conditions is detected, the target image is scaled according to the corresponding scaling ratio, and the scaled image is displayed in the screen display area of the terminal.
It improves the accuracy of image display, enables users to accurately view different areas of the image through mobile terminals, and enhances the interactive experience.
Smart Images

Figure CN113342237B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to an image display method, apparatus, computer device, and computer-readable storage medium. Background Art
[0002] With the development of communication technologies, when viewing images in a terminal, a user can zoom in or out of the images according to their needs.
[0003] In the process of researching and practicing related technologies, the inventors of this application found that when a current user views an image in a terminal, if they want to see the details of the content clearly, they often need to zoom in or out of the image on the terminal screen by fingers or the like, or slide the terminal screen to view different regions of the image, and the accuracy of image display is low. Summary of the Invention
[0004] Embodiments of this application provide an image display method, apparatus, computer device, and computer-readable storage medium, which can improve the accuracy of image display.
[0005] Embodiments of this application provide an image display method, including:
[0006] Display a target image in a screen display area of a terminal;
[0007] Real-time detect displacement information of the terminal;
[0008] When it is detected that first displacement information meets a preset zooming condition, zoom the target image according to a target zooming ratio corresponding to the first displacement information to obtain a zoomed image;
[0009] Based on the screen display area of the terminal, display the zoomed image.
[0010] Correspondingly, embodiments of this application provide an image display apparatus, including:
[0011] A first display unit, configured to display a target image in a screen display area of a terminal;
[0012] A detection unit, configured to real-time detect displacement information of the terminal;
[0013] A first zooming unit, configured to when it is detected that first displacement information meets a preset zooming condition, zoom the target image according to a target zooming ratio corresponding to the first displacement information to obtain a zoomed image;
[0014] A second display unit, configured to based on the screen display area of the terminal, display the zoomed image.
[0015] In one embodiment, the first display unit includes:
[0016] A first acquisition subunit, configured to respectively acquire the original side length of the image and the size of the screen display area;
[0017] An alteration subunit, configured to alter the side length of the image based on the original side length and the size of the screen display area to obtain an altered image;
[0018] A scaling subunit, configured to scale the altered image according to a preset scaling ratio to obtain a target image;
[0019] A first display subunit, configured to display the target image in the screen display area of the terminal.
[0020] In one embodiment, the image display device further includes:
[0021] A determination unit, configured to determine that the first displacement information meets a preset scaling condition when the first displacement direction is a preset scaling direction and the first displacement distance meets a preset distance condition.
[0022] In one embodiment, the determination unit includes:
[0023] A first determination subunit, configured to determine that the first displacement information meets a preset scaling condition when the first displacement direction is a preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within the target scaling boundary range corresponding to the target image.
[0024] In one embodiment, the first determination subunit further includes:
[0025] A second acquisition subunit, configured to acquire the size of the screen display area;
[0026] A first calculation subunit, configured to calculate the target scaling boundary range of the target image based on the screen size and the side length of the target image.
[0027] In one embodiment, the first calculation subunit is further configured to acquire the initial scaling boundary range of the target image; when the side length is greater than the screen size, calculate the first scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; and determine the target scaling boundary range of the target image according to the first scaling boundary range.
[0028] In one embodiment, the first calculation subunit is further configured to when the side length is less than the size, calculate the second scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; and determine the target scaling boundary range of the target image based on the second scaling boundary range.
[0029] In one embodiment, the image display device further includes:
[0030] An acquisition unit, configured to acquire the scaled displacement of the terminal after scaling the image;
[0031] A calculation unit, configured to calculate the scaled boundary range of the scaled image based on the scaled displacement, the target scaling ratio, and the target scaling boundary range;
[0032] A second scaling unit, configured to perform secondary scaling on the scaled image based on the scaled boundary range.
[0033] In one embodiment, the image display device further includes:
[0034] A third display unit, configured to, when the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets the preset moving display condition, perform a moving display on the scaled image according to the target displacement ratio corresponding to the second displacement information.
[0035] In one embodiment, the third display unit includes:
[0036] A second determination subunit, configured to determine that the second displacement information meets the preset moving display condition when the second displacement direction is a preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within the displacement boundary value range corresponding to the scaled image;
[0037] A second display subunit, configured to perform a moving display on the scaled image according to the target displacement ratio when the second displacement information meets the preset moving display condition.
[0038] In one embodiment, the second display subunit is further configured to, when the second displacement information meets the preset moving display condition, calculate the actual image displacement of the scaled image based on the second displacement information and the target displacement ratio; and perform a moving display on the scaled image based on the actual image displacement.
[0039] In one embodiment, the second display subunit is further configured to, based on the actual image displacement, acquire the pixel displacement value of the scaled image; change the pixel displacement value according to the target displacement ratio and the second displacement information to obtain a changed pixel displacement value; and perform a moving display on the scaled image based on the changed pixel displacement value.
[0040] In one embodiment, the third display unit further includes:
[0041] The first obtaining subunit is configured to calculate displacement ratio information between the terminal and the scaled image according to the side length information of the scaled image and preset terminal displacement information of the terminal, so as to obtain a target displacement ratio corresponding to the second displacement information;
[0042] The third obtaining subunit is configured to obtain terminal displacement information of the terminal after scaling the target image by the terminal;
[0043] The second calculating subunit is configured to calculate actual displacement information of the terminal currently based on the terminal displacement information and the second displacement information;
[0044] The third calculating subunit is configured to calculate a displacement boundary value range of the terminal displacement based on the target displacement ratio and the actual displacement information.
[0045] In an embodiment, the third calculating subunit is further configured to fuse the target displacement ratio and the actual displacement information to obtain actual image displacement information of the scaled image; fuse the image displacement information and the side length information to obtain an image displacement boundary value range of the scaled image; calculate a displacement boundary value range of the terminal based on the image displacement boundary value and the target displacement ratio.
[0046] Correspondingly, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the steps in the image display method provided in any embodiment of the present application.
[0047] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium. The storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the image display method provided in any embodiment of the present application.
[0048] An embodiment of the present application can display a target image in a screen display area of a terminal; detect displacement information of the terminal in real time; when it is detected that first displacement information meets a preset scaling condition, scale the target image according to a target scaling ratio corresponding to the first displacement information to obtain a scaled image; display the scaled image based on the screen display area of the terminal. This solution can improve the accuracy of image display by detecting the displacement information of the terminal in real time, scaling the image in the terminal according to the moving scaling ratio, and then displaying the scaled image in the terminal. Description of the Drawings
[0049] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0050] Figure 1 It is a schematic diagram of the scenario of the image display method provided by the embodiments of the present application;
[0051] Figure 2 It is a flowchart of the image display method provided by the embodiments of the present application;
[0052] Figure 3 It is the whole of the image display method provided by the embodiments of the present application;
[0053] Figure 4 It is the scaling boundary value process of the image display method provided by the embodiments of the present application;
[0054] Figure 5 It is the total displacement logic flowchart of the image display method provided by the embodiments of the present application;
[0055] Figure 6 It is a schematic diagram of the structure of the blockchain system provided by the embodiments of the present application;
[0056] Figure 7 It is another flowchart of the image display method provided by the embodiments of the present application;
[0057] Figure 8 It is another schematic diagram of the scenario of the image display method provided by the embodiments of the present application;
[0058] Figure 9 It is a schematic diagram of the terminal displacement direction of the image display method provided by the embodiments of the present application;
[0059] Figure 10 It is a device diagram of the image display method provided by the embodiments of the present application;
[0060] Figure 11 It is a schematic diagram of the structure of the computer device provided by the embodiments of the present application. Specific embodiments
[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0062] The embodiments of the present application provide an image display method, apparatus, computer device, and computer-readable storage medium. Specifically, the embodiments of the present application provide an image display apparatus applicable to a computer device. Among them, the computer device can be a device such as a terminal or a server, and the terminal can be a device such as a mobile phone, a tablet computer, or a laptop computer. The server can be a single server or a server cluster composed of multiple servers.
[0063] Referring to Figure 1 , taking the computer device as a terminal as an example, a target image can be displayed in the screen display area of the terminal; the displacement information of the terminal is detected in real time; when it is detected that the first displacement information meets the preset scaling condition, the target image is scaled according to the target scaling ratio corresponding to the first displacement information to obtain a scaled image; based on the screen display area of the terminal, the scaled image is displayed.
[0064] As can be seen from the above, in this embodiment, the displacement information of the terminal can be detected in real time, the image displayed in the terminal can be scaled according to the moving scaling ratio, and then the scaled image can be displayed in the terminal, improving the accuracy of image display.
[0065] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0066] The embodiments of the present application provide an image display method. This method can be executed by a terminal or a server, or jointly executed by a terminal and a server. In the embodiments of the present application, an example is given where the image display method is executed by a terminal. Specifically, it is executed by an image display apparatus integrated in the terminal. As Figure 2 shown, the specific process of this image display method can be as follows:
[0067] 101. Display a target image in the screen display area of the terminal.
[0068] Among them, the target image is the image currently displayed in the terminal. The target image can be an original image that initializes the image display screen to be displayed 100% according to the size of the screen display area of the terminal, an image obtained after image scaling. For example, the original image is enlarged according to a preset target enlargement condition to obtain the target image, or after the original image is enlarged according to a preset target enlargement condition, it is then reduced according to a preset target reduction condition to obtain the target image, and so on.
[0069] Among them, the target enlargement condition can be a preset magnification factor of the original image. For example, an image obtained by enlarging the original image to twice its original size is the target image, and so on.
[0070] In one embodiment, the image displayed in the screen display area of the terminal may be an image displayed in full, or an image with a side length greater than the size of the screen display area of the terminal. To obtain the target image, the image may be processed to obtain the target image. The step of "displaying the target image in the screen display area of the terminal" includes:
[0071] Obtain the original side length of the image and the size of the screen display area respectively;
[0072] Based on the original side length and the size of the screen display area, change the side length of the image to obtain a changed image;
[0073] Scale the changed image according to a preset scaling ratio to obtain the target image;
[0074] Display the target image in the screen display area of the terminal.
[0075] For example, as Figure 3 shown, in the scenario where the user enters to view the target image in the terminal, the displacement state of the terminal is detected in real time. When it is detected that the displacement of the terminal changes, that is, when it is detected that the terminal moves up and down, left and right, forward and backward, the display area of the target image is changed according to the changed displacement information.
[0076] 102. Detect the displacement information of the terminal in real time.
[0077] Among them, the displacement information is the information when the terminal is displaced. As the terminal moves, the displacement information changes continuously, so it needs to be detected in real time. The first displacement information can be detected, and other displacement information of the terminal can also be detected, such as the second displacement information, etc. The first displacement information and the second displacement information, etc., are all the displacement information of the terminal detected at different times.
[0078] In one embodiment, the first displacement information includes a first displacement direction and a first displacement distance. After detecting the displacement information of the terminal in real time, in order to scale the target image according to the scaling ratio corresponding to the first displacement information to obtain the target image, it is necessary to determine whether the first displacement information meets the preset scaling conditions, that is, whether the first displacement direction included in the first displacement information meets the preset scaling direction, and whether the first displacement distance included in the first displacement information meets the preset distance conditions. The specific steps are as follows:
[0079] When the first displacement direction is the preset scaling direction and the first displacement distance meets the preset distance condition, it is determined that the first displacement information meets the preset scaling condition.
[0080] In one embodiment, similarly, in order to scale the target image according to the target scaling ratio corresponding to the first displacement information to obtain a scaled image, it is necessary to determine whether the first displacement information meets the preset scaling conditions, that is, whether the first displacement direction included in the first displacement information is the preset scaling direction, and whether the target scaling ratio corresponding to the first displacement distance included in the first displacement information is within the scaling boundary range corresponding to the target image. The specific step of "when the first displacement direction is the preset scaling direction and the first displacement distance meets the preset distance condition, it is determined that the first displacement information meets the preset scaling conditions" includes:
[0081] When the first displacement direction is the preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within the target scaling boundary range corresponding to the target image, it is determined that the first displacement information meets the preset scaling conditions.
[0082] In one embodiment, the calculation steps of the target scaling boundary range can be:
[0083] Obtain the size of the screen display area;
[0084] Based on the screen size and the side length of the target image, calculate the target scaling boundary range of the target image.
[0085] In one embodiment, when the side length of the target image is greater than the size of the screen display area, the detailed calculation steps of the target scaling boundary range of "based on the screen size and the side length of the target image, calculate the target scaling boundary range of the target image" include:
[0086] Obtain the initial scaling boundary range of the target image;
[0087] When the side length is greater than the screen size, calculate the first scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range;
[0088] According to the first scaling boundary range, determine the target scaling boundary range of the target image.
[0089] In one embodiment, when the side length of the target image is less than the size of the screen display area, the detailed calculation steps of the target scaling boundary range of "based on the screen size and the side length of the target image, calculate the target scaling boundary range of the target image" include:
[0090] When the side length is less than the size, calculate the second scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range;
[0091] Determine the target scaling boundary range of the target image based on the second scaling boundary range.
[0092] For example, as Figure 4 shown, the width of the screen display area of the terminal can be read first, and then the image scaling ratio can be initialized. This scaling ratio can be the width of the target image divided by the width of the screen display area. When the width of the target image is greater than the width of the screen display area, the target scaling boundary range of the target image is from 1 to the width of the target image divided by the width of the screen; when the width of the target image is less than the width of the screen, the target scaling boundary range of the target image is from the width of the target image divided by the width of the screen to 1.
[0093] 103. When it is detected that the first displacement information meets the preset scaling condition, scale the target image according to the target scaling ratio corresponding to the first displacement information to obtain the scaled image.
[0094] Among them, the preset scaling condition can be: the first displacement direction included in the first displacement information is the preset scaling direction, and the first displacement distance included in the first displacement information meets the preset distance condition. Obviously, the displacement direction of the terminal can be multiple directions. For example, it can be displaced vertically up and down with respect to the ground, or displaced horizontally left and right and front and back with respect to the ground.
[0095] Among them, the target scaling ratio can be set according to the preset displacement of the terminal and the scaling degree of the target image. Similarly, after knowing the target scaling ratio, when the displacement value of the terminal is obtained, the target image can be scaled according to the displacement value and the target scaling ratio to obtain the scaled image.
[0096] For example, it is preset that the preset displacement of the terminal perpendicular to the ground is 20 cm. At this time, the pixel value that the target image can be scaled is 1000 pixels. When the terminal is displaced 5 cm each time, the pixel value of the target image scaling is 250 pixels. Then the target scaling ratio can be calculated.
[0097] By adopting this solution, when the user views the image in the screen display area of the terminal, if the direction in which the user moves the terminal is the preset scaling direction and the scaling ratio corresponding to the displacement distance of the terminal is within the target scaling boundary range, the image in the terminal is scaled according to the scaling ratio. Among them, the target scaling boundary range is the scaling boundary range corresponding to the image in the screen display area of the terminal. For example, when the user moves the terminal vertically upward with respect to the ground, the image in the screen display area of the terminal is reduced, and the reduced image is displayed in the screen display area of the terminal. The user can view the reduced image in the screen display area of the terminal. When the user moves the terminal vertically downward with respect to the ground, the image in the screen display area of the terminal is enlarged, and the enlarged image is displayed in the screen display area of the terminal. The user can view the enlarged image in the display area of the terminal.
[0098] 104. Based on the screen display area of the terminal, display the scaled image.
[0099] Among them, the scaled image is obtained by scaling the target image, so the entire image of the scaled image may not be fully displayed within the screen display area of the terminal.
[0100] In one embodiment, after scaling the target image, in order to scale the scaled image again later, the scaling boundary range of the scaled image can be recalculated according to the scaled displacement, the target scaling ratio, and the target scaling boundary range. The specific steps include:
[0101] Obtain the scaled displacement of the terminal after scaling the image;
[0102] Based on the scaled displacement, the target scaling ratio, and the target scaling boundary range, calculate the scaling boundary range of the scaled image;
[0103] Based on the scaling boundary range, scale the scaled image again.
[0104] In one embodiment, when the second displacement information of the terminal is detected in real time, in order to display the scaled image by moving it according to the target displacement ratio corresponding to the second displacement information, it is necessary to determine whether the first displacement information meets the preset moving display condition. The specific steps are:
[0105] When the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets the preset moving display condition, display the scaled image by moving it according to the target displacement ratio corresponding to the second displacement information.
[0106] In one embodiment, the second displacement information includes a second displacement direction and a second displacement distance. Similarly, in order to display the scaled image by moving it according to the target displacement ratio corresponding to the second displacement information, it is necessary to determine whether the first displacement information meets the preset moving display condition, that is, whether the second displacement direction included in the second displacement information meets the preset displacement direction, and whether the target displacement ratio corresponding to the second displacement distance included in the second displacement information is within the displacement boundary range corresponding to the scaled image. The specific steps of "when the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets the preset moving display condition, display the scaled image by moving it according to the target displacement ratio corresponding to the second displacement information" include:
[0107] When the second displacement direction is the preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within the displacement boundary value range corresponding to the scaled image, it is determined that the second displacement information meets the preset moving display condition;
[0108] When the second displacement information meets the preset moving display condition, the scaled image is moved and displayed according to the target displacement ratio.
[0109] In one embodiment, in order to move and display the scaled image, the actual image displacement of the scaled image can be calculated first according to the second displacement information and the target displacement ratio, and finally, the scaled image is moved and displayed according to the actual image displacement. The specific step "When the second displacement information meets the preset moving display condition, the scaled image is moved and displayed according to the target displacement ratio" may include:
[0110] When the second displacement information meets the preset moving display condition, based on the second displacement information and the target displacement ratio, calculate the actual image displacement of the scaled image;
[0111] Based on the actual image displacement, move and display the scaled image.
[0112] In one embodiment, the step "Based on the actual image displacement, move and display the scaled image" includes:
[0113] Based on the actual image displacement, obtain the pixel displacement value of the scaled image;
[0114] According to the target displacement ratio and the second displacement information, change the pixel displacement value to obtain the changed pixel displacement value;
[0115] Based on the changed pixel displacement value, move and display the scaled image.
[0116] Among them, the pixel displacement value refers to the image displacement of the scaled image. For example, when the scaled image has an image displacement, it refers to the pixel displacement of the scaled image, rather than the displacement of the terminal. The displacement of the terminal is generally in centimeters, while the displacement of the image is in pixels.
[0117] In one embodiment, the calculation steps for the displacement boundary range of the terminal displacement can be:
[0118] According to the side length information of the scaled image and the preset terminal displacement information of the terminal, calculate the displacement ratio information between the terminal and the scaled image to obtain the target displacement ratio corresponding to the second displacement information;
[0119] Obtain the terminal displacement information of the terminal after scaling the target image;
[0120] Based on the terminal displacement information and the second displacement information, calculate the actual displacement information of the terminal currently;
[0121] Based on the target displacement ratio and the actual displacement information, calculate the displacement boundary value range of the terminal displacement.
[0122] In an embodiment, in order to obtain the displacement boundary value range of the terminal displacement, the target displacement ratio and the actual displacement information of the terminal can be fused to calculate the actual displacement information of the image, and then the image displacement information and the side length information of the scaled image are used to calculate the image displacement boundary value range of the scaled image, so as to finally calculate the displacement boundary value range of the terminal. The step "Based on the target displacement ratio and the actual displacement information, calculate the displacement boundary value range of the terminal displacement" includes:
[0123] Fuse the target displacement ratio and the actual displacement information to obtain the actual image displacement information of the scaled image;
[0124] Fuse the image displacement information and the side length information to obtain the image displacement boundary value range of the scaled image;
[0125] Based on the image displacement boundary value and the target displacement ratio, calculate the displacement boundary value range of the terminal.
[0126] For example, as Figure 5 shown, the displacement information of the terminal can read the acceleration values in each direction of the terminal by calling the displacement sensor in the terminal, so as to calculate the displacement values corresponding to the respective acceleration values. For example, when the terminal is displaced vertically up and down with respect to the ground, calculate the displacement value corresponding to the vertical up and down direction with respect to the ground. When the target scaling ratio is within the target scaling boundary range corresponding to the target image, scale the target image according to the target scaling ratio, such as a scaling factor of 0.1.
[0127] Among them, the scaling boundary range of the scaled image can be calculated by calculating the scaled displacement, the target scaling ratio, and the target scaling boundary range, so as to perform secondary scaling on the scaled image.
[0128] Further, after obtaining the scaled image, when the terminal has displacement in the left, right, front, and back directions with respect to the horizontal ground, the acceleration values in each direction can be read by the displacement sensor in the terminal, so as to calculate the displacement information corresponding to the respective acceleration values, and finally calculate the actual displacement value of the scaled image based on this displacement information to perform a moving display of the scaled image.
[0129] By adopting this solution, when a user views an image in the screen display area of a terminal, when the user moves the terminal vertically upward with respect to the ground, the image in the screen display area of the terminal is reduced, and the reduced image is displayed in the screen display area of the terminal. The user can view the reduced image in the screen display area of the terminal. When the user moves the terminal vertically downward with respect to the ground, the image in the screen display area of the terminal is enlarged, and the enlarged image is displayed in the screen display area of the terminal. The user can view the enlarged image in the display area of the terminal. The user can also move the terminal in the left, right, front, and back directions on the horizontal ground. When the user moves the terminal to the left on the horizontal ground, a partial image in the corresponding direction of the image is displayed in the screen display area of the terminal. When the user moves the terminal to the right on the horizontal ground, a partial image in the corresponding direction of the image is displayed in the screen display area of the terminal. Similarly, when the user moves the terminal upward on the horizontal ground, a partial image in the corresponding direction of the image is displayed in the screen display area of the terminal. When the user moves the terminal downward on the horizontal ground, a partial image in the corresponding direction of the image is displayed in the screen display area of the terminal. The user can view different local positions of the image by moving the terminal and can also view different local positions of the image by repeatedly moving the terminal.
[0130] In one embodiment, the scaled image can be stored in a blockchain to facilitate subsequent extraction and storage of information. For example, Figure 6 As shown, the computer device can be a node in a distributed system. Among them, the distributed system can be a blockchain system. The blockchain system can be a distributed system formed by connecting multiple nodes through network communication. Nodes can form a peer-to-peer (P2P) network. Any form of computer device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network. Among them, the blockchain includes a series of blocks (Blocks) that are sequentially connected in the order of generation. Once a new block is added to the blockchain, it will not be removed again. The block records the record data submitted by the nodes in the blockchain system.
[0131] As can be seen from the above, for the image displayed in the screen display area of the terminal, the initialized image can be enlarged or reduced by moving the terminal vertically up and down with respect to the ground to obtain an enlarged or reduced image. When the width and height of the enlarged image exceed the size of the screen display area of the terminal, the local position of the image can be displayed by displacing the terminal vertically up, down, left, and right on the horizontal ground. This embodiment can improve the accuracy of image display by detecting the displacement information of the terminal in real time, scaling the image in the terminal according to the scaling ratio of the movement, and then displaying the scaled image in the terminal.
[0132] According to the content introduced above, the following will give examples to further illustrate the image display method of the present application.
[0133] Reference Figure 7 , an image display method, the specific process can be as follows:
[0134] 201. Display the target image in the screen display area of the terminal.
[0135] Among them, the target image is not limited to any one state and can include multiple states, such as, for example, picture state, text state, and video state, etc.
[0136] For example, taking the target image as a picture for illustration, as Figure 8 shown, there is an original picture. In the scenario where the user views the original picture through the screen display area of the terminal, initialize the original picture so that it is displayed 100% according to the size of the screen display area of the terminal, with the height being adaptively adjusted.
[0137] Among them, the initialized picture can be enlarged or reduced by moving the terminal vertically up and down in the direction perpendicular to the ground to obtain an enlarged or reduced picture. When the width and height of the enlarged picture exceed the size of the screen display area of the terminal, the terminal can be displaced horizontally left, right, up, and down to display a partial position of the picture.
[0138] Generally speaking, the existing method for viewing the partial position of a picture on a terminal requires a sliding operation on the terminal screen. Compared with the existing method, this solution only requires moving the terminal to display the partial position of the picture on the terminal, which is a more realistic interaction experience method, making the feeling of the terminal user viewing the picture information smoother. And the terminal user can not only apply it in the picture scenario when browsing, but also use this technical solution to view the content in text or video information exchange media.
[0139] 202. The terminal detects the displacement information of the terminal in real time.
[0140] For example, taking the target image as a picture for illustration, as Figure 9 shown, the terminal can move vertically up and down in the direction perpendicular to the ground, or move left, right, forward, and backward on the horizontal ground. When the first displacement direction is the preset zoom direction and the first displacement distance meets the preset distance condition, it is determined that the first displacement information meets the preset zoom condition. That is, when the first displacement direction is the preset zoom direction and the target zoom ratio corresponding to the first displacement distance is within the target zoom boundary range corresponding to the target image, it is determined that the first displacement information meets the preset zoom condition.
[0141] Among them, the calculation of the target scaling boundary range can be achieved by obtaining the size of the screen display area, and then, based on the screen size and the side length of the target image, calculating the target scaling boundary range of the target image.
[0142] Furthermore, there can be two cases for obtaining the target scaling boundary range. One case is that the side length of the target image is greater than the size of the screen display area, and the other case is that the side length of the target image is less than the size of the screen display area. When the side length is greater than the screen size, calculate the first scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range, and then determine the target scaling boundary range of the target image based on the first scaling boundary range. When the side length is less than the size, calculate the second scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range, and then determine the target scaling boundary range of the target image based on the second scaling boundary range.
[0143] 203. When it is detected that the first displacement information meets the preset scaling condition, the terminal scales the target image according to the target scaling ratio corresponding to the first displacement information to obtain a scaled image.
[0144] For example, taking the target image as a picture for illustration, when the first displacement direction included in the first displacement information is the preset scaling direction and the first displacement distance included in the first displacement information meets the preset distance condition, it is determined that the first displacement information meets the preset scaling condition. That is to say, when the first displacement direction is the preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within the target scaling boundary range of the target image, it is determined that the first displacement information meets the preset scaling condition. At this time, the terminal can scale the image according to the target scaling ratio corresponding to the first information to obtain a scaled image.
[0145] Among them, the scaled displacement of the terminal after scaling the image can also be obtained, and then based on the scaled displacement, the target scaling ratio, and the target scaling boundary range, calculate the scaling boundary range of the scaled image. Finally, based on the scaling boundary range, perform secondary scaling on the scaled image.
[0146] By adopting this solution, when a user views an image in the screen display area of a terminal, if the direction in which the user moves the terminal is the preset zoom direction and the distance of the terminal displacement is within the zoom boundary of the image, the image in the terminal is reduced or enlarged according to the zoom ratio. For example, when the user moves the terminal vertically upward from the ground, the image in the screen display area of the terminal is reduced, and the reduced image is displayed in the screen display area of the terminal. The user can view the reduced image in the screen display area of the terminal. When the user moves the terminal vertically downward from the ground, the image in the screen display area of the terminal is enlarged, and the enlarged image is displayed in the screen display area of the terminal. The user can view the enlarged image in the terminal display area.
[0147] 204. Based on the screen display area of the terminal, the terminal displays the zoomed image.
[0148] For example, taking the target image as a picture for illustration, as Figure 5 shown, the acceleration values of the terminal in each direction are read by calling the displacement sensor in the terminal, and then the displacements corresponding to the acceleration values are calculated. For example, when the terminal is displaced vertically up and down from the ground, the displacement information corresponding to the vertical up and down direction from the ground is calculated. When the target zoom ratio is within the target zoom boundary corresponding to the target image, the target image is zoomed according to the target zoom ratio, such as a zoom factor of 0.1.
[0149] Among them, the zoom boundary range of the zoomed image can be calculated by calculating the zoomed displacement, the target zoom ratio, and the target zoom boundary range, so as to perform secondary zooming on the zoomed image.
[0150] Furthermore, after obtaining the zoomed image, when the terminal has displacements in the left, right, front, and back directions on the horizontal ground, the acceleration values in each direction can be read by the displacement sensor in the terminal, so as to calculate the displacement information corresponding to each acceleration value. Finally, based on this displacement information, the actual displacement value of the zoomed image is calculated, and the zoomed image is moved and displayed.
[0151] Among them, the displacement information of the terminal is detected in real time, and the displacement information includes second displacement information. When the size of the zoomed image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets the preset moving display condition, the zoomed image is moved and displayed according to the target displacement ratio corresponding to the second displacement information.
[0152] Further, the second displacement information includes a second displacement direction and a second displacement distance. When the second displacement direction is a preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within the displacement boundary value range corresponding to the scaled image, it is determined that the second displacement information meets the preset moving display condition. When the second displacement information meets the preset moving display condition, the scaled image is moved and displayed according to the target displacement ratio.
[0153] Among them, the moving display of the scaled image can, when the second displacement information meets the preset moving display condition, calculate the actual image displacement of the scaled image based on the second displacement information and the target displacement ratio, and then move and display the scaled image based on the actual image displacement. It can also be understood as obtaining the pixel displacement value of the scaled image based on the actual image displacement, then changing the pixel displacement value according to the target displacement ratio and the second displacement information to obtain the changed pixel displacement value, and finally moving and displaying the scaled image based on the changed pixel displacement value.
[0154] Among them, the displacement boundary value range can calculate the displacement ratio information between the terminal and the scaled image according to the side length information of the scaled image and the preset terminal displacement information of the terminal to obtain the target displacement ratio corresponding to the second displacement information. Then, obtain the terminal displacement information of the terminal after scaling the target image, and then calculate the actual displacement information of the terminal currently based on the terminal displacement information and the second displacement information. Finally, calculate the displacement boundary value range of the terminal displacement based on the target displacement ratio and the actual displacement information.
[0155] Further, the detailed calculation process of the displacement boundary value range can include first fusing the target displacement ratio and the actual displacement information to obtain the actual image displacement information of the scaled image, then fusing the image displacement information and the side length information to obtain the image displacement boundary value range of the scaled image, and finally calculating the displacement boundary value range of the terminal based on the image displacement boundary and the target displacement ratio.
[0156] By adopting this solution, when a user views an image in the screen display area of the terminal, the user can view different areas of the image by moving the terminal. When the user moves the terminal vertically upward in the direction perpendicular to the ground, the image is shrunk, and the user can view the shrunk image in the screen display area of the terminal. When the user moves the terminal vertically downward in the direction perpendicular to the ground, the image is enlarged, and the user can view the enlarged image in the screen display area of the terminal. The user can also move the terminal in the left-right and front-back directions on the horizontal ground to view different areas of the image.
[0157] As can be seen from the above, for the image displayed in the screen display area of the terminal, the terminal can be moved vertically up and down with respect to the ground to magnify or reduce the initialized image, obtaining a magnified or reduced image. When the width and height of the magnified image exceed the size of the screen display area of the terminal, the terminal can be displaced horizontally up, down, left, and right with respect to the ground to display a partial position of the image. Among them, the images displayed in the screen area of the terminal include pictures, videos, texts, etc. By displacing the terminal, the partial positions of pictures, videos, texts, etc. can be displayed in the screen area of the terminal. In this embodiment, the displacement information of the terminal can be detected in real time, and the image displayed in the terminal can be scaled according to the moving zoom ratio, and then the scaled image can be displayed in the terminal, improving the accuracy of image display.
[0158] To better implement the above method, correspondingly, an embodiment of the present application further provides an image display device, where the image display device can be specifically integrated in the terminal. Refer to Figure 10 , the image display device may include a first display unit 301, a detection unit 302, a first scaling unit 303, and a second display unit 304, as follows:
[0159] (1) The first display unit 301;
[0160] The first display unit is configured to display a target image in the screen display area of the terminal.
[0161] In one embodiment, the first display unit 301 includes:
[0162] A first acquisition subunit 3011, configured to respectively acquire the original side length of the image and the size of the screen display area;
[0163] An alteration subunit 3012, configured to alter the side length of the image based on the original side length and the size of the screen display area, obtaining an altered image;
[0164] A scaling subunit 3013, configured to scale the altered image according to a preset zoom ratio, obtaining a target image;
[0165] A first display subunit 3014, configured to display the target image in the screen display area of the terminal.
[0166] (2) The detection unit 302;
[0167] The detection unit 302 is configured to detect the displacement information of the terminal in real time.
[0168] (3) The first scaling unit 303;
[0169] The first scaling unit 303 is configured to scale the target image according to a target scaling ratio corresponding to the first displacement information to obtain a scaled image when it is detected that the first displacement information meets a preset scaling condition.
[0170] (4) The second display unit 304;
[0171] The second display unit 304 is configured to display the scaled image based on a screen display area of the terminal.
[0172] In one embodiment, the image display device further includes:
[0173] The determination unit 305 is configured to determine that the first displacement information meets the preset scaling condition when the first displacement direction is a preset scaling direction and the first displacement distance meets a preset distance condition.
[0174] In one embodiment, the determination unit 305 includes:
[0175] The first determination subunit 3051 is configured to determine that the first displacement information meets the preset scaling condition when the first displacement direction is a preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within a target scaling boundary range corresponding to the target image.
[0176] In one embodiment, the first determination subunit 3051 further includes:
[0177] The second acquisition subunit 3052 is configured to acquire a size of the screen display area;
[0178] The first calculation subunit 3053 is configured to calculate a target scaling boundary range of the target image based on the screen size and a side length of the target image.
[0179] In one embodiment, the first calculation subunit 3053 is further configured to acquire an initial scaling boundary range of the target image; when the side length is greater than the screen size, calculate a first scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; and determine the target scaling boundary range of the target image according to the first scaling boundary range.
[0180] In one embodiment, the first calculation subunit 3053 is further configured to when the side length is less than the size, calculate a second scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; and determine the target scaling boundary range of the target image based on the second scaling boundary range.
[0181] In one embodiment, the image display device further includes:
[0182] An acquisition unit 306, configured to acquire the scaled displacement of the terminal after scaling the image;
[0183] A calculation unit 307, configured to calculate the scaled boundary range of the scaled image based on the scaled displacement, the target scaling ratio, and the target scaling boundary range;
[0184] A second scaling unit 308, configured to perform secondary scaling on the scaled image based on the scaled boundary range.
[0185] In one embodiment, the image display device further includes:
[0186] A third display unit 309, configured to perform a moving display on the scaled image according to the target displacement ratio corresponding to the second displacement information when the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets the preset moving display condition.
[0187] In one embodiment, the third display unit 309 includes:
[0188] A second determination subunit 3091, configured to determine that the second displacement information meets the preset moving display condition when the second displacement direction is the preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within the displacement boundary value range corresponding to the scaled image;
[0189] A second display subunit 3092, configured to perform a moving display on the scaled image according to the target displacement ratio when the second displacement information meets the preset moving display condition.
[0190] In one embodiment, the second display subunit 3092 is further configured to calculate the actual image displacement of the scaled image based on the second displacement information and the target displacement ratio when the second displacement information meets the preset moving display condition; and perform a moving display on the scaled image based on the actual image displacement.
[0191] In one embodiment, the second display subunit 3092 is further configured to obtain the pixel displacement value of the scaled image based on the actual image displacement; change the pixel displacement value according to the target displacement ratio and the second displacement information to obtain a changed pixel displacement value; and perform a moving display on the scaled image based on the changed pixel displacement value.
[0192] In one embodiment, the third display unit 309 further includes:
[0193] The first obtaining subunit 3093 is configured to calculate displacement ratio information between the terminal and the scaled image according to the side length information of the scaled image and the preset terminal displacement information of the terminal, so as to obtain a target displacement ratio corresponding to the second displacement information;
[0194] The third obtaining subunit 3094 is configured to obtain the terminal displacement information of the terminal after the terminal scales the target image;
[0195] The second calculating subunit 3095 is configured to calculate actual displacement information of the terminal currently based on the terminal displacement information and the second displacement information;
[0196] The third calculating subunit 3096 is configured to calculate a displacement boundary value range of the terminal displacement based on the target displacement ratio and the actual displacement information.
[0197] In an embodiment, the third calculating subunit 3096 is further configured to fuse the target displacement ratio and the actual displacement information to obtain actual image displacement information of the scaled image; fuse the image displacement information and the side length information to obtain an image displacement boundary value range of the scaled image; calculate a displacement boundary value range of the terminal based on the image displacement boundary value and the target displacement ratio.
[0198] As can be seen from the above, in the image display device according to the embodiment of the present application, the first display unit 301 displays a target image in a screen display area of the terminal; then, the detection unit 302 detects the displacement information of the terminal in real time; when the first displacement information meets a preset scaling condition, the first scaling unit 303 scales the target image according to a target scaling ratio corresponding to the first displacement information to obtain a scaled image; and the second display unit 304 displays the scaled image based on the screen display area of the terminal. This solution can improve the accuracy of image display by detecting the displacement information of the terminal in real time, scaling the image displayed in the terminal according to the moving scaling ratio, and then displaying the scaled image in the terminal.
[0199] In addition, the embodiment of the present application further provides a computer device, which may be a device such as a terminal or a server, as Figure 11 shown, which shows a schematic structural diagram of the computer device involved in the embodiment of the present application. Specifically:
[0200] The computer device may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input unit 404, and other components. Those skilled in the art can understand, Figure 11The computer device structure shown does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:
[0201] The processor 401 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 402, and calling the data stored in the memory 402, it executes various functions of the computer device and processes data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401 either.
[0202] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.), etc.; the data storage area can store the data created according to the use of the computer device. In addition, the memory 402 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 402 can also include a memory controller to provide the processor 401 with access to the memory 402.
[0203] The computer device also includes a power supply 403 that powers each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0204] The computer device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0205] Although not shown, the computer device may further include a display unit and the like, which will not be elaborated here. Specifically, in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:
[0206] Display a target image in the screen display area of the terminal; detect the displacement information of the terminal in real time; when it is detected that the first displacement information meets the preset scaling condition, scale the target image according to the target scaling ratio corresponding to the first displacement information to obtain a scaled image; based on the screen display area of the terminal, display the scaled image.
[0207] For the specific embodiments of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.
[0208] In one embodiment, as Figure 6 shown, the computer device may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P) network, and any form of computer device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network.
[0209] As can be seen from the above, this embodiment can improve the accuracy of image display by detecting the displacement information of the terminal in real time, scaling the image displayed in the terminal according to the moving scaling ratio, and then displaying the scaled image in the terminal.
[0210] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0211] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which multiple instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the image display methods provided by the embodiments of the present application. For example, the instructions can execute the following steps:
[0212] Display a target image in the screen display area of the terminal; detect the displacement information of the terminal in real time; when it is detected that the first displacement information meets the preset zoom condition, zoom the target image according to the target zoom ratio corresponding to the first displacement information to obtain a zoomed image; based on the screen display area of the terminal, display the zoomed image.
[0213] For the specific implementation manners of the above various operations, reference may be made to the previous embodiments, which will not be elaborated herein.
[0214] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0215] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the image display methods provided in the embodiments of the present application, the beneficial effects achievable by any of the image display methods provided in the embodiments of the present application can be achieved. For details, reference may be made to the previous embodiments, which will not be elaborated herein.
[0216] The above has introduced in detail an image display method, device, computer device and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. An image display method, characterized in that, comprising: displaying a target image in a screen display area of a terminal, including: respectively obtaining an original side length of the image and a size of the screen display area; based on the original side length and the size of the screen display area, changing the side length of the image to obtain a changed image; scaling the changed image according to a preset scaling ratio to obtain a target image; displaying the target image in the screen display area of the terminal; real-time detecting displacement information of the terminal; when it is detected that first displacement information meets a preset scaling condition, scaling the target image according to a target scaling ratio corresponding to the first displacement information to obtain a scaled image; the first displacement information includes a first displacement direction and a first displacement distance; wherein, determining that the preset scaling condition is met includes: when the first displacement direction is a preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within a target scaling boundary range corresponding to the target image, determining that the first displacement information meets the preset scaling condition; wherein, calculating the target scaling boundary range includes: obtaining the size of the screen display area; based on the screen size and the side length of the target image, calculating the target scaling boundary range of the target image; displaying the scaled image based on the screen display area of the terminal; when the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that second displacement information meets a preset moving display condition, performing a moving display on the scaled image according to a target displacement ratio corresponding to the second displacement information; the second displacement information includes a second displacement direction and a second displacement distance; wherein, determining that the preset moving display condition is met includes: when the second displacement direction is a preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within a displacement boundary value range corresponding to the scaled image, determining that the second displacement information meets the preset moving display condition; wherein, calculating the displacement boundary value range includes: according to the side length information of the scaled image and preset terminal displacement information of the terminal, calculating displacement ratio information between the terminal and the scaled image to obtain a target displacement ratio corresponding to the second displacement information; obtaining the terminal displacement information of the terminal after scaling the target image; based on the terminal displacement information and the second displacement information, calculating actual displacement information of the terminal currently; based on the target displacement ratio and the actual displacement information, calculating the displacement boundary value range of the terminal displacement.
2. The method according to claim 1, characterized in that, the calculating the target scaling boundary range of the target image based on the screen size and the side length of the target image includes: obtaining an initial scaling boundary range of the target image; when the side length is greater than the screen size, calculating a first scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; Determine the target scaling boundary range of the target image according to the first scaling boundary range.
3. The method according to claim 2, wherein, the calculating the target scaling boundary range of the target image based on the screen size and the side length of the target image includes: when the side length is less than the size, calculate the second scaling boundary range of the target image according to the side length, the screen size, and the initial scaling boundary range; Determine the target scaling boundary range of the target image based on the second scaling boundary range.
4. The method according to claim 1, wherein, the method further includes: Obtain the scaled displacement of the terminal after scaling the image; Calculate the scaling boundary range of the scaled image based on the scaled displacement, the target scaling ratio, and the target scaling boundary range; Based on the scaling boundary range, perform secondary scaling on the scaled image.
5. The method according to claim 1, wherein, the when the second displacement information meets the preset moving display condition, perform moving display on the scaled image according to the target displacement ratio, includes: when the second displacement information meets the preset moving display condition, calculate the actual image displacement of the scaled image based on the second displacement information and the target displacement ratio; Based on the actual image displacement, perform moving display on the scaled image.
6. The method according to claim 5, wherein, the performing moving display on the scaled image based on the actual image displacement includes: Based on the actual image displacement, obtain the pixel displacement value of the scaled image; According to the target displacement ratio and the second displacement information, change the pixel displacement value to obtain the changed pixel displacement value; Based on the changed pixel displacement value, perform moving display on the scaled image.
7. The method according to claim 1, wherein, the calculating the displacement boundary value range of the terminal displacement based on the target displacement ratio and the actual displacement information includes: Fuse the target displacement ratio and the actual displacement information to obtain the actual image displacement information of the scaled image; Fuse the image displacement information and the side length information to obtain the image displacement boundary value range of the scaled image; Calculate the displacement boundary value range of the terminal based on the image displacement boundary value and the target displacement ratio.
8. An image display device, wherein, comprises: A first display unit for displaying a target image in the screen display area of the terminal, including: respectively obtaining the original side length of the image and the size of the screen display area; changing the side length of the image based on the original side length and the size of the screen display area to obtain a changed image; scaling the changed image according to a preset scaling ratio to obtain a target image; displaying the target image in the screen display area of the terminal; A detection unit for detecting the displacement information of the terminal in real time; A first scaling unit, configured to scale the target image according to a target scaling ratio corresponding to the first displacement information when it is detected that the first displacement information meets a preset scaling condition, so as to obtain a scaled image; the first displacement information includes a first displacement direction and a first displacement distance; wherein, determining that the preset scaling condition is met includes: when the first displacement direction is a preset scaling direction and the target scaling ratio corresponding to the first displacement distance is within a target scaling boundary range corresponding to the target image, determining that the first displacement information meets the preset scaling condition; wherein, calculating the target scaling boundary range includes: obtaining the size of the screen display area; calculating the target scaling boundary range of the target image based on the screen size and the side length of the target image. A second display unit, configured to display the scaled image based on the screen display area of the terminal. A third display unit, configured to perform a moving display on the scaled image according to a target displacement ratio corresponding to the second displacement information when the size of the scaled image exceeds the size of the screen display area of the terminal and it is detected that the second displacement information meets a preset moving display condition; the second displacement information includes a second displacement direction and a second displacement distance; wherein, determining that the preset moving display condition is met includes: when the second displacement direction is a preset displacement direction and the target displacement ratio corresponding to the second displacement distance is within a displacement boundary value range corresponding to the scaled image, determining that the second displacement information meets the preset moving display condition; wherein, calculating the displacement boundary value range includes: calculating a displacement ratio information between the terminal and the scaled image according to the side length information of the scaled image and preset terminal displacement information of the terminal, so as to obtain a target displacement ratio corresponding to the second displacement information; obtaining the terminal displacement information of the terminal after scaling the target image; calculating the actual displacement information of the terminal currently based on the terminal displacement information and the second displacement information; calculating a displacement boundary value range of the terminal displacement based on the target displacement ratio and the actual displacement information.
9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. Wherein, The processor executes the steps in the image display method according to any one of claims 1-7.
10. A computer-readable storage medium, storing multiple instructions, which are suitable for being loaded by a processor to execute the steps in the image display method according to any one of claims 1-7.
Citation Information
Patent Citations
Method and device for displaying manuscript
CN104216634A
Method and device for scaling displayed content
CN105320393A