Media content scaling method and device, storage medium, and program product

WO2026201050A1PCT designated stage Publication Date: 2026-10-01BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/086204
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-26
Filing Date
2026-03-26
Publication Date
2026-10-01

Smart Images

  • Figure CN2026086204_01102026_PF_FP_ABST
    Figure CN2026086204_01102026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a media content scaling method and device, a storage medium, and a program product. The media content scaling method comprises: acquiring an initial two-finger touch point position and a current two-finger touch point position of a two-finger touch gesture for media content scaling; determining an initial bounding rectangle of the initial two-finger touch point position and a current bounding rectangle of the current two-finger touch point position, respectively, and determining a scaling ratio according to the initial bounding rectangle and the current bounding rectangle, wherein an aspect ratio of either of the bounding rectangles is a predefined aspect ratio, a center of the bounding rectangle coincides with a center of the corresponding two-finger touch point position, and the corresponding two-finger touch point position is located on an edge of the bounding rectangle; determining a third displacement according to the initial two-finger touch point position, the current two-finger touch point position, and the scaling ratio; and scaling and moving media content according to the scaling ratio and the third displacement.
Need to check novelty before this filing date? Find Prior Art

Description

Media content scaling methods, devices, storage media and program products

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202510368666.0, filed on March 26, 2025, the disclosure of which is incorporated herein by reference in its entirety. Technical Field

[0003] At least one embodiment of this disclosure relates to a media content scaling method, apparatus, storage medium, and program product. Background Technology

[0004] When displaying media content such as videos on a terminal device, the media content can usually be scaled. One way to interact with this content is to use a two-finger touch gesture on the touch screen of the terminal device to scale the media content. During the two-finger touch gesture, the media content follows the movement of the fingers and the size of the media content scales with the pinch of the fingers.

[0005] Currently, zooming in and out of media content using two-finger touch gestures is based on real-time calculation of the response transformation amount, including displacement and zoom ratio, according to the coordinates of the two-finger touch points. However, the calculation cost is high when calculating the zoom ratio, which consumes the computing resources of the terminal device and has low processing efficiency, thus reducing the response speed. Summary of the Invention

[0006] At least one embodiment of this disclosure provides a media content scaling method, apparatus, storage medium, and program product.

[0007] In a first aspect, at least one embodiment of this disclosure provides a media content scaling method, comprising:

[0008] Get the initial two-finger touch position and the current two-finger touch position for scaling the target media content;

[0009] The initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position are determined respectively, and the target scaling ratio of the target media content is determined based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle;

[0010] The target displacement of the target media content is determined based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0011] The target media content is scaled and moved according to the target scaling ratio and the target displacement, and the scaled and moved target media content is displayed.

[0012] Secondly, at least one embodiment of this disclosure provides a media content scaling device, comprising:

[0013] The acquisition unit is used to acquire the initial two-finger touch point position and the current two-finger touch point position of the two-finger touch gesture for scaling the target media content;

[0014] The scaling ratio determination unit is used to determine the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and to determine the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle;

[0015] The displacement determination unit is used to determine the target displacement amount of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0016] An execution unit is configured to scale and move the target media content according to the target scaling ratio and the target displacement, and display the scaled and moved target media content.

[0017] Thirdly, at least one embodiment of this disclosure provides an electronic device, including: a processor and a memory;

[0018] The memory stores computer-executed instructions;

[0019] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the media content scaling method as described in the first aspect and various possible designs of the first aspect.

[0020] Fourthly, at least one embodiment of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the media content scaling method described in the first aspect and various possible designs of the first aspect.

[0021] Fifthly, at least one embodiment of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the media content scaling method as described in the first aspect and various possible designs of the first aspect. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in at least one embodiment of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 is a schematic diagram of a media content scaling method;

[0024] Figure 2 is a schematic flowchart of a media content scaling method provided in an embodiment of this disclosure;

[0025] Figure 3 is a schematic diagram of a media content scaling method provided in an embodiment of this disclosure;

[0026] Figure 4 is a schematic diagram of the current bounding rectangle of a media content scaling method provided in an embodiment of this disclosure;

[0027] Figure 5 is a schematic diagram of the current bounding rectangle of a media content scaling method provided in another embodiment of this disclosure;

[0028] Figure 6 is a structural block diagram of a media content scaling device provided in an embodiment of this disclosure; and

[0029] Figure 7 is a schematic diagram of the hardware structure of a media content scaling device provided in an embodiment of this disclosure. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of at least one embodiment of this disclosure clearer, the technical solutions of at least one embodiment of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0031] Currently, one way to zoom in and out of media content is to use a two-finger touch gesture (pinch gesture) on the touch screen of a terminal device. During the two-finger touch gesture, the media content follows the movement of the fingers, and the size of the media content is adjusted according to the pinch gesture.

[0032] Zooming in and out of media content using two-finger touch gestures is achieved by calculating the corresponding transformation amount in real time based on the coordinates of the two-finger touch points, including displacement and zoom ratio.

[0033] The displacement of the center point of the line connecting the two finger touches is also applied to the displacement of media content, enabling the media content to move with the hand.

[0034] Calculate the scaling ratio of the two-finger touch line, scale the media content by the same ratio, and offset it additionally (ensure that the scaling is centered on the center point of the two-finger touch line) to achieve scaling of the media content relative to the center point of the two-finger touch line, as shown in Figure 1.

[0035] However, when calculating the scaling ratio, the scaling ratio of the line connecting the two finger touches needs to be calculated using the Pythagorean theorem based on the coordinates of the two finger touches, that is:

[0036] Among these methods, relying on square root operations, especially for computationally intensive tasks like gestures, results in high computational costs, consumes the computing resources of terminal devices, and has low processing efficiency, thus reducing response speed.

[0037] To address the aforementioned technical issues, at least one embodiment of this disclosure provides a method for scaling media content. Considering the high cost of square root operations, at least one embodiment of this disclosure no longer uses the scaling ratio of the line connecting the two-finger touch points as the scaling ratio of the media content. Instead, it uses the circumscribed rectangle of the two-finger touch point position to determine the scaling ratio. This avoids square root operations, reduces computational costs, decreases the consumption of computational resources, improves processing efficiency, and thereby enhances the response speed to two-finger touch gestures.

[0038] Specifically, the process involves obtaining the initial and current two-finger touch positions of a two-finger touch gesture for scaling the target media content; determining the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position; and determining the target scaling ratio of the target media content based on the initial and current bounding rectangles. The aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, with the corresponding two-finger touch position located on the edge of the bounding rectangle. Based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio, the target displacement of the target media content is determined. The target media content is then scaled and moved according to the target scaling ratio and the target displacement, and the scaled and moved target media content is displayed.

[0039] The media content scaling method of this disclosure will be described in detail below with reference to specific embodiments.

[0040] Referring to Figure 2, which is a schematic flowchart of a media content scaling method according to an embodiment of this disclosure, the method of this embodiment can be applied to any electronic device such as a terminal device or a server. The media content scaling method includes:

[0041] S201. Obtain the initial two-finger touch point position and the current two-finger touch point position for the two-finger touch gesture for scaling the target media content.

[0042] In this embodiment, when the electronic device displays any target media content such as images, videos, and text, the user can zoom in and out of the target media content using a two-finger touch gesture. This two-finger touch gesture is a pinch gesture, involving the relative or opposite movement of two fingers. Simultaneously, the two fingers may translate and / or rotate. The electronic device can capture the initial and current two-finger touch positions of the two-finger gesture. The initial two-finger touch position can be the two-finger touch position corresponding to the target media content to be zoomed in (i.e., the zoom reference). If zooming starts from the original size of the target media content, the initial two-finger touch position can be the two-finger touch position at the start of the two-finger touch gesture. Of course, if further zooming is needed on the target media content that has been zoomed in at a certain moment during the two-finger touch gesture, the initial two-finger touch position can also be the two-finger touch position at that moment during the two-finger touch gesture. Since the media content needs to follow the finger movement and the media content size needs to be zoomed in and out with the pinch gesture, the current two-finger touch position also needs to be captured.

[0043] S202. Determine the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position respectively, and determine the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle.

[0044] In this embodiment, to avoid using the length of the two-finger touch line as a reference for calculating the scaling ratio, circumscribed rectangles are constructed for the initial two-finger touch position and the current two-finger touch position, denoted as the initial circumscribed rectangle and the current circumscribed rectangle. Both circumscribed rectangles have the same aspect ratio (a preset aspect ratio), and the center of the circumscribed rectangle coincides with the center of the corresponding two-finger touch position (i.e., the center of the line connecting the two-finger touch positions). The corresponding two-finger touch position is located on the edge of the circumscribed rectangle, as shown in Figure 3. The centers coincide, and the initial two-finger touch position is located on the edge of the initial bounding rectangle; while the center of the current bounding rectangle coincides with the center of the current two-finger touch position, and the current two-finger touch position is located on the edge of the current bounding rectangle; thus, the target scaling ratio of the target media content can be determined based on the initial bounding rectangle and the current bounding rectangle, which avoids using the length of the two-finger touch line as a reference to calculate the scaling ratio, that is, it avoids square root calculation. After removing the necessary division to calculate the ratio, only addition, subtraction and multiplication operations are used, which is an order of magnitude smaller in performance overhead than square root calculation.

[0045] Optionally, the preset aspect ratio can be any aspect ratio, which can be set according to the actual situation. Using the aspect ratio of the target media content will control the scaling effect better.

[0046] Optionally, the target scaling ratio of the target media content is determined based on the initial bounding rectangle and the current bounding rectangle. This can be done by using the similarity ratio between the current bounding rectangle and the initial bounding rectangle as the target scaling ratio, or by using the ratio of a certain side of the current bounding rectangle and the initial bounding rectangle as the target scaling ratio, or by using the area ratio between the current bounding rectangle and the initial bounding rectangle as the target scaling ratio, or by using other methods to determine the target scaling ratio based on the initial bounding rectangle and the current bounding rectangle. This embodiment does not impose any limitations, as long as square root operations are avoided, and division operations can be further minimized.

[0047] S203. Determine the target displacement of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0048] In this embodiment, to ensure that the target media content follows the finger movement during a two-finger touch gesture, it is necessary to determine the target displacement of the target media content. Besides the movement of the two-finger touch point during the two-finger touch gesture, scaling of the target media content also causes movement. This is because scaling of the target media content is centered on a specific point within the content itself, such as a vertex. Therefore, scaling causes the target media content to move (only the scaling center remains unchanged; all other positions move). The larger the scaling ratio, the greater the movement of the target media content. The movement of the target media content is usually based on the center of the target media content and the displacement of the two-finger touch point. To ensure the target media content follows the finger movement, determining the target displacement requires considering not only the initial and current two-finger touch point positions but also the movement caused by scaling, and compensating for this scaling-induced movement.

[0049] Optionally, the first displacement of the two-finger touch position center can be determined based on the initial two-finger touch position center and the current two-finger touch position center. For example, assuming the target media content changes from the center point of the target media content at the start of the gesture, and taking that point as the origin, the initial two-finger touch position is (x1, y1) and (x2, y2), then the initial two-finger touch position center (x0, y0) = ((x1+x2) / 2, (y1+y2) / 2), and the current two-finger touch position is (x1', y1') and (x2', y2'), then the initial two-finger touch position center (x0', y0') = ((x1'+x2') / 2, (y1'+y2') / 2). Therefore, the first displacement detaX in the horizontal direction and the first displacement detaY in the vertical direction of the two-finger touch position center can be obtained: detaX = x0' - x0, detaY = y0' - y0.

[0050] In addition, the second displacement caused by scaling can be determined based on the initial two-finger touch point center and the target scaling ratio; including the second displacement in the horizontal axis direction and the second displacement in the vertical axis direction, the second displacement in the horizontal axis direction is the displacement caused by scaling the horizontal coordinate value of a point in the target media content, and the second displacement in the vertical axis direction is the displacement caused by scaling the vertical coordinate value of that point.

[0051] Furthermore, based on the first displacement and the second displacement, the target displacement is determined, which means that the first displacement at the center of the two-finger touch point compensates for the second displacement caused by scaling.

[0052] For example, assuming the target media content changes at the center point of the target media content at the start of the gesture, and taking that point as the origin, the product of the target scaling ratio minus 1 and the x and y coordinates of the initial two-finger touch point center is determined as the second displacement in the x and y directions caused by scaling, respectively. Specifically, the expressions for the second displacement in the x and y directions caused by scaling are as follows: biasX = (scale-1) × x0 biasY = (scale-1) × y0

[0053] Based on the first and second displacements, the target displacements in the horizontal direction (translateX) and vertical direction (translateY) are determined as follows: translateX = detaX - biasX translateY = detaY - biasY

[0054] Of course, if the scaling center of the target media content changes, the method for determining the second displacement caused by scaling also needs to be adjusted accordingly. Furthermore, the method for determining the target displacement based on the first and second displacements also needs to be adjusted accordingly, which will not be elaborated here. In addition, the method for determining the target displacement of the target media content is not limited to the examples above, and any other feasible method can be used. This embodiment does not impose any limitations. For example, only the first displacement can be considered, or the target scaling ratio can be combined with the first displacement, etc.

[0055] S204. Scale and move the target media content according to the target scaling ratio and the target displacement, and display the scaled and moved target media content.

[0056] In this embodiment, after determining the target scaling ratio and the target displacement, the target media content is scaled according to the target scaling ratio, and then the scaled target media content is moved according to the target displacement; or the target media content can be moved first according to the target displacement, and then the moved target media content can be scaled according to the target scaling ratio, or other scaling and moving logic can be used, and the scaled and moved target media content is displayed, presenting the effect that the target media content follows the finger movement and the size of the target media content follows the finger pinching and scaling during the two-finger touch gesture.

[0057] The media content scaling method provided in this embodiment obtains the initial and current two-finger touch positions of a two-finger touch gesture for scaling the target media content; determines the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position; and determines the target scaling ratio of the target media content based on the initial and current bounding rectangles. The aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, with the corresponding two-finger touch position located on the edge of the bounding rectangle. Based on the initial and current two-finger touch positions and the target scaling ratio, the target displacement of the target media content is determined. The target media content is scaled and moved according to the target scaling ratio and the target displacement, and the scaled and moved target media content is displayed. By determining the bounding rectangle of the two-finger touch position and determining the scaling ratio based on the bounding rectangle, square root calculations can be avoided, reducing computational costs, minimizing computational resource consumption, improving processing efficiency, and thus enhancing the response speed to two-finger touch gestures.

[0058] Based on any of the above embodiments, S202 may specifically include:

[0059] Determine the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determine the similarity ratio as the target scaling ratio of the target media content.

[0060] In this embodiment, since the aspect ratios of the current bounding rectangle at the current two-finger touch position and the initial bounding rectangle at the initial two-finger touch position are both preset aspect ratios, the similarity ratio between the current bounding rectangle and the initial bounding rectangle can be determined as the target scaling ratio of the target media content, thus avoiding the square root calculation. The calculation of the similarity ratio only requires determining the corresponding side lengths of the current bounding rectangle and the initial bounding rectangle and calculating their ratio, without actually drawing the bounding rectangle and then calculating the side length of the bounding rectangle, which simplifies the calculation process.

[0061] Optionally, the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position can be determined using the following process:

[0062] The lengths of each side of the initial circumscribed rectangle are determined based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, as well as the preset aspect ratio.

[0063] The length of one side of the current circumscribed rectangle is determined based on the current horizontal coordinate distance and the current vertical coordinate distance of the current two-finger touch position, as well as the preset aspect ratio.

[0064] Based on the side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle, the similarity ratio between the current bounding rectangle and the initial bounding rectangle is determined, and the similarity ratio is determined as the target scaling ratio of the target media content.

[0065] In this embodiment, to simplify the calculation process, only the corresponding side lengths of the current bounding rectangle and the initial bounding rectangle are determined and their ratio is calculated. However, since the current two-finger touch position may be located on the side of the current bounding rectangle along the horizontal coordinate direction or on the side along the vertical coordinate direction, if the current two-finger touch position is located on the side of the current bounding rectangle along the horizontal coordinate direction, the side length of the current bounding rectangle along the vertical coordinate direction can be determined based on the distance of the current two-finger touch position along the vertical coordinate direction; and if the current two-finger touch position is located on the side of the current bounding rectangle along the vertical coordinate direction, the side length of the current bounding rectangle can be determined based on the distance of the current two-finger touch position along the horizontal direction. The similarity ratio is calculated regardless of which side length of the current bounding rectangle is determined. Therefore, it is necessary to determine the lengths of all sides of the initial bounding rectangle, including the side lengths in the horizontal and vertical directions. Furthermore, if the side length in the vertical direction of the current bounding rectangle is determined, the ratio of the side length in the vertical direction of the current bounding rectangle to the side length in the vertical direction of the initial bounding rectangle is obtained as the similarity ratio. If the side length in the horizontal direction of the current bounding rectangle is determined, the ratio of the side length in the horizontal direction of the current bounding rectangle to the side length in the horizontal direction of the initial bounding rectangle is obtained as the similarity ratio.

[0066] Optionally, when determining the length of one side of the current circumscribed rectangle based on the current horizontal coordinate distance, the current vertical coordinate distance, and the preset aspect ratio of the current two-finger touch position, the specific steps may include:

[0067] If the product of the current vertical distance and the preset aspect ratio is greater than or equal to the current horizontal distance, it means the ratio of the current horizontal distance to the current vertical distance is less than or equal to the preset aspect ratio. In other words, the aspect ratio of the current bounding rectangle is less than or equal to the preset aspect ratio, as shown in Figure 4. Therefore, it can be determined that the current two-finger touch point is located on the side of the current bounding rectangle in the horizontal direction, and the side length of the current bounding rectangle in the vertical direction is the current vertical distance. Or...

[0068] If the product of the current vertical coordinate distance and the preset aspect ratio is less than or equal to the current horizontal coordinate distance, it is equivalent to the ratio of the current horizontal coordinate distance to the current vertical coordinate distance being greater than or equal to the preset aspect ratio. In other words, the aspect ratio of the current circumscribed rectangle is greater than or equal to the preset aspect ratio, as shown in Figure 5. Therefore, it can be determined that the current two-finger touch point is located on the edge of the current circumscribed rectangle in the vertical coordinate direction, and the side length of the current circumscribed rectangle in the horizontal coordinate direction is the current horizontal coordinate distance.

[0069] In this embodiment, considering that multiplication has a lower computational cost than division and can reduce the consumption of computing resources, the product of the current vertical distance and the preset aspect ratio is calculated and then compared with the current horizontal distance, instead of calculating the ratio of the current horizontal distance to the current vertical distance, i.e., the aspect ratio of the current circumscribed rectangle, and then comparing it with the preset aspect ratio. Multiplication replaces division to reduce computational cost.

[0070] Furthermore, if the side length of the current circumscribed rectangle in the vertical direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the vertical direction to the side length of the initial circumscribed rectangle in the vertical direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle; or

[0071] If the side length of the current circumscribed rectangle in the horizontal direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the horizontal direction to the side length of the initial circumscribed rectangle in the horizontal direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle.

[0072] In practice, the target scaling ratio (scale), which is the similarity ratio between the current bounding rectangle and the initial bounding rectangle, can be calculated directly through the following process:

[0073] If distanceY'×k≥distanceX', then:

[0074] If distanceY'×k≤distanceX', then:

[0075] Where distance X' is the current horizontal coordinate distance of the current two-finger touch position, i.e., |x2'-x1'|, distance Y' is the current vertical coordinate distance of the current two-finger touch position, i.e., |y2'-y1'|; lengthX is the side length of the initial bounding rectangle in the horizontal coordinate direction, lengthY is the side length of the initial bounding rectangle in the vertical coordinate direction; k is the preset aspect ratio.

[0076] Through the above process, it is not necessary to actually determine the current bounding rectangle and the initial bounding rectangle. Instead, by directly determining distance Y' and distance Y, or distance X' and distance X, the target scaling ratio can be determined at a lower cost, reducing the consumption of computing resources and improving efficiency.

[0077] In the above embodiment, since there is only one initial two-finger touch position, that is, only one initial circumscribed rectangle, the side lengths of the initial circumscribed rectangle in the horizontal and vertical directions only need to be calculated once. The calculation principle is similar to the above process and can also be implemented through the following process: If the initial two-finger touch position is located on the side of the initial circumscribed rectangle in the horizontal direction, the side length of the initial circumscribed rectangle in the vertical direction can be determined according to the distance of the initial two-finger touch position in the vertical direction. Since the aspect ratio of the initial circumscribed rectangle is a preset aspect ratio, the side length of the initial circumscribed rectangle in the horizontal direction can be calculated. If the initial two-finger touch position is located on the side of the initial circumscribed rectangle in the vertical direction, the side length of the initial circumscribed rectangle in the horizontal direction can be determined according to the distance of the initial two-finger touch position in the horizontal direction, and the side length of the initial circumscribed rectangle in the vertical direction can be further calculated.

[0078] In practical implementation, if the product of the initial vertical distance and the preset aspect ratio is greater than or equal to the initial horizontal distance, then the side length of the initial bounding rectangle in the vertical direction is determined to be the initial vertical distance. The side length of the initial bounding rectangle in the horizontal direction is then determined based on the side length in the vertical direction and the preset aspect ratio; the expression is as follows:

[0079] If distanceY×k ≥ distanceX, then: lengthY = distanceY, lengthX = lengthY×k

[0080] Where distance X is the initial horizontal coordinate distance of the initial two-finger touch position, i.e., |x2-x1|, and distance Y is the initial vertical coordinate distance of the initial two-finger touch position, i.e., |y2-y1|.

[0081] If the product of the initial vertical distance and the preset aspect ratio is less than or equal to the initial horizontal distance, then the side length of the initial bounding rectangle in the horizontal direction is determined to be the initial horizontal distance. The side length of the initial bounding rectangle in the vertical direction is then determined based on the side length in the horizontal direction and the preset aspect ratio, as expressed below:

[0082] If distanceY×k≤distanceX, then: lengthX=lengthX lengthY=lengthX / k

[0083] In another optional embodiment, the ratio of the side lengths of the current bounding rectangle and the initial bounding rectangle along the y-coordinate direction can be specified as the similarity ratio. In this case, it is necessary to determine the side lengths of the current bounding rectangle and the initial bounding rectangle along the y-coordinate direction. The determination of the side length of the current bounding rectangle along the y-coordinate direction can be made as follows: if the current two-finger touch position is located on the side of the current bounding rectangle along the x-coordinate direction, the side length of the current bounding rectangle along the y-coordinate direction can be determined based on the current two-finger touch position; if the current two-finger touch position is located on the side of the current bounding rectangle along the y-coordinate direction, the side length of the current bounding rectangle along the x-coordinate direction can be determined based on the current two-finger touch position. However, since the aspect ratio of the current bounding rectangle is a preset aspect ratio, the side length of the current bounding rectangle along the y-coordinate direction can be further determined. The determination of the side length of the initial bounding rectangle along the y-coordinate direction is similar.

[0084] Alternatively, the similarity ratio can be specified as the ratio of the side lengths of the current bounding rectangle and the initial bounding rectangle along the horizontal coordinate direction. In this case, it is necessary to determine the side lengths of the current bounding rectangle and the initial bounding rectangle along the horizontal coordinate direction. The determination of the side length of the current bounding rectangle along the horizontal coordinate direction can be done as follows: if the current two-finger touch position is located on the side of the current bounding rectangle along the horizontal coordinate direction, the side length along the vertical coordinate direction can be determined based on the current two-finger touch position. However, since the aspect ratio of the current bounding rectangle is a preset aspect ratio, the side length along the horizontal coordinate direction can be further determined. Similarly, if the current two-finger touch position is located on the side of the current bounding rectangle along the vertical coordinate direction, the side length along the horizontal coordinate direction can be determined based on the current two-finger touch position. The determination of the side length along the horizontal coordinate direction of the initial bounding rectangle is done in the same way.

[0085] It should be noted that, compared to the traditional method which uses the scaling ratio of the two-finger touch connection line as the scaling ratio of the target media content, the above embodiments use the similarity ratio of the circumscribed rectangle of the two-finger touch position as the scaling ratio of the target media content. This not only reduces computational costs, reduces the consumption of computing resources, improves processing efficiency, and enhances the response speed to two-finger touch gestures, but also responds to changes in the angle of the two-finger touch gesture. Specifically, in the traditional method, as long as the length of the two-finger touch connection line remains unchanged, the scaling ratio does not change regardless of whether the angle of the two-finger touch connection line changes. However, in the embodiments of this disclosure, if the length of the two-finger touch connection line remains unchanged, but the angle of the two-finger touch connection line changes, the current circumscribed rectangle will change, and thus the scaling ratio will also change, causing the target media content to scale as well. This reflects the change in the angle of the two-finger touch connection line and improves the tactile feedback of the gesture operation.

[0086] Furthermore, it should be noted that in the above embodiments, if the current angle of the two-finger touch connection line does not change relative to the initial angle of the two-finger touch connection line, the determined target scaling ratio is the same as the scaling ratio of the traditional algorithm; while if the current angle of the two-finger touch connection line changes relative to the initial angle of the two-finger touch connection line, the determined target scaling ratio is different from the scaling ratio of the traditional algorithm, but is relatively close, and the scaling experience provided to the user is also relatively close.

[0087] Corresponding to the media content scaling method in the above embodiments, FIG6 is a structural block diagram of a media content scaling device provided in at least one embodiment of the present disclosure. For ease of explanation, only the parts related to at least one embodiment of the present disclosure are shown. Referring to FIG6, the media content scaling device 600 includes: an acquisition unit 601, a scaling ratio determination unit 602, a displacement determination unit 603, and an execution unit 604.

[0088] The acquisition unit 601 is used to acquire the initial two-finger touch point position and the current two-finger touch point position of the two-finger touch gesture for scaling the target media content.

[0089] The scaling ratio determination unit 602 is used to determine the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and to determine the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle;

[0090] The displacement determination unit 603 is used to determine the target displacement amount of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0091] The execution unit 604 is used to scale and move the target media content according to the target scaling ratio and the target displacement, and to display the scaled and moved target media content.

[0092] In one or more embodiments of this disclosure, the scaling ratio determination unit 602, when determining the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determining the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle, is configured to:

[0093] Determine the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determine the similarity ratio as the target scaling ratio of the target media content.

[0094] In one or more embodiments of this disclosure, when the scaling ratio determination unit 602 determines the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determines the similarity ratio as the target scaling ratio of the target media content, it is used to:

[0095] The lengths of each side of the initial circumscribed rectangle are determined based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, as well as the preset aspect ratio.

[0096] The length of one side of the current circumscribed rectangle is determined based on the current horizontal coordinate distance and the current vertical coordinate distance of the current two-finger touch position, as well as the preset aspect ratio.

[0097] Based on the side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle, the similarity ratio between the current bounding rectangle and the initial bounding rectangle is determined, and the similarity ratio is determined as the target scaling ratio of the target media content.

[0098] In one or more embodiments of this disclosure, when the scaling ratio determination unit 602 determines the length of one side of the current circumscribed rectangle based on the current horizontal coordinate distance, the current vertical coordinate distance, and the preset aspect ratio of the current two-finger touch position, it is used to:

[0099] If the product of the current vertical distance and the preset aspect ratio is greater than or equal to the current horizontal distance, then the side length of the current circumscribed rectangle in the vertical direction is determined to be the current vertical distance; or

[0100] If the product of the current vertical coordinate distance and the preset aspect ratio is less than or equal to the current horizontal coordinate distance, then the side length of the current circumscribed rectangle in the horizontal coordinate direction is determined to be the current horizontal coordinate distance.

[0101] In one or more embodiments of this disclosure, when the scaling ratio determination unit 602 determines the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle based on one side length of the current circumscribed rectangle and the corresponding side length of the initial circumscribed rectangle, it is configured to:

[0102] If the side length of the current circumscribed rectangle in the vertical direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the vertical direction to the side length of the initial circumscribed rectangle in the vertical direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle; or

[0103] If the side length of the current circumscribed rectangle in the horizontal direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the horizontal direction to the side length of the initial circumscribed rectangle in the horizontal direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle.

[0104] In one or more embodiments of this disclosure, the scaling ratio determination unit 602, when determining the side lengths of the initial circumscribed rectangle based on the initial horizontal coordinate distance, the initial vertical coordinate distance, and the preset aspect ratio of the initial two-finger touch position, is used to:

[0105] If the product of the initial vertical distance and the preset aspect ratio is greater than or equal to the initial horizontal distance, then the side length of the initial circumscribed rectangle in the vertical direction is determined to be the initial vertical distance, and the side length of the initial circumscribed rectangle in the horizontal direction is determined based on the side length of the initial circumscribed rectangle in the vertical direction and the preset aspect ratio; or

[0106] If the product of the initial vertical coordinate distance and the preset aspect ratio is less than or equal to the initial horizontal coordinate distance, then the side length of the initial circumscribed rectangle in the horizontal coordinate direction is determined to be the initial horizontal coordinate distance, and the side length of the initial circumscribed rectangle in the vertical coordinate direction is determined based on the side length of the initial circumscribed rectangle in the horizontal coordinate direction and the preset aspect ratio.

[0107] In one or more embodiments of this disclosure, when the displacement determining unit 603 determines the target displacement amount of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio, it is configured to:

[0108] Based on the initial two-finger contact point center and the current two-finger contact point center, determine the first displacement of the two-finger contact point center;

[0109] Based on the initial two-finger touch point center position and the target scaling ratio, determine the second displacement caused by scaling;

[0110] The target displacement is determined based on the first displacement and the second displacement.

[0111] In one or more embodiments of this disclosure, when the displacement determining unit 603 determines the second displacement caused by scaling based on the initial two-finger touch point position center and the target scaling ratio, it is used to:

[0112] The product of the target scaling ratio minus 1 and the initial two-finger touch point center horizontal and vertical coordinates is determined as the second displacement in the horizontal and vertical directions caused by scaling.

[0113] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0114] To implement the above embodiments, at least one embodiment of this disclosure also provides an electronic device.

[0115] Referring to Figure 7, a schematic diagram of an electronic device 700 suitable for implementing at least one embodiment of the present disclosure is shown. The electronic device 700 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. The electronic device shown in Figure 7 is merely an example and should not be construed as limiting the functionality and scope of use of at least one embodiment of the present disclosure.

[0116] As shown in Figure 7, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0117] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 shows electronic device 700 with various devices, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0118] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of at least one embodiment of this disclosure.

[0119] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0120] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0121] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0122] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0124] The units described in at least one embodiment of this disclosure may be implemented in software or in hardware. The names of the units are not necessarily limiting in certain circumstances; for example, the first acquisition unit may also be described as "a unit that acquires at least two Internet Protocol addresses".

[0125] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0126] In a first aspect, according to one or more embodiments of this disclosure, a media content scaling method is provided, comprising:

[0127] Get the initial two-finger touch position and the current two-finger touch position for scaling the target media content;

[0128] The initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position are determined respectively, and the target scaling ratio of the target media content is determined based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle;

[0129] The target displacement of the target media content is determined based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0130] The target media content is scaled and moved according to the target scaling ratio and the target displacement, and the scaled and moved target media content is displayed.

[0131] According to one or more embodiments of this disclosure, the step of determining the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determining the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle, includes:

[0132] Determine the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determine the similarity ratio as the target scaling ratio of the target media content.

[0133] According to one or more embodiments of this disclosure, determining the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determining the similarity ratio as the target scaling ratio of the target media content, includes:

[0134] The lengths of each side of the initial circumscribed rectangle are determined based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, as well as the preset aspect ratio.

[0135] The length of one side of the current circumscribed rectangle is determined based on the current horizontal coordinate distance and the current vertical coordinate distance of the current two-finger touch position, as well as the preset aspect ratio.

[0136] Based on the side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle, the similarity ratio between the current bounding rectangle and the initial bounding rectangle is determined, and the similarity ratio is determined as the target scaling ratio of the target media content.

[0137] According to one or more embodiments of this disclosure, determining the length of one side of the current circumscribed rectangle based on the current horizontal coordinate distance, the current vertical coordinate distance, and the preset aspect ratio of the current two-finger touch position includes:

[0138] If the product of the current vertical distance and the preset aspect ratio is greater than or equal to the current horizontal distance, then the side length of the current circumscribed rectangle in the vertical direction is determined to be the current vertical distance; or

[0139] If the product of the current vertical coordinate distance and the preset aspect ratio is less than or equal to the current horizontal coordinate distance, then the side length of the current circumscribed rectangle in the horizontal coordinate direction is determined to be the current horizontal coordinate distance.

[0140] According to one or more embodiments of this disclosure, determining the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle based on one side length of the current circumscribed rectangle and the corresponding side length of the initial circumscribed rectangle includes:

[0141] If the side length of the current circumscribed rectangle in the vertical direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the vertical direction to the side length of the initial circumscribed rectangle in the vertical direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle; or

[0142] If the side length of the current circumscribed rectangle in the horizontal direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the horizontal direction to the side length of the initial circumscribed rectangle in the horizontal direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle.

[0143] According to one or more embodiments of this disclosure, determining the side lengths of the initial circumscribed rectangle based on the initial horizontal coordinate distance, the initial vertical coordinate distance, and the preset aspect ratio of the initial two-finger touch position includes:

[0144] If the product of the initial vertical distance and the preset aspect ratio is greater than or equal to the initial horizontal distance, then the side length of the initial circumscribed rectangle in the vertical direction is determined to be the initial vertical distance, and the side length of the initial circumscribed rectangle in the horizontal direction is determined based on the side length of the initial circumscribed rectangle in the vertical direction and the preset aspect ratio; or

[0145] If the product of the initial vertical coordinate distance and the preset aspect ratio is less than or equal to the initial horizontal coordinate distance, then the side length of the initial circumscribed rectangle in the horizontal coordinate direction is determined to be the initial horizontal coordinate distance, and the side length of the initial circumscribed rectangle in the vertical coordinate direction is determined based on the side length of the initial circumscribed rectangle in the horizontal coordinate direction and the preset aspect ratio.

[0146] According to one or more embodiments of this disclosure, determining the target displacement of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio includes:

[0147] Based on the initial two-finger contact point center and the current two-finger contact point center, determine the first displacement of the two-finger contact point center;

[0148] Based on the initial two-finger touch point center position and the target scaling ratio, determine the second displacement caused by scaling;

[0149] The target displacement is determined based on the first displacement and the second displacement.

[0150] According to one or more embodiments of this disclosure, determining the second displacement amount caused by scaling based on the initial two-finger touch point position center and the target scaling ratio includes:

[0151] The product of the target scaling ratio minus 1 and the initial two-finger touch point center horizontal and vertical coordinates is determined as the second displacement in the horizontal and vertical directions caused by scaling.

[0152] Secondly, according to one or more embodiments of this disclosure, a media content scaling device is provided, comprising:

[0153] The acquisition unit is used to acquire the initial two-finger touch point position and the current two-finger touch point position of the two-finger touch gesture for scaling the target media content;

[0154] The scaling ratio determination unit is used to determine the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and to determine the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle;

[0155] The displacement determination unit is used to determine the target displacement amount of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio.

[0156] An execution unit is configured to scale and move the target media content according to the target scaling ratio and the target displacement, and display the scaled and moved target media content.

[0157] According to one or more embodiments of this disclosure, when the scaling ratio determination unit determines the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determines the target scaling ratio of the target media content based on the initial bounding rectangle and the current bounding rectangle, it is configured to:

[0158] Determine the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determine the similarity ratio as the target scaling ratio of the target media content.

[0159] According to one or more embodiments of this disclosure, when the scaling ratio determination unit determines the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determines the similarity ratio as the target scaling ratio of the target media content, it is configured to:

[0160] The lengths of each side of the initial circumscribed rectangle are determined based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, as well as the preset aspect ratio.

[0161] The length of one side of the current circumscribed rectangle is determined based on the current horizontal coordinate distance and the current vertical coordinate distance of the current two-finger touch position, as well as the preset aspect ratio.

[0162] Based on the side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle, the similarity ratio between the current bounding rectangle and the initial bounding rectangle is determined, and the similarity ratio is determined as the target scaling ratio of the target media content.

[0163] According to one or more embodiments of this disclosure, when the scaling ratio determination unit determines the length of one side of the current circumscribed rectangle based on the current horizontal coordinate distance, the current vertical coordinate distance, and the preset aspect ratio of the current two-finger touch position, it is used to:

[0164] If the product of the current vertical distance and the preset aspect ratio is greater than or equal to the current horizontal distance, then the side length of the current circumscribed rectangle in the vertical direction is determined to be the current vertical distance; or

[0165] If the product of the current vertical coordinate distance and the preset aspect ratio is less than or equal to the current horizontal coordinate distance, then the side length of the current circumscribed rectangle in the horizontal coordinate direction is determined to be the current horizontal coordinate distance.

[0166] According to one or more embodiments of this disclosure, when the scaling ratio determination unit determines the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle based on one side length of the current circumscribed rectangle and the corresponding side length of the initial circumscribed rectangle, it is configured to:

[0167] If the side length of the current circumscribed rectangle in the vertical direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the vertical direction to the side length of the initial circumscribed rectangle in the vertical direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle; or

[0168] If the side length of the current circumscribed rectangle in the horizontal direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the horizontal direction to the side length of the initial circumscribed rectangle in the horizontal direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle.

[0169] According to one or more embodiments of this disclosure, when the scaling ratio determination unit determines the side lengths of the initial circumscribed rectangle based on the initial horizontal coordinate distance, the initial vertical coordinate distance, and the preset aspect ratio of the initial two-finger touch position, it is used to:

[0170] If the product of the initial vertical distance and the preset aspect ratio is greater than or equal to the initial horizontal distance, then the side length of the initial circumscribed rectangle in the vertical direction is determined to be the initial vertical distance, and the side length of the initial circumscribed rectangle in the horizontal direction is determined based on the side length of the initial circumscribed rectangle in the vertical direction and the preset aspect ratio; or

[0171] If the product of the initial vertical coordinate distance and the preset aspect ratio is less than or equal to the initial horizontal coordinate distance, then the side length of the initial circumscribed rectangle in the horizontal coordinate direction is determined to be the initial horizontal coordinate distance, and the side length of the initial circumscribed rectangle in the vertical coordinate direction is determined based on the side length of the initial circumscribed rectangle in the horizontal coordinate direction and the preset aspect ratio.

[0172] According to one or more embodiments of this disclosure, when determining the target displacement amount of the target media content based on the initial two-finger touch position, the current two-finger touch position, and the target scaling ratio, the displacement determining unit is configured to:

[0173] Based on the initial two-finger contact point center and the current two-finger contact point center, determine the first displacement of the two-finger contact point center;

[0174] Based on the initial two-finger touch point center position and the target scaling ratio, determine the second displacement caused by scaling;

[0175] The target displacement is determined based on the first displacement and the second displacement.

[0176] According to one or more embodiments of this disclosure, when the displacement determining unit determines the second displacement amount caused by scaling based on the initial two-finger touch point position center and the target scaling ratio, it is configured to:

[0177] The product of the target scaling ratio minus 1 and the initial two-finger touch point center horizontal and vertical coordinates is determined as the second displacement in the horizontal and vertical directions caused by scaling.

[0178] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0179] The memory stores computer-executed instructions;

[0180] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the media content scaling method as described in the first aspect and various possible designs of the first aspect.

[0181] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, implement the media content scaling method described in the first aspect and various possible designs of the first aspect.

[0182] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the media content scaling method described in the first aspect and various possible designs of the first aspect.

[0183] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0184] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0185] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for scaling media content, comprising: Get the initial two-finger touch position and the current two-finger touch position for two-finger touch gestures for media content scaling; The initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position are determined respectively, and the scaling ratio of the media content is determined according to the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle; The third displacement amount of the media content is determined based on the initial two-finger touch position, the current two-finger touch position, and the zoom ratio. The media content is scaled and moved according to the scaling ratio and the third displacement, and the scaled and moved media content is displayed.

2. The method according to claim 1, wherein, The process of determining the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determining the scaling ratio of the media content based on the initial bounding rectangle and the current bounding rectangle, includes: Determine the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and use the similarity ratio as the scaling ratio of the media content.

3. The method according to claim 2, wherein, The step of determining the similarity ratio between the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and determining the similarity ratio as the scaling ratio of the media content, includes: The lengths of each side of the initial circumscribed rectangle are determined based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, as well as the preset aspect ratio. The length of one side of the current circumscribed rectangle is determined based on the current horizontal coordinate distance and the current vertical coordinate distance of the current two-finger touch position, as well as the preset aspect ratio. Based on the side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle, the similarity ratio between the current bounding rectangle and the initial bounding rectangle is determined, and the similarity ratio is determined as the scaling ratio of the media content.

4. The method according to claim 3, wherein, The step of determining the length of one side of the current circumscribed rectangle based on the current horizontal coordinate distance, the current vertical coordinate distance, and the preset aspect ratio of the current two-finger touch position includes: If the product of the current vertical distance and the preset aspect ratio is greater than or equal to the current horizontal distance, then the side length of the current circumscribed rectangle in the vertical direction is determined to be the current vertical distance; or If the product of the current vertical coordinate distance and the preset aspect ratio is less than or equal to the current horizontal coordinate distance, then the side length of the current circumscribed rectangle in the horizontal coordinate direction is determined to be the current horizontal coordinate distance.

5. The method according to claim 4, wherein, The step of determining the similarity ratio between the current bounding rectangle and the initial bounding rectangle based on one side length of the current bounding rectangle and the corresponding side length of the initial bounding rectangle includes: If the side length of the current circumscribed rectangle in the vertical direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the vertical direction to the side length of the initial circumscribed rectangle in the vertical direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle; or If the side length of the current circumscribed rectangle in the horizontal direction can be determined, then the ratio of the side length of the current circumscribed rectangle in the horizontal direction to the side length of the initial circumscribed rectangle in the horizontal direction is obtained and determined as the similarity ratio between the current circumscribed rectangle and the initial circumscribed rectangle.

6. The method according to any one of claims 3-5, wherein, The step of determining the side lengths of the initial circumscribed rectangle based on the initial horizontal coordinate distance and the initial vertical coordinate distance of the initial two-finger touch point position, and the preset aspect ratio, includes: If the product of the initial vertical distance and the preset aspect ratio is greater than or equal to the initial horizontal distance, then the side length of the initial circumscribed rectangle in the vertical direction is determined to be the initial vertical distance, and the side length of the initial circumscribed rectangle in the horizontal direction is determined based on the side length of the initial circumscribed rectangle in the vertical direction and the preset aspect ratio; or If the product of the initial vertical coordinate distance and the preset aspect ratio is less than or equal to the initial horizontal coordinate distance, then the side length of the initial circumscribed rectangle in the horizontal coordinate direction is determined to be the initial horizontal coordinate distance, and the side length of the initial circumscribed rectangle in the vertical coordinate direction is determined based on the side length of the initial circumscribed rectangle in the horizontal coordinate direction and the preset aspect ratio.

7. The method according to any one of claims 1-6, wherein, The step of determining the third displacement amount of the media content based on the initial two-finger touch position, the current two-finger touch position, and the zoom ratio includes: Based on the initial two-finger contact point center and the current two-finger contact point center, determine the first displacement of the two-finger contact point center; Based on the initial two-finger touch point center position and the scaling ratio, determine the second displacement amount caused by scaling; The third displacement is determined based on the first displacement and the second displacement.

8. The method according to claim 7, wherein, The step of determining the second displacement caused by scaling based on the initial two-finger touch point center position and the scaling ratio includes: The product of the obtained scaling ratio minus 1 and the initial two-finger touch point center horizontal and vertical coordinates is determined as the second displacement in the horizontal and vertical directions caused by scaling.

9. A media content scaling device, comprising: The acquisition unit is configured to acquire the initial two-finger touch position and the current two-finger touch position of the two-finger touch gesture for scaling media content; The scaling ratio determination unit is configured to determine the initial bounding rectangle of the initial two-finger touch position and the current bounding rectangle of the current two-finger touch position, and to determine the scaling ratio of the media content based on the initial bounding rectangle and the current bounding rectangle; wherein the aspect ratio of any bounding rectangle is a preset aspect ratio, and the center of the bounding rectangle coincides with the center of the corresponding two-finger touch position, and the corresponding two-finger touch position is located on the edge of the bounding rectangle; The displacement determination unit is configured to determine a third displacement amount of the media content based on the initial two-finger touch position, the current two-finger touch position, and the scaling ratio. The execution unit is configured to scale and move the media content according to the scaling ratio and the third displacement, and to display the scaled and moved media content.

10. An electronic device comprising a processor and a memory, wherein, The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the media content scaling method as described in any one of claims 1-8.

11. A computer-readable storage medium storing computer-executable instructions, wherein, When the processor executes the computer execution instructions, it implements the media content scaling method as described in any one of claims 1-8.

12. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the media content scaling method as described in any one of claims 1-8.