Image display method, device, equipment and computer readable storage medium
By obtaining historical window coordinates and processing parameters during page switching, the target image is restored and processed, solving the problem of multiple drawing operations not being related. This achieves the correlation between drawings and the preservation of view position, improving the flexibility and efficiency of image viewing.
Patent Information
- Application Number
- CN202210618470.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2042-06-01
AI Technical Summary
In existing technologies, the operations on multiple drawings lack correlation within electronic files, resulting in poor flexibility and low processing efficiency.
By responding to page switching operations, the coordinates and processing parameters of historical windows are obtained, and the target image is restored and processed to maintain the view position, thereby achieving the correlation between drawings and maintaining the display position.
It improves the flexibility and intelligence of image viewing and enhances image inspection efficiency.
Smart Images

Figure CN117193608B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics display technology, and to, but is not limited to, an image display method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] A product often has multiple schematics or drafts, which are then combined into a single electronic file. During the design, modification, or review of the schematics or drafts, it is necessary to switch between different drawings within one or more electronic files.
[0003] In existing technologies, various operations on different drawings are independent and unrelated, resulting in poor flexibility and low processing efficiency when operating on multiple drawings. Summary of the Invention
[0004] In view of this, embodiments of this application provide an image display method, apparatus, device, and computer-readable storage medium, which not only enables the correlation between different drawings but also maintains the display position of the view.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides an image display method, the method comprising: in response to a page switching operation, determining first processing parameters of the currently displayed image and a first target image, and obtaining historical window coordinates of a reference point when the first target image was last displayed; performing restoration processing on the first target image based on the historical window coordinates to obtain a restored first target image; processing the restored first target image based on the first processing parameters to obtain a processed first target image; and displaying the processed first target image.
[0007] This application provides an image display device, comprising: a first acquisition module, configured to, in response to a page switching operation, determine first processing parameters of the currently displayed image and a first target image, and acquire historical window coordinates of a reference point when the first target image was last displayed; a first restoration module, configured to perform restoration processing on the first target image based on the historical window coordinates to obtain a restored first target image; a first processing module, configured to process the restored first target image based on the first processing parameters to obtain a processed first target image; and a first display module, configured to display the processed first target image.
[0008] This application provides a computer device, which includes: a processor; and a memory for storing a computer program that can run on the processor; wherein, when the computer program is executed by the processor, it implements the above-described image display method.
[0009] This application provides a computer-readable storage medium storing computer-executable instructions configured to perform the above-described image display method.
[0010] This application provides an image display method, apparatus, device, and computer-readable storage medium. After opening a file to be displayed, the image is displayed in the image display window of the human-computer interaction interface. Then, the currently displayed image and its first processing parameters are obtained. Upon receiving a page switching operation, in response to the page switching operation, a first target image is determined, and the historical processing parameters of the last display of the first target image and the historical window coordinates of the reference point are obtained. Then, based on the historical processing parameters and the historical window coordinates, the first target image is restored to obtain a restored first target image. The restored first target image is not scaled relative to the initial first target image, and the reference point in the restored first target image is located at the position corresponding to the historical window coordinates, thus maintaining the view display position. Finally, the restored first target image is scaled based on the first processing parameters to obtain a processed first target image, which is then displayed. In other words, the processing parameters of the processed first target image are consistent with the processing parameters of the image displayed before the page switching. This not only enables the correlation between different drawings but also maintains the view display position, improving the flexibility and intelligence of image viewing and increasing image inspection efficiency. Attached Figure Description
[0011] In the accompanying drawings (which are not necessarily drawn to scale), similar reference numerals may describe similar parts in different views. The drawings illustrate, by way of example and not limitation, the various embodiments discussed herein.
[0012] Figure 1 A diagram illustrating the relationship between control forms, canvas, and display objects;
[0013] Figure 2 This is a schematic diagram illustrating an implementation flow of the image display method provided in an embodiment of this application;
[0014] Figure 3 A schematic diagram illustrating the implementation process of determining the currently displayed image provided in an embodiment of this application;
[0015] Figure 4 This is a schematic diagram illustrating another implementation of the image display method provided in the embodiments of this application;
[0016] Figure 5 A schematic diagram illustrating another implementation flow of the image display method provided in this application embodiment;
[0017] Figure 6 A schematic diagram illustrating the implementation process of the first view restoration module provided in this application embodiment;
[0018] Figure 7 This is a schematic diagram illustrating the application of the image display method provided in the embodiments of this application;
[0019] Figure 8 This is a schematic diagram of the structure of a computer device 800 provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0022] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0024] To better understand the image display method provided in the embodiments of this application, the relationship between the spatial window, the canvas, and the display objects in the image will first be explained.
[0025] Figure 1This diagram illustrates the relationship between the control window, canvas, and display object. The control window 101 is a fixed-size display interface for user interaction and serves as a container for the canvas 102, forming a two-dimensional coordinate system (X,Y) with its upper left corner at (0,0). The canvas 102 is a drawing component; the schematic object 103 can be displayed as an image on the canvas 102 through data processing. The canvas 102 also has a coordinate system (Z,Q) with its upper left corner at (0,0). The schematic object 103 is a schematic element object extracted from the EDIF file and displayed based on the canvas coordinate system. Initially, the origins of the canvas coordinate system and the window coordinate system coincide, with one canvas component corresponding to each schematic page. In the drawing module, canvas coordinates can be converted to window coordinates using a specified method.
[0026] This application provides an image display method, which can be implemented by a computer program. When the computer program is executed, it performs the image display method provided in this application. In some embodiments, the computer program can be executed by a processor in a computer device. Figure 2 This is a schematic diagram illustrating an implementation flow of the image display method provided in this application embodiment. The following is in conjunction with... Figure 2 The various steps of the image display method provided in the embodiments of this application will be described.
[0027] Step S201: In response to the page switching instruction, determine the first processing parameters and the first target image of the currently displayed image, and obtain the historical window coordinates of the reference point when the first target image was last displayed.
[0028] As an example, a page switching instruction may be triggered by clicking on the first image identifier of an image other than the currently displayed image. The first image identifier may be the page number identifier of the other image. In some embodiments, the page switching instruction may also be triggered by an operation to switch to the previous page or to switch to the next page triggered by an input device (such as a keyboard or mouse). Of course, the page switching instruction may also be triggered by issuing a voice or gesture to switch pages. In the embodiments of this application, the triggering form of the page switching instruction is not limited.
[0029] The primary target image is the image to be displayed after the switch. The reference point can be a preset point on the canvas. The preset point can be a system default configuration or a user-defined one; there are no restrictions on this. For example, the preset point can be a point with canvas coordinates of (0,0) in the initial state, or it can be a point with canvas coordinates of (1,1). In implementation, a transparent object can be created at the position corresponding to the reference point. After receiving a scaling or dragging operation, the window coordinates of the transparent object will be recorded, thus providing reference data for image restoration.
[0030] The first processing parameters may include scaling parameters. In some embodiments, it is also necessary to obtain the historical processing parameters of the first target image previously displayed. The first historical processing parameters of the first target image refer to the processing parameters of the first target image when switching from the first target image to another image. If the processing parameters of the first target image previously displayed were magnified by 2 times, then when switching from the first target image to another image, the first historical processing parameters of the first target image will be magnified by 2 times. If the first target image has never been displayed before, then the first historical processing parameters of the first target image are the initial values.
[0031] Each display page is associated with the historical window coordinates of a reference point. This can be achieved using a multidimensional array, such as a three-dimensional array. Each display page corresponds to a processing parameter and the historical window coordinates of a reference point.
[0032] Suppose there are 3 display pages, namely display page 1, display page 2 and display page 3. The processing parameter of display page 1 is 2, and the historical window coordinates of the reference point are (1,1). The processing parameter of display page 2 is 1, and the historical window coordinates of the reference point are (0,0). The processing parameter of display page 3 is 2, and the historical window coordinates of the reference point are (0,0). Then the three-dimensional array is {[1,2,(1,1)],[2,1,(0,0)],[3,2,(0,0)]}.
[0033] In some other embodiments, the first processing parameters may also include corresponding parameters retained during processing operations such as doodling or drawing design in the current image. In response to a page switching command, after determining the first processing parameters of the currently displayed image and the first target image, the electronic device may also obtain the historical window coordinates of the reference point from the last time the first target image was displayed.
[0034] Step S202: Based on the historical window coordinates, perform restoration processing on the first target image to obtain the restored first target image.
[0035] In this step, the historical processing parameters from the last time the first target image was displayed are first obtained. Then, based on the first historical processing parameters, the first target image is scaled back to its initial state with the canvas center as the scaling center. Next, the first window coordinates of the reference point in the first target image at the initial state are determined. Based on the historical window coordinates and the first window coordinates of the reference point, the canvas displaying the first target image is dragged until the reference point moves from the first window coordinates to the historical window coordinates. That is, the reference point in the restored first target image is located at the position corresponding to the historical window coordinates, and the restored first target image has not been scaled relative to the initial first target image. In some other embodiments, the historical processing parameters from the last time the first target image was displayed are first obtained. The first processing parameters can be corresponding parameters retained during the doodling or drawing design operations in the current image. Then, based on the first historical processing parameters, the first target image is displayed with the canvas center as the display center. That is, the reference point in the restored first target image is located at the position corresponding to the historical window coordinates, and the restored first target image has not changed relative to the initial first target image.
[0036] Step S203: Process the recovered first target image based on the first processing parameters to obtain the processed first target image.
[0037] In this step, the first target image after restoration is scaled according to the first processing parameters with the center of the canvas as the scaling center, resulting in the processed first target image. Since the scaling is performed with the center of the canvas as the scaling center, and the first target image is also scaled with the center of the canvas as the scaling center in step S202, it is possible to ensure that the processed first target image obtained in step S203 maintains the view position compared to the previously displayed first target image. That is, if the object M was located in the center of the window when the first target image was previously displayed, then the object M is still located in the center of the window at this time, and the scaling ratio of the image is the same as the scaling ratio of the image before switching (i.e., the currently displayed image in step S201), thereby achieving scaling follow and view position maintenance.
[0038] In some other embodiments, the restored first target image is displayed with a preset point as the center, and the first processing parameters retained during the graffiti or drawing design process are superimposed on the first target image to obtain the processed first target image.
[0039] Step S204: Display the processed first target image.
[0040] In some embodiments, after step S204, the first processing parameters are updated to the historical processing parameters of the processed first target image. Further scaling and dragging operations can be performed on the processed first target image. After each scaling operation, the historical processing parameters of the first target image are updated, and the historical window coordinates of the reference point are updated.
[0041] In some other embodiments, after step S204, the first processing parameters are updated to the historical processing parameters of the processed first target image. Further operations such as doodling or drawing design can also be performed on the processed first target image. After each doodling or drawing design, the historical processing parameters of the first target image are updated, and the historical window coordinates of the reference point are also updated.
[0042] In the image display method provided in this application embodiment, after opening the file to be displayed, the image is displayed in the image display window of the human-computer interaction interface. Then, the currently displayed image and the first processing parameters of the currently displayed image are obtained. After receiving a page switching operation, in response to the page switching operation, a first target image is determined, and the historical processing parameters of the last display of the first target image and the historical window coordinates of the reference point are obtained. Then, based on the historical processing parameters and the historical window coordinates, the first target image is restored to obtain the restored first target image. The restored first target image is not scaled relative to the initial first target image, and the reference point in the restored first target image is located at the position corresponding to the historical window coordinates. This can maintain the view display position. Finally, the restored first target image is scaled based on the first processing parameters to obtain the processed first target image, and the processed first target image is displayed. That is to say, the processing parameters of the processed first target image are consistent with the processing parameters of the image displayed before the page switching. This not only enables the correlation between different drawings, but also maintains the view display position, thereby improving the flexibility and intelligence of image viewing and improving image inspection efficiency.
[0043] In some embodiments, prior to step S201, it may also be possible to... Figure 3 Steps S001 to S007, as shown, involve scaling, dragging, and other adjustments to the image to obtain the currently displayed image. The following is a combination of... Figure 3 Each step is explained.
[0044] Step S001: Obtain the file to be displayed.
[0045] The file to be displayed includes at least two images. It should be noted that the file actually contains image data for at least two images. Each image corresponds to a canvas component, and each image is displayed on the canvas component. In implementation, the file to be displayed can correspond to a three-dimensional array. This three-dimensional data can be used to associate each image to be displayed, its processing parameters, and the reference point's window coordinates. In implementation, the canvas coordinate (0,0) point can be defined as the reference point, and a transparent object P can be created on the reference point. Since the window coordinate system and the canvas coordinate system coincide initially, the initial window coordinates of the transparent object P are also (0,0).
[0046] Step S002: Obtain the historical processing parameters corresponding to each image to be displayed in the file to be displayed and the historical window coordinates of the reference points in each image to be displayed.
[0047] When the file to be displayed has not been opened before, the historical zoom counts for each image in the file and the historical window coordinates of the reference points in each image are all initial values. When the file to be displayed has been opened before, and zooming or dragging operations have been performed on one or more images, the historical processing parameters and historical window coordinates of the reference points for the images that have been zoomed or dragged will be updated based on the received zooming or dragging operations.
[0048] Step S003: In response to the first operation of opening the file to be displayed, determine the first image to be displayed, and display the first image on the canvas component based on the historical processing parameters corresponding to the first image and the historical window coordinates of the reference point.
[0049] In this embodiment, if it is the first time a file to be displayed is opened, the first image to be displayed can be the first image in the file; if it is not the first time a file to be displayed is opened, the first image to be displayed can be either the first image in the file or the image displayed when the file was last closed. After determining the first image to be displayed, the historical processing parameters and historical window coordinates of the reference point corresponding to the first image can be obtained based on the identifier of the first image. Then, the first image is scaled based on the historical processing parameters. After scaling, the canvas component corresponding to the first image is moved based on the historical window coordinates, so that the view position is maintained when the first image is displayed on the canvas component compared to the last time the first image was displayed.
[0050] Step S004: Determine whether a first adjustment operation for the first image has been received.
[0051] The first adjustment operation includes at least one of a scaling operation and a moving operation. If no first adjustment operation is received for the first image, proceed to step S005; if a first adjustment operation is received for the first image, proceed to step S006.
[0052] Step S005: Determine the first image as the currently displayed image.
[0053] Step S006: Determine the first adjustment parameter corresponding to the first adjustment operation.
[0054] When the first adjustment operation is a scaling operation, a scaling adjustment parameter is determined based on the scaling operation, and the scaling adjustment parameter is determined as the first adjustment parameter. The scaling adjustment parameter can be the number of scaling adjustments or the adjustment ratio, corresponding to the processing parameter. If the processing parameter is the number of scaling adjustments, then the scaling adjustment parameter is also the number of scaling adjustments. If the processing parameter is the scaling ratio, then the scaling adjustment parameter is the adjustment ratio.
[0055] When the first adjustment operation is a move operation, the movement parameters of the canvas component are determined based on the move operation, wherein the movement parameters may include the movement distance and the movement direction, and the movement parameters of the canvas component are determined as the first adjustment parameters.
[0056] When the first adjustment operation includes a scaling operation and a moving operation, the scaling adjustment parameter and the moving parameter of the canvas component are determined as the first adjustment parameter.
[0057] Step S007: Adjust the first image based on the first adjustment parameter to obtain the adjusted first image, and determine the adjusted first image as the current display image.
[0058] When the first adjustment parameter only includes the scaling adjustment parameter, adjusting the first image based on the first adjustment parameter can be done by scaling the first image according to the scaling adjustment parameter with the scaling point corresponding to the adjustment operation as the scaling center, to obtain the adjusted first image.
[0059] When the first adjustment parameter only includes the movement parameter of the canvas component, adjusting the first image based on the first adjustment parameter can be done by moving the canvas component that displays the first image according to the movement parameter, thereby changing the image area displayed in the window.
[0060] When the first adjustment parameter includes a scaling adjustment parameter and a canvas movement parameter, the first image can be adjusted based on the order of the received scaling and movement operations, and based on the scaling adjustment parameter and the canvas component movement parameter, to obtain the adjusted first image.
[0061] In some embodiments, after step S007, the historical processing parameters of the first image can be updated using the scaling adjustment parameters to obtain updated processing parameters; and / or, the historical window coordinates of the reference points in the first image can be updated using the movement parameters of the canvas component to obtain updated historical window coordinates.
[0062] Taking the scaling number as an example, let's assume that the historical processing parameter of the first image is 2, which means it is magnified 2 times, and the scaling adjustment parameter is -1, which means it is reduced 1 time. Then, the updated historical processing parameter is obtained by summing the historical processing parameter and the scaling adjustment parameter. That is, the updated historical processing parameter is 1, which means it is magnified 1 time.
[0063] When the processing parameter is the scaling ratio, assuming the historical processing parameter of the first image is 4, which means it is magnified to 4 times the initial state, and the scaling adjustment parameter is 1 / 2, which means it is reduced by 1 / 2, then the updated historical processing parameter is obtained by multiplying the historical processing parameter and the scaling adjustment parameter, 4*1 / 2=2, which means the updated historical processing parameter is 2, which means it is magnified to 2 times the initial state.
[0064] The historical window coordinates of the reference point in the first image are updated using the movement parameters of the canvas component to obtain the updated historical window coordinates. In implementation, the offset in the x-direction and the offset in the y-direction can be determined based on the movement distance and direction in the movement parameters, respectively. Then, the x-coordinate and the offset in the x-direction of the historical window coordinates of the reference point are summed to obtain the updated x-coordinate of the historical window coordinates. The y-coordinate and the offset in the y-direction of the historical window coordinates of the reference point are summed to obtain the updated y-coordinate of the historical window coordinates. Thus, the updated historical window coordinates are obtained. This enables the processing parameters of the first image and the historical window coordinates of the reference point to be updated in real time when the first image is scaled or moved. This ensures that the processing parameters and reference point window coordinates after the last operation of the first image are recorded before the page is switched, thereby achieving view display persistence when switching back to the first image.
[0065] In some embodiments, the updated historical window coordinates can also be obtained directly using a preset window coordinate acquisition function. In this application embodiment, the implementation method for obtaining the updated historical window coordinates is not limited.
[0066] In some embodiments, when a first selection operation is received for a first image identifier corresponding to an image other than the currently displayed image, it is determined that a page switching instruction has been received. The first selection operation may be a click or touch operation on the first image identifier; for example, the first image identifier may be a page number identifier. Correspondingly,
[0067] The above step S201, "in response to a page switching instruction, determining the first processing parameters and the first target image of the currently displayed image, and obtaining the historical window coordinates of the reference point when the first target image was last displayed," can be achieved through the following steps:
[0068] Step S2011: In response to the page switching instruction, determine the first processing parameters of the currently displayed image.
[0069] In this embodiment, the currently displayed image is the image displayed on the canvas when a page switching instruction is received. The currently displayed image can be the image in its initial state within the file to be displayed, i.e., an image that has not been scaled or dragged, or an image after scaling and dragging the initial state image following opening the file to be displayed. The file to be displayed includes image data for multiple images to be displayed. Each image corresponds to a processing parameter, which can be either the number of scaling operations or the scaling ratio. When the processing parameter is the number of scaling operations, its initial value is 0. For each zoom-in operation, the processing parameter increments by 1, and for each zoom-out operation, it decrements by 1. When the processing parameter is the scaling ratio, its initial value is 1. For each zoom-in operation, the processing parameter is multiplied by a real number greater than 1, and for each zoom-out operation, it is multiplied by a real number less than 1. In this embodiment, the scaling ratio is used as an example for explanation.
[0070] The first processing parameter of the currently displayed image refers to the processing parameter of the currently displayed image relative to its initial state when a page switching instruction is received.
[0071] Step S2012: The image corresponding to the first image identifier is determined as the first target image.
[0072] Step S2013: Obtain the historical window coordinates of the reference point when the first target image was last displayed based on the first image identifier.
[0073] Since a three-dimensional array corresponding to the file to be displayed has been pre-created, and the three-dimensional array stores the correspondence between each image identifier, the historical processing parameters corresponding to the image identifier, and the historical window coordinates of the reference point, after determining the first image identifier of the first target image, the first historical processing parameters of the first target image and the historical window coordinates of the reference point can be determined from the three-dimensional array based on the first image identifier. This can improve data acquisition efficiency and thus improve the processing efficiency of image inspection.
[0074] In some embodiments, the above step S202, "based on historical window coordinates, performing restoration processing on the first target image to obtain the restored first target image," can be achieved through the following steps:
[0075] Step S2021: Obtain the first historical processing parameters when the first target image was last displayed, and determine the first restoration processing parameters of the first target image based on the first historical processing parameters.
[0076] Specifically, when the processing parameter is the scaling ratio, the first historical processing parameter and the first recovery processing parameter are reciprocals of each other; when the processing parameter is the scaling number, the first historical processing parameter and the first recovery processing parameter are opposites of each other.
[0077] For example, when the processing parameter is the scaling ratio, if the first historical processing parameter is 2, then the first recovery processing parameter is 1 / 2; when the processing parameter is the scaling number, if the first historical processing parameter is -2, then the first recovery processing parameter is 2.
[0078] Step S2022: Process the first target image using the first restoration processing parameters to obtain the first restored image.
[0079] In this step, the first target image is scaled according to the first restoration processing parameters with the center of the canvas as the scaling center to obtain the first restored image, wherein the first restored image has the same scaling size as the first target image in the initial state.
[0080] Step S2023: Obtain the first window coordinates of the reference point in the first restored image.
[0081] In this embodiment of the application, since a transparent object P is created at the location of the reference point, in this step, obtaining the window coordinates of the transparent object P in the first restored image also obtains the first window coordinates of the reference point.
[0082] Step S2024: Based on the first window coordinates and the historical window coordinates, control the canvas component corresponding to the first restored image to move in the window coordinate system to obtain the restored first target image.
[0083] As an example, the canvas component corresponding to the first restored image can be identified as the moving object, and the entire canvas component can be dragged and moved. When the control reference point moves from the first window coordinates to the historical window coordinates, the movement is stopped, and the restored first target image is obtained. That is, the reference point in the restored first target image is located at the position corresponding to the historical window coordinates.
[0084] Alternatively, the movement distance and direction of the canvas component can be determined based on the coordinates of the first window and the historical window, and then the movement of the canvas component can be controlled based on the calculated movement distance and direction, so that the reference point in the restored first target image is located at the position corresponding to the historical window coordinates.
[0085] Since the canvas component is moved based on the coordinates of the form at two reference points, and the form and its coordinate system are fixed, the difference is also fixed and will not cause errors due to scaling or movement. This ensures that the determined movement distance is the distance required to maintain the view and thus maintains the view's display position.
[0086] To address the issue of schematic objects shifting in position on the canvas due to multiple scaling operations with different scaling centers, in some embodiments, the following steps can be performed after step S2022:
[0087] Step S2023': Obtain the first canvas coordinates and initial canvas coordinates of the reference point in the first restored image.
[0088] Here, when the reference point is a preset point at position (0,0) in the initial canvas, then the initial canvas coordinates of the reference point are (0,0).
[0089] Step S2024': Determine the difference coordinates between the first canvas coordinates and the initial canvas coordinates.
[0090] This difference is determined by subtracting the first canvas coordinate from the initial canvas coordinate. For example, if the initial canvas coordinate is (0,0) and the first canvas coordinate is (1,2), then the difference is (-1,-2).
[0091] Step S2025': When it is determined that the difference coordinates meet the movement conditions, control each display object in the first restored image to move in the canvas coordinate system according to the difference coordinates to obtain the second restored image.
[0092] As shown in step S2024', determining whether the difference coordinates meet the movement condition can be achieved by using the difference coordinates to determine the distance between the initial canvas coordinates and the first canvas coordinates, and then judging whether this distance is greater than a preset distance threshold, thereby determining whether the movement condition is met. Specifically, when the distance between the initial canvas coordinates and the first canvas coordinates is greater than the distance threshold, it indicates that the deviation between the initial canvas coordinates and the first canvas coordinates is large. In this case, the movement condition is determined to be met, and the various display objects in the first restored image are controlled to move in the canvas coordinate system according to the difference, thus obtaining the second restored image.
[0093] As an example, the canvas coordinates of each display object in the first restored image can be obtained first. Then, the canvas coordinates of each display object are summed with the difference coordinates to obtain the updated canvas coordinates of each display object. The display objects are then displayed at the updated canvas coordinates, which means that each display object moves in the canvas coordinate system according to the difference coordinates.
[0094] Step S2026': Based on the first window coordinates and the historical window coordinates, control the canvas component corresponding to the second restored image to move in the window coordinate system to obtain the restored first target image.
[0095] The reference point in the restored first target image is moved to the position corresponding to the historical window coordinates. Step S2026' is implemented similarly to step S2024, and the implementation process of step S2024 can be referred to.
[0096] Through the above steps S2023' to S2026', the problem of the position of the displayed object in the canvas shifting due to different zoom centers can be eliminated, and it can be ensured that the view will not have error shifts when zooming with different zoom centers and different zoom ratios, and when repeatedly switching pages.
[0097] In some embodiments, after step S204, the following steps may also be performed:
[0098] Step S205: Update the first processing parameters to the historical processing parameters of the processed first target image.
[0099] Since in steps S201 to S204, the first target image has been restored to the same scaling size as the initial state according to the historical processing parameters of the last display, and scaling processing has been performed according to the first processing parameters of the currently displayed image before switching pages, that is, the processing parameters of the first target image after processing are the first processing parameters, thus realizing the scaling ratio following.
[0100] Step S206: Determine the processed first target image as the currently displayed image.
[0101] After step S206, the process can return to step S201 to determine whether to switch pages again. If a page switching instruction is received again, steps S201 to S204 can be used to follow the zoom ratio and maintain the view position.
[0102] In some embodiments, after the processed first target image is presented according to the first processing parameters, if a scaling operation on the processed first target image is received, the historical processing parameters of the first target image will be updated in real time based on the received scaling operation. When the processed first target image is used as the current display image and a page switching instruction is received, the processing parameters of the current display image obtained at this time are the historical processing parameters updated in real time, and may not necessarily be the first processing parameters.
[0103] For example, if the first processing parameter is 2, then after steps S201 to S204, the processing parameter of the first target image after processing is also 2. However, after the first target image is displayed, it is scaled again, for example, it is enlarged once more. At this time, the current processing parameter of the first target image is updated to 3. When the page switching instruction is received, the first target image is the currently displayed image and the processing parameter is 3.
[0104] Based on the foregoing embodiments, this application further provides an image display method. Figure 4 This is a schematic diagram illustrating another implementation of the image display method provided in the embodiments of this application. The following is in conjunction with... Figure 4 The various steps of the image display method provided in the embodiments of this application will be described.
[0105] Step S401: Obtain the currently displayed image and the first processing parameters of the currently displayed image.
[0106] Step S402: When a second selection operation is received for the display object identifier, it is determined that an object jump instruction has been received.
[0107] Step S403: In response to the object jump operation, determine the second target image.
[0108] In this step, the second image identifier corresponding to the display object identifier is first determined, and then the image corresponding to the second image identifier is determined as the second target image.
[0109] Step S404: Determine whether the second target image is the currently displayed image.
[0110] When the second target image is not the currently displayed image, proceed to step S405; when the second target image is the currently displayed image, proceed to step S409.
[0111] Step S405: Obtain the second historical processing parameters of the last time the second target image was displayed.
[0112] In this step, the second historical processing parameters of the second target image that were previously displayed can be obtained from a three-dimensional array that stores the correspondence between image identifiers and processing parameters, based on the second image identifier.
[0113] Step S406: Based on the second historical processing parameters, perform restoration processing on the second target image to obtain the restored second target image.
[0114] In the restored second target image, the target display object corresponding to the display object identifier is located at the center of the window, and the restored second target image has the same size as the second target image in the initial state.
[0115] Step S407: Using the location of the target display object as the scaling center, process the restored second target image based on the first processing parameters to obtain the processed second target image.
[0116] Since the target object is displayed in the center of the window in the restored second target image, the scaling in this step is performed with the location of the target object as the scaling center, according to the first processing parameters, so that the target object can still be displayed in the center in the processed second target image.
[0117] Step S408: Display the processed second target image.
[0118] Step S409: Obtain the coordinates of the third window of the target display object in the currently displayed image.
[0119] Step S410: Based on the third window coordinates, control the canvas component corresponding to the currently displayed image to move in the window coordinate system to obtain the moved current displayed image.
[0120] Specifically, in the moved current display image, the target display object is located at the center of the window. This step can be implemented by determining the movement distance and direction of the canvas component based on the third window coordinates and the window center coordinates. Then, based on the calculated movement distance and direction, the canvas component is controlled to move, ultimately ensuring that the target display object is located at the center of the window in the moved current display image.
[0121] Step S411: Display the current image after the movement.
[0122] Through the above steps S401 to S411, when a second selection operation for the display object identifier is received, it is determined that an object jump instruction has been received. In response to the object jump instruction, a second target image is determined. If the second target image is not the currently displayed image, the second historical processing parameters of the last display of the second target image are obtained, and the second target image is restored based on the second historical processing parameters to obtain the restored second target image. In the restored second target image, the target display object corresponding to the display object identifier is located at the center of the window. Then, with the location of the target display object as the scaling center, the restored second target image is scaled based on the first processing parameters to obtain the processed second target image, and the processed second target image is displayed. This ensures that the scaling ratio of the second target display image follows the scaling ratio of the image before the object jump, and also ensures that the target display object is displayed in the center. In the case of the second target image being the currently displayed image, the canvas component is dragged directly to make the target display object stand out in the center, thereby improving image inspection efficiency.
[0123] In some embodiments, the above step S406, "based on the second historical processing parameters, performing restoration processing on the second target image to obtain the restored second target image," can be implemented through the following steps:
[0124] Step S4061: Determine the second restoration processing parameters for the second target image based on the second historical processing parameters.
[0125] Specifically, when the processing parameter is the scaling ratio, the second historical processing parameter and the second recovery processing parameter are reciprocals of each other; when the processing parameter is the scaling number, the second historical processing parameter and the second recovery processing parameter are opposites of each other.
[0126] Step S4062: Process the second target image using the second restoration processing parameters to obtain the third restored image.
[0127] In this step, the second target image is scaled according to the second restoration processing parameters with the center of the canvas as the scaling center to obtain the third restored image, wherein the size of the third restored image is the same as that of the second target image in the initial state.
[0128] Step S4063: Obtain the second window coordinates of the target display object corresponding to the display object identifier in the third restored image.
[0129] Step S4064: Based on the second window coordinates, control the canvas component corresponding to the third restored image to move in the window coordinate system to obtain the restored second target image, in which the target display object is located at the center of the window.
[0130] As an example, the canvas component corresponding to the third restored image can be identified as the moving object. The entire canvas component can be dragged and moved. When the target display object is moved from the second window coordinates to the center coordinates of the window, the movement is stopped, and the restored second target image is obtained. That is, the target display object is located in the center of the window in the restored second target image.
[0131] Alternatively, the movement distance and direction of the canvas component can be determined based on the coordinates of the second window and the center coordinates of the window. Then, the movement of the canvas component can be controlled based on the calculated movement distance and direction. Ultimately, this can also ensure that the target display object in the restored second target image is located in the center of the window, thus ensuring that when scaling with the target display object as the scaling center after obtaining the restored second target image, the target display object can be displayed in the center.
[0132] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0133] This application provides an image display method capable of displaying images following at least four operation commands, including zoom, drag, page switching, and object navigation commands. Zooming and dragging are operation commands targeting the currently displayed image page, operating on the canvas and affecting its coordinate system scale and relative window position. Page switching and object navigation implement interactive commands between image pages, with object navigation ultimately centering and highlighting the image within the window.
[0134] Figure 5 This is a schematic diagram illustrating another implementation flow of the image display method provided in the embodiments of this application, as shown below. Figure 5 As shown, the process includes:
[0135] Step S501: In response to the operation of opening the schematic file, image data is acquired.
[0136] Step S502: Initialize the display of the first page and obtain the current page number variable value.
[0137] In this embodiment, the variable KK is always assigned the current page number, at which point KK = 1.
[0138] Step S503: Initialize global variable C, create multidimensional array D, and create transparent object P at point (0,0) on the canvas.
[0139] During program initialization, a global variable C is created for the schematic file to record the number of zooms. In the initial canvas state, C = 0. Simultaneously, a multidimensional array D is created to associate the page number, the zoom count for that page, and the window coordinates of the transparent object P. Since the window coordinate system and the canvas coordinate system coincide in the initial state, the initial window coordinates of the transparent object are also (0,0).
[0140] Step S504: Determine the type of the received user operation instruction.
[0141] The type of operation instruction can be at least one of zoom instruction, drag instruction, page switching instruction, and object jump instruction.
[0142] Step S505: Confirm that a scaling command has been received.
[0143] Step S506: Determine whether the scaling instruction is an enlargement instruction.
[0144] In implementation, the direction of the mouse wheel's movement can be used to determine whether it is a zoom-in command. For example, if the mouse wheel's movement direction is preset to be upward, the received zoom command can be determined to be a zoom-in command. This step can be implemented by determining whether the mouse wheel's movement direction is upward. If the mouse wheel's movement direction is determined to be upward, the received zoom command is determined to be a zoom-in command, and then the process proceeds to step S507. Conversely, if the mouse wheel's movement direction is determined to be downward, the received zoom command is determined to be a zoom-out command, and then the process proceeds to step S508.
[0145] In some embodiments, when the terminal's display screen is a touch screen, the scaling instruction can be determined as a zoom instruction based on the sliding direction of the touch operator. Taking a finger as an example, if the sliding direction of two fingers is away from each other, then the received scaling instruction is determined to be a zoom instruction; if the sliding direction of two fingers is close to each other, then the received scaling instruction is determined to be a zoom instruction.
[0146] Step S507: Zoom in on the view at a fixed magnification with the pointer position as the zoom center, and record C = C + 1.
[0147] When the zoom command is triggered by moving the mouse, the pointer position can be the location of the mouse cursor. When the zoom command is triggered by sliding a finger, the pointer position can be the midpoint of the line connecting the initial points of action of the two fingers when the zoom operation is triggered.
[0148] In this embodiment, the example is to scale the current canvas by a fixed factor each time a scaling command is received. In some embodiments, the scaling factor can also be determined based on the distance the mouse or finger slides after receiving the scaling command.
[0149] Step S508: Zoom out the view by a fixed factor with the pointer position as the zoom center, and record C = C-1.
[0150] Step S509: Associate the current display page zoom count with the page number.
[0151] In this embodiment, the scaling ratio of the current page and the page number are associated in array D through the variable KK, thereby recording the scaling of each page. For example, in a 5-page schematic diagram, if each page is in its initial state, the format of array D is {[1,0],[2,0],[3,0],[4,0],[5,0]}. If the first page is zoomed in twice, then array D becomes {[1,2],[2,0],[3,0],[4,0],[5,0]}.
[0152] Step S510: Display the KK page view.
[0153] After step S510, you can proceed to step S504 again.
[0154] Step S511: Confirm that a page switching instruction has been received. Before executing the page switching, record the window coordinates P1 of the object P on the previous page, and associate the window coordinates P1 with KK and record them in array D.
[0155] Before each page switch, the form coordinates P1(Z1,Q1) of the object P in the previous page view are associated with the page number and recorded in array D for position recording.
[0156] Step S512: Update KK to the page number that needs to be switched.
[0157] This also means updating KK to the page number to be displayed after the switch.
[0158] Step S513: Invoke the first view recovery module.
[0159] During implementation, the first view restoration module is called to restore the image that needs to be page-switched (i.e., the image displayed after the page switch). The restored view is not scaled compared to the initial view, and the position of the transparent object P is the same as the position of the image displayed after the page switch was last viewed.
[0160] Step S514: Determine whether the value of variable C corresponding to the page number before the switch is greater than 0.
[0161] When the value of variable C is greater than 0, it means that the view of the page number before the switch has been enlarged, and then proceed to step S515; when the value of variable C is less than 0, it means that the view of the page number before the switch has been reduced, and then proceed to step S516.
[0162] Step S515: Using the canvas as the scaling center, zoom in C times at a fixed factor.
[0163] Step S516: Using the canvas as the scaling center, scale down C times by a fixed factor.
[0164] It should be noted that steps S509 and S510 can be executed after step S516.
[0165] In the view zoom command, the user can zoom the view to a certain ratio according to their needs. Using the image display method provided in this application embodiment, after the page is switched, the display ratio of the switched page also maintains the same zoom ratio as the previous page view, thereby realizing the zoom following effect in view switching.
[0166] Step S517: Confirm that an object jump instruction has been received.
[0167] In this embodiment of the application, the object jump instruction may be triggered by clicking on the object identifier of object Q on a certain page.
[0168] Step S518: Obtain the page number of the drawing page to which object Q belongs.
[0169] Step S519: Update KK to the page number of the drawing page to which object Q belongs.
[0170] Step S520: Invoke the second view recovery module.
[0171] By calling the second recovery module, the page number of the page to which object Q belongs is restored. The restored view is not scaled compared to the initial view of the page, but object Q is located in the center of the form.
[0172] Step S521: Determine whether the value of variable C corresponding to the page number before the jump is greater than 0.
[0173] When the value of variable C is greater than 0, proceed to step S522; when the value of variable C is less than 0, proceed to step S523.
[0174] Step S522: Using object Q as the scaling center, scale it up C times by a fixed factor.
[0175] Step S523: Using object Q as the scaling center, scale down C times by a fixed factor.
[0176] In steps S522 and S523, since the scaling process is performed with object Q as the scaling center, it can be ensured that object Q is still in the center of the window in the processed view. This achieves the scaling ratio following the object and the object to be viewed being in the center of the window when jumping between objects, thereby improving the viewing efficiency of the schematic diagram.
[0177] It should be noted that steps S509 and S510 can be executed after step S523.
[0178] Step S524: Confirm that a drag command has been received.
[0179] Step S525: Drag the mouse according to its position.
[0180] After step S525, step S510 can be executed.
[0181] During view operation, the drag command changes the position of the canvas relative to the window, causing the relative position of the two coordinate systems to change. Similarly, the zoom command will cause the position of the schematic object C in the canvas to shift due to different zoom centers. When the page switching is repeatedly executed at different zoom ratios, the view will have an error offset. In this embodiment, the above problem can be solved by using a view restoration module. Figure 6 This is a schematic diagram illustrating the implementation process of the first view restoration module provided in the embodiments of this application. The following is in conjunction with... Figure 6 Each step is explained.
[0182] Step S601: Obtain the value of the page number variable KK.
[0183] Step S602: Based on KK and array D, obtain the number of times the KK page was scaled, D1, and the window coordinates P1(Z1,Q1) of object P when the KK page view was last displayed.
[0184] Step S603: Determine whether D1 is greater than 0.
[0185] Upon receiving an instruction to switch interfaces, the canvas size of the page to be switched is first restored to its initial state. This achieves fixed-point scaling during view-holding, meaning the view is first restored and then zoomed in or out centered on the desired zoom level. If D1 is greater than 0, it means the view of page KK was previously zoomed in. To restore the view to its initial state, step S604 is executed to zoom out. If D1 is less than or equal to 0, it means the view of page KK was previously zoomed out. To restore the view to its initial state, step S605 is executed to zoom in.
[0186] Step S604: Using the center of the canvas as the scaling center, reduce the size by a fixed factor C times.
[0187] Step S605: Using the center of the canvas as the scaling center, zoom in C times at a fixed factor.
[0188] Step S606: Obtain the canvas coordinates (X,Y) and window coordinates (Z,Q) of object P.
[0189] Step S607: Execute the MOVE command with all schematic objects on the canvas as the target, and move the distance (0-X, 0-Y).
[0190] During scaling, different scaling centers can cause the schematic objects to shift in position on the canvas. In the aforementioned steps, a transparent object P was created on the canvas and used as a reference point. When the canvas coordinates of the transparent object P are determined to be (X,Y), it means that the objects on the canvas have shifted by (0-X,0-Y). Therefore, in step S607, all schematic objects on the canvas are controlled to execute the MOVE command, and the movement distance is (0-X,0-Y), which can restore the objects in the schematic to their unshifted state.
[0191] Step S608: Execute a drag command with the canvas as the target, dragging coordinates from (Z,Q) to (Z1,Q1).
[0192] Since (Z,Q) and (Z1,Q1) are both window coordinates of the transparent object P, and the window and its coordinate system are fixed, their difference is constant and will not be affected by scaling or movement. This difference is the distance required to maintain the view position. Therefore, this step involves dragging the entire canvas, specifically dragging the transparent object P from window coordinates (Z,Q) to (Z1,Q1), thus maintaining the view position.
[0193] It should be noted that the implementation process of calling the second view restoration module in step S520 is similar to the implementation process of calling the first view restoration module (steps S601 to S608 above). The difference is that in calling the second view restoration module, after executing steps S601 to S605, the canvas coordinates of the transparent object P and the window coordinates of the object Q are obtained. Then, the MOVE command is executed with all schematic objects on the canvas as the target, and the movement distance is (0-X, 0-Y). The most crucial point is that when the drag command is executed with the canvas as the target, the object Q is dragged from the window coordinates (Z, Q) to the center coordinates of the window, thereby ensuring that the object Q is displayed in the center of the window, so as to achieve the final effect that the object Q is highlighted in the center of the window.
[0194] Figure 7 This is a schematic diagram illustrating the application of the image display method provided in the embodiments of this application. Figure 7As shown, in the first page view, after zooming once and dragging, object 701 is displayed in the center. Switching to the second page, zooming the second page view twice, and dragging object 701 to the lower left corner of the second page, and then returning to the first page, the position of object 701 remains unchanged and is still displayed in the center, but the zoom ratio follows the second page, zooming twice, thus achieving zoom following and view position maintenance.
[0195] The image display method provided in this application embodiment enables the scaling ratio to follow the display during schematic diagram viewing, satisfying user habits. After dragging and zooming the view, and then switching pages and returning, the view position is maintained, thereby improving the flexibility and efficiency of schematic diagram viewing.
[0196] See Figure 8 , Figure 8 This is a schematic diagram of the structure of the computer device 800 provided in an embodiment of this application. Figure 8 The computer device 800 shown includes at least one processor 810, a memory 850, at least one network interface 820, and a user interface 830. The various components in the computer device 800 are coupled together via a bus system 840. It is understood that the bus system 840 is used to implement communication between these components. In addition to a data bus, the bus system 840 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 8 The general labeled all buses as Bus System 840.
[0197] The processor 810 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0198] User interface 830 includes one or more output devices 831 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 830 also includes one or more input devices 832, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0199] The memory 850 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 810.
[0200] The memory 850 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 850 described in this application embodiment is intended to include any suitable type of memory.
[0201] In some embodiments, memory 850 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0202] The operating system 851 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, for implementing various basic business functions and handling hardware-based tasks.
[0203] The network communication module 852 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 820 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0204] The input processing module 853 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.
[0205] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A special effects prop processing device 854 stored in memory 850 is shown, which can be software in the form of programs and plug-ins, such as... Figure 8 The image display device 854 shown includes:
[0206] The first acquisition module 8541 is used to respond to the page switching operation, determine the first processing parameters of the currently displayed image and the first target image, and acquire the historical window coordinates of the reference point when the first target image was last displayed;
[0207] The first recovery module 8542 is used to perform recovery processing on the first target image based on the historical window coordinates to obtain the recovered first target image;
[0208] The first processing module 8543 is used to process the recovered first target image based on the first processing parameters to obtain the processed first target image;
[0209] The first display module 8544 is used to display the processed first target image.
[0210] In some embodiments, the device further includes:
[0211] The second acquisition module is used to acquire a file to be displayed, wherein the file to be displayed includes at least two images to be displayed.
[0212] The third acquisition module is used to acquire the historical processing parameters corresponding to each image to be displayed in the file to be displayed and the historical window coordinates of the reference points in each image to be displayed.
[0213] The second display module is used to respond to the first operation of opening a file to be displayed, determine the first image to be displayed, and display the first image on the canvas component based on the historical processing parameters corresponding to the first image and the historical window coordinates of the reference point;
[0214] The first determining module is configured to determine a first adjustment parameter corresponding to the first adjustment operation if a first adjustment operation for the first image is received, wherein the first adjustment operation includes at least one of a scaling operation and a moving operation.
[0215] The adjustment module is used to adjust the first image based on the first adjustment parameters to obtain the adjusted first image, and to determine the adjusted first image as the currently displayed image.
[0216] In some embodiments, the first adjustment parameter includes at least one of a scaling adjustment parameter and a canvas component movement parameter; correspondingly, the device further includes:
[0217] The first update module is used to update the historical processing parameters of the first image using the scaling adjustment parameters to obtain the updated processing parameters; and / or,
[0218] The second update module is used to update the historical window coordinates of the reference point in the first image using the movement parameters of the canvas component, so as to obtain the updated historical window coordinates.
[0219] In some embodiments, the device further includes:
[0220] The second determining module is configured to, upon receiving a first selection operation for a first image identifier corresponding to an image other than the currently displayed image, determine that a page switching operation has been received, and correspondingly,
[0221] The first acquisition module also includes:
[0222] The first determining unit is configured to, in response to the page switching instruction, determine the first processing parameters of the currently displayed image and determine the image corresponding to the first image identifier as the first target image;
[0223] The first acquisition unit is used to acquire the historical window coordinates of the reference point when the first target image was last displayed, based on the first image identifier.
[0224] In some embodiments, the first recovery module further includes:
[0225] The second determining unit is used to obtain the first historical processing parameters when the first target image was last displayed, and to determine the first restoration processing parameters of the first target image based on the first historical processing parameters.
[0226] The first processing unit is configured to process the first target image using the first restoration processing parameters to obtain a first restored image;
[0227] The second acquisition unit is used to acquire the first window coordinates of the reference point in the first restored image;
[0228] The first moving unit is used to control the canvas component corresponding to the first restored image to move in the window coordinate system based on the first window coordinates and the historical window coordinates to obtain the restored first target image, wherein the reference point in the restored first target image is located at the position corresponding to the historical window coordinates.
[0229] In some embodiments, the device further includes:
[0230] The fourth acquisition module is used to acquire the first canvas coordinates and the initial canvas coordinates of the reference point in the first restored image;
[0231] The third determining module is used to determine the difference coordinates between the first canvas coordinates and the initial canvas coordinates;
[0232] The first control module is used to control each display object in the first restored image to move in the canvas coordinate system according to the difference coordinates when it is determined that the difference coordinates meet the movement conditions, so as to obtain the second restored image;
[0233] The second control module is used to control the canvas component corresponding to the second restored image to move in the window coordinate system based on the first window coordinates and the historical window coordinates to obtain the restored first target image, wherein the reference point in the restored first target image moves to the position corresponding to the historical window coordinates.
[0234] In some embodiments, the first processing unit described above is further configured to:
[0235] Using the center of the canvas as the scaling center, the restored first target image is processed according to the first processing parameters to obtain the processed first target image.
[0236] In some embodiments, the device further includes:
[0237] The fourth determining module is used to determine that an object jump instruction has been received when a second selection operation targeting the display object identifier is received;
[0238] The fifth determining module is used to determine the second target image in response to the object jump instruction;
[0239] The fifth acquisition module is used to acquire the second historical processing parameters of the last time the second target image was displayed if the second target image is not the currently displayed image;
[0240] The second recovery module is used to perform recovery processing on the second target image based on the second historical processing parameters to obtain the recovered second target image, wherein the target display object corresponding to the display object identifier in the recovered second target image is located at the center of the window;
[0241] The second processing module is used to process the restored second target image based on the first processing parameters, with the location of the target display object as the scaling center, to obtain the processed second target image;
[0242] The second display module is used to display the processed second target image.
[0243] In some embodiments, the device further includes:
[0244] The sixth acquisition module is used to acquire the third window coordinates of the target display object in the current display image if the second target image is the currently displayed image;
[0245] The third control module is used to control the canvas component corresponding to the currently displayed image to move in the window coordinate system based on the third window coordinates, so as to obtain the moved current display image;
[0246] The third display module is used to display the current image after the movement.
[0247] In some embodiments, the second recovery module further includes:
[0248] The third determining unit is used to determine the second restoration processing parameters of the second target image based on the second historical processing parameters;
[0249] The second processing unit is used to process the second target image using the second restoration processing parameters to obtain a third restored image;
[0250] The third acquisition unit is used to acquire the second window coordinates of the target display object corresponding to the display object identifier in the third restored image;
[0251] The second moving unit is used to control the canvas component corresponding to the third restored image to move in the window coordinate system based on the second window coordinates to obtain the restored second target image, wherein the target display object in the restored second target image is located at the center of the window.
[0252] In some embodiments, the device further includes:
[0253] The sixth determining module is used to update the first processing parameters to the historical processing parameters of the processed first target image;
[0254] The seventh determining module is used to determine the processed first target image as the currently displayed image.
[0255] It should be noted that the description of the image display device in this application is similar to the description of the method embodiments described above, and has similar beneficial effects. For technical details not disclosed in this device embodiment, please refer to the description of the method embodiments in this application for understanding.
[0256] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image display method described in this application.
[0257] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the image display method provided in this application. For example, ... Figure 2 , Figure 3 , Figure 4 and Figure 5 The method shown.
[0258] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEP ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0259] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0260] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0261] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0262] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0263] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0264] In the several embodiments provided in this application, it should be understood that the disclosed cloud computing devices and methods can be implemented in other ways. The cloud computing device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0265] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0266] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0267] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0268] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an AC to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0269] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image display method, characterized in that, The method includes: In response to the received page switching instruction, the first processing parameters of the currently displayed image and the first target image are determined, and the historical window coordinates of the reference point when the first target image was last displayed are obtained; wherein, the first target image is the image to be displayed after the switch; Obtain the first historical processing parameters from the last time the first target image was displayed, and determine the first restoration processing parameters for the first target image based on the first historical processing parameters; The first target image is processed using the first restoration processing parameters to obtain a first restored image; the first restored image has the same scaling size as the first target image in its initial state. Obtain the first window coordinates of the reference point in the first restored image; Based on the first window coordinates and the historical window coordinates, the canvas component corresponding to the first restored image is controlled to move in the window coordinate system to obtain the restored first target image. The reference point in the restored first target image is located at the position corresponding to the historical window coordinates. The recovered first target image is processed based on the first processing parameters to obtain the processed first target image; The processed first target image is displayed.
2. The method according to claim 1, characterized in that, The method further includes: Obtain a file to be displayed, wherein the file to be displayed includes at least two images to be displayed; Obtain the historical processing parameters corresponding to each image to be displayed in the file to be displayed and the historical window coordinates of the reference points in each image to be displayed; In response to the first operation of opening a file to be displayed, a first image to be displayed is determined, and the first image is displayed on the canvas component based on the historical processing parameters corresponding to the first image and the historical window coordinates of the reference point; If a first adjustment operation is received for the first image, determine the first adjustment parameter corresponding to the first adjustment operation, wherein the first adjustment operation includes at least one of a scaling operation and a moving operation; The first image is adjusted based on the first adjustment parameter to obtain the adjusted first image, and the adjusted first image is determined as the currently displayed image.
3. The method according to claim 1 or 2, characterized in that, The method further includes: When a first selection operation is received for a first image identifier corresponding to an image other than the currently displayed image, it is determined that a page switching instruction has been received. Correspondingly, In response to the page switching instruction, determining the first processing parameters of the currently displayed image and the first target image, and obtaining the historical window coordinates of the reference point when the first target image was last displayed, includes: In response to the page switching instruction, determine the first processing parameters of the currently displayed image; The image corresponding to the first image identifier is identified as the first target image; Based on the first image identifier, obtain the historical window coordinates of the reference point when the first target image was last displayed.
4. The method according to claim 1, characterized in that, The method further includes: Obtain the first canvas coordinates and initial canvas coordinates of the reference point in the first restored image; Determine the difference coordinates between the first canvas coordinates and the initial canvas coordinates; When it is determined that the difference coordinates meet the movement conditions, the display objects in the first restored image are controlled to move in the canvas coordinate system according to the difference coordinates to obtain the second restored image; Based on the first window coordinates and the historical window coordinates, the canvas component corresponding to the second restored image is controlled to move in the window coordinate system to obtain the restored first target image. The reference point in the restored first target image is moved to the position corresponding to the historical window coordinates.
5. The method according to claim 1 or 2, characterized in that, The method further includes: When a second selection operation is received for the display object identifier, it is determined that an object jump instruction has been received; In response to the object jump command, a second target image is determined; If the second target image is not the currently displayed image, obtain the second historical processing parameters of the last time the second target image was displayed; Based on the second historical processing parameters, the second target image is restored to obtain the restored second target image. The target display object corresponding to the display object identifier in the restored second target image is located at the center of the window. Using the location of the target display object as the scaling center, the recovered second target image is processed based on the first processing parameters to obtain the processed second target image; The processed second target image is displayed.
6. The method according to claim 5, characterized in that, The method further includes: If the second target image is the currently displayed image, obtain the third window coordinates of the target display object in the currently displayed image; Based on the third window coordinates, the canvas component corresponding to the currently displayed image is moved in the window coordinate system to obtain the moved current displayed image; Displays the current image after the movement.
7. The method according to claim 6, characterized in that, The step of restoring the second target image based on the second historical processing parameters to obtain the restored second target image includes: The second restoration processing parameters for the second target image are determined based on the second historical processing parameters. The second target image is processed using the second restoration processing parameters to obtain a third restored image; Obtain the second window coordinates of the target display object corresponding to the display object identifier in the third restored image; Based on the second window coordinates, the canvas component corresponding to the third restored image is moved in the window coordinate system to obtain the restored second target image, in which the target display object is located at the center of the window.
8. An image display device, characterized in that, The image display device includes: The first acquisition module is used to respond to the page switching operation, determine the first processing parameters of the currently displayed image and the first target image, and acquire the historical window coordinates of the reference point when the first target image was last displayed; wherein, the first target image is the image to be displayed after the switch; A first restoration module is configured to acquire first historical processing parameters from the last time the first target image was displayed, and determine first restoration processing parameters for the first target image based on the first historical processing parameters; process the first target image using the first restoration processing parameters to obtain a first restored image; the first restored image has the same scaling size as the first target image in its initial state; acquire first window coordinates of the reference point in the first restored image; and control the canvas component corresponding to the first restored image to move in the window coordinate system based on the first window coordinates and the historical window coordinates to obtain the restored first target image, wherein the reference point in the restored first target image is located at the position corresponding to the historical window coordinates; The first processing module is used to process the recovered first target image based on the first processing parameters to obtain the processed first target image; The first display module is used to display the processed first target image.
9. A computer device, characterized in that, The computer device includes: Processor; and Memory for storing computer programs that can run on the processor; When the computer program is executed by the processor, it implements the image display method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Focus display method and device, and computer-readable storage medium
CN107835450A
Image display processing method and system, storage medium and mobile terminal
CN111343335A
Image labeling method and device
CN111367445A
Virtual object control method, device and equipment and medium
CN111589142A
