Android device-based signal source picture cropping method and device, and electronic device

By utilizing a signal source image cropping method on Android devices and defining graphic layer transformation parameters and a cropping window, the problem of low touch sensitivity and efficiency during image cropping on Android devices is solved, achieving efficient and flexible image cropping operations.

CN119414952BActive Publication Date: 2026-07-03ZEN-AI TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZEN-AI TECH
Filing Date
2024-10-08
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing Android devices have poor touch sensitivity and low cropping efficiency when cropping screen content. The XML framework results in verbose and complex code, making it difficult to achieve dynamic changes and real-time preview.

Method used

A signal source image cropping method based on Android devices is adopted. The cropping data is determined by responding to the cropping operation, the graphic layer transformation parameters are defined, a cropping window is created, and the cropped image is displayed in the cropping window. The image cropping is performed using the Compose UI system framework and the Modifier.graphicsLayer modifier.

Benefits of technology

Improved touch sensitivity and cropping efficiency when cropping screen content on Android devices, ensuring flexibility and efficiency in screen cropping operations and providing a good user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119414952B_ABST
    Figure CN119414952B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a signal source picture cropping method and device based on an Android device and an electronic device. The method comprises: in response to a cropping operation on a signal source picture played by a signal source window, determining cropping data corresponding to the cropping operation; defining a transformation parameter of a graphics layer according to the cropping data, creating a first cropping window according to the transformation parameter of the graphics layer; determining a cropped picture located at a cropping position from a second signal source picture according to the cropping data; and displaying the cropped picture in the first cropping window. Thus, the touch sensitivity when cropping a signal source picture based on an Android device can be improved, and the cropping efficiency of picture content can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and electronic device for cropping signal source images based on Android devices. Background Technology

[0002] In existing technologies, Android devices typically use the XML (Extensible Markup Language) framework to implement page interactions. However, XML suffers from problems such as verbose and complex code, low development efficiency, poor code readability and maintainability, difficulty in implementing dynamic page changes and responses, separation from other programming language code, and difficulty in real-time previewing.

[0003] For example, Android devices can play video content. To meet users' needs for playing only a portion of a complete video, Android devices need to support the function of selecting a portion of the video content. However, the XML-based UI (User Interface) system framework used by Android devices has poor touch sensitivity; if the user captures a frame quickly on the screen, the selection box will appear broken; it also consumes a lot of memory.

[0004] It is evident that improving touch sensitivity and efficiency when cropping screen content on Android devices is a technical issue worthy of attention. Summary of the Invention

[0005] In view of this, in order to solve some or all of the above-mentioned technical problems, this application provides a method, apparatus and electronic device for cropping signal source images based on Android devices.

[0006] In a first aspect, embodiments of this application provide a method for cropping signal source images based on an Android device, the method comprising:

[0007] In response to a cropping operation on the signal source image played in the signal source window, cropping data corresponding to the cropping operation is determined;

[0008] Based on the cropping data, define the transformation parameters of the graphics layer, and create a first cropping window based on the transformation parameters of the graphics layer;

[0009] Based on the cropping data, the cropping image located at the cropping position is determined from the second signal source image;

[0010] The cropping screen is displayed in the first cropping window.

[0011] In one possible implementation, defining transformation parameters for the graphics layer based on the cropping data, and creating a first cropping window based on the transformation parameters of the graphics layer, includes:

[0012] Add the cropped data to the field properties of the signal source window;

[0013] A graphic layer is defined using screen layout modifiers. The graphic layer obtains the cropping data of the field attributes. Based on the cropping data and the original data of the signal source window, a first starting point and a first ending point that are diagonally related are obtained.

[0014] A first diagonal is constructed using the first starting point and the first ending point, and a first rectangle is drawn based on the first diagonal, which is then used as the first clipping window.

[0015] In one possible implementation, the method further includes:

[0016] Create a window object for the signal source window, and set field attributes for the window object. The field attributes include at least one of the following cropping data: the horizontal coordinate value of the cropping start point, the vertical coordinate value of the cropping start point, the ratio of the horizontal outer border of the image, and the ratio of the vertical outer border of the image.

[0017] In one possible implementation, determining the cropped image located at the cropping position from the second signal source image based on the cropping data includes:

[0018] Based on the first starting point, the coordinates of the starting point of the cropped image are obtained;

[0019] Based on the first cutoff point, the coordinates of the cutoff point of the cropped image are obtained;

[0020] Based on the first rectangle, the outer border of the cropped image is obtained;

[0021] The frame in the second signal source image that starts from the starting point coordinates and ends at the ending point coordinates, and is located within the outer border of the cropping frame, is defined as the cropped frame.

[0022] In one possible implementation, the method further includes:

[0023] Based on the first rectangle and the signal source window, the ratio of the horizontal outer border value of the signal source window to the horizontal outer border value of the first rectangle is calculated to obtain the horizontal magnification ratio; the ratio of the vertical outer border value of the signal source window to the vertical outer border value of the first rectangle is calculated to obtain the vertical magnification ratio.

[0024] Based on the horizontal magnification ratio, the second signal source image is magnified horizontally; based on the vertical magnification ratio, the second signal source image is magnified vertically.

[0025] In one possible implementation, the method further includes:

[0026] The center coordinates of the signal source window are obtained based on the signal source window, and the center coordinates of the first rectangle are obtained based on the first rectangle.

[0027] The difference between the center horizontal coordinate of the signal source window and the center horizontal coordinate of the first rectangle is obtained to obtain the horizontal difference value. The horizontal difference value is multiplied by the horizontal magnification ratio value to obtain the horizontal displacement. Based on the horizontal displacement, the center point of the magnified second signal source image is moved horizontally.

[0028] The vertical difference is obtained by subtracting the vertical coordinate of the center of the signal source window from the vertical coordinate of the center of the first rectangle. The vertical difference is then multiplied by the vertical magnification ratio to obtain the vertical displacement. Based on the vertical displacement, the center point of the magnified second signal source image is moved vertically.

[0029] In one possible implementation, the method further includes:

[0030] In response to a second cropping operation on the second signal source image played in the first cropping window, second cropping data corresponding to the second cropping operation is determined;

[0031] Based on the second cropping data, define the second transformation parameters of the graphics layer, and create a second cropping window based on the second transformation parameters of the graphics layer;

[0032] Based on the second cropping data, determine the second cropping screen located at the cropping position from the third signal source screen;

[0033] The second cropping screen is displayed in the second cropping window.

[0034] In one possible implementation, the method further includes:

[0035] In response to a third cropping operation on the signal source image played in the signal source window and the second signal source image played in the first cropping window that is at least partially superimposed thereon, third cropping data corresponding to the third cropping operation is determined;

[0036] Based on the third cropping data, define the third transformation parameters of the graphics layer, and create a third cropping window based on the third transformation parameters of the graphics layer;

[0037] Based on the third cropping data, the third cropping image located at the cropping position is determined from the fourth signal source image;

[0038] The third cropping screen is displayed in the third cropping window.

[0039] In one possible implementation, the method further includes:

[0040] In response to the fourth cropping operation at multiple intervals of the signal source image played in the signal source window, the fourth cropping data corresponding to the fourth cropping operation at each of the multiple intervals is determined to obtain the fourth cropping data group.

[0041] Based on the fourth cropping data group, define a cropping quantity graphic layer corresponding to the fourth cropping data group, define a fourth transformation parameter corresponding to a fourth cropping data for each graphic layer, and create multiple fourth cropping windows corresponding to the cropping quantity based on the fourth transformation parameter of each graphic layer.

[0042] Based on the fourth cropping data group, each fourth cropping frame located at the cropping position is determined from the fifth signal source frame;

[0043] The corresponding fourth cropping screen is displayed in each fourth cropping window.

[0044] In one possible implementation, the method further includes:

[0045] Add a dot event input modifier to respond to touch operations on the screen of the Android device;

[0046] Call the function that detects drag gestures within the pointer input scope;

[0047] Obtain the drag start parameter and drag end parameter of the drag gesture detection function;

[0048] Based on the drag start parameters, the drag start coordinates are obtained, and the coordinates corresponding to the drag start coordinates are used as the starting point coordinates of the cropped image.

[0049] Based on the drag end parameters, determine the drag cutoff point coordinates, and use the coordinates corresponding to the drag cutoff point coordinates as the cutoff point coordinates of the cropped image.

[0050] In one possible implementation, the method further includes:

[0051] Based on the positional relationship between the drag start point coordinates and the drag cutoff point coordinates, perform at least one corresponding coordinate adjustment process on the drag start point coordinates and the drag cutoff point coordinates;

[0052] The corresponding coordinate adjustment process includes: keeping the coordinate values ​​unchanged, taking cross-valued coordinate values, and swapping coordinate values.

[0053] Secondly, embodiments of this application provide a signal source image cropping device based on an Android device, the device comprising:

[0054] The first determining unit is used to determine the cropping data corresponding to the cropping operation in response to the cropping operation of the signal source image played in the signal source window.

[0055] The first creation unit is used to define the transformation parameters of the graphics layer according to the cropping data, and to create a first cropping window according to the transformation parameters of the graphics layer.

[0056] The second determining unit is used to determine the cropping image located at the cropping position from the second signal source image based on the cropping data.

[0057] The first display unit is used to display the cropping image in the first cropping window.

[0058] Thirdly, embodiments of this application provide an electronic device, including:

[0059] Memory, used to store computer programs;

[0060] A processor is configured to execute a computer program stored in the memory, and when the computer program is executed, to implement any embodiment of the signal source screen cropping method based on an Android device according to the first aspect of this application.

[0061] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the method of any embodiment of the signal source screen cropping method based on an Android device as described in the first aspect above.

[0062] The signal source screen cropping method based on Android devices provided in this application embodiment can, in response to a cropping operation on the signal source screen played in the signal source window, determine the cropping data corresponding to the cropping operation; define transformation parameters of the graphics layer based on the cropping data; create a first cropping window based on the transformation parameters of the graphics layer; determine the cropping screen located at the cropping position from a second signal source screen based on the cropping data; and display the cropping screen in the first cropping window. This improves the touch sensitivity when cropping signal source screens on Android devices. Attached Figure Description

[0063] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0065] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0066] Figure 1 A flowchart illustrating a signal source image cropping method based on an Android device, provided in an embodiment of this application;

[0067] Figure 2 A flowchart illustrating another signal source image cropping method based on an Android device provided in this application embodiment;

[0068] Figures 3A-3D A schematic diagram illustrating an application scenario of another signal source image cropping method based on an Android device provided in this application embodiment;

[0069] Figure 4 This application provides a schematic diagram of the structure of a signal source image cropping device based on an Android device.

[0070] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0071] Various exemplary embodiments of this application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this application.

[0072] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of this application are only used to distinguish different steps, devices or modules, and do not represent any specific technical meaning, nor do they indicate the logical order between them.

[0073] It should also be understood that in this embodiment, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.

[0074] It should also be understood that any component, data or structure mentioned in the embodiments of this application can generally be understood as one or more unless explicitly defined or given contrary guidance in the context.

[0075] Furthermore, the term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects have an "or" relationship.

[0076] It should also be understood that the description of the various embodiments in this application emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0077] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0078] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0079] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0080] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. To facilitate understanding of the embodiments of this application, the application will be described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0081] In this invention, the directions mentioned herein, such as up, down, left, right, upper left, lower left, upper right, and lower right, refer to the following directions based on the Android device's upright placement on a flat surface with its content displayed normally: up is the direction closer to the top of the Android device; down is the direction closer to the bottom of the Android device; left is the direction to the user's left when facing the Android device; right is the direction to the user's right when facing the Android device; upper left is the direction to the user's left and near the top of the Android device, and lower left is the direction to the user's left and near the bottom of the Android device; upper right is the direction to the user's right and near the top of the Android device, and lower right is the direction to the user's right and near the bottom of the Android device. Horizontal, horizontal, etc., refer to directions parallel to the horizontal plane based on the Android device's upright placement on a flat surface with its content displayed normally. Vertical, longitudinal, etc., refer to directions perpendicular to the horizontal plane based on the Android device's upright placement on a flat surface with its content displayed normally.

[0082] To address the technical problems of improving touch sensitivity and efficiency when cropping screen content on Android devices in existing technologies, this application provides a signal source screen cropping method, apparatus, and electronic device based on Android devices, which can improve touch sensitivity and efficiency when cropping screen content on Android devices.

[0083] Figure 1 This is a flowchart illustrating a signal source image cropping method based on an Android device, provided as an embodiment of this application. This method can be applied to one or more electronic devices such as smartphones, laptops, desktop computers, portable computers, and servers. Furthermore, the execution entity of this method can be hardware or software. When the execution entity is hardware, it can be one or more of the aforementioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the execution entity is software, this method can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are imposed here.

[0084] In one embodiment of this application, the screen content of the Android device can be the signal source screen, a photo locally on the device, a video locally on the device, a file locally on the device, etc. The following explanation uses the example of an Android device playing a signal source screen. Figure 1 As shown, the method specifically includes:

[0085] Step 101: In response to the cropping operation of the signal source image played in the signal source window, determine the cropping data corresponding to the cropping operation.

[0086] In this embodiment, the signal source window can be a window used to play the signal source image.

[0087] The signal source screen can be the image content displayed on the signal source device, such as photos, videos, documents, etc.

[0088] In practice, the signal source end (i.e., the signal source-side device) can be used to provide the signal source signal. The acquisition device, which is communicatively connected to the signal source end, will acquire the signal source signal and encode it to obtain an encoded video stream. Then, the encoded video stream will be transmitted to the display and control end (such as an Android device) for displaying and controlling the signal source screen. After the display and control end decodes the received encoded video stream, it obtains the signal source screen, which can then be rendered and displayed on the display and control end.

[0089] Here, the number of signal source images displayed simultaneously on an Android device can be one or at least two. Each signal source image can be set to a corresponding signal source window. A combination of multiple signal source images can be set to the same signal source window.

[0090] It should be noted that the technical solution of this invention is particularly applicable to application scenarios where there are multiple signal source windows on the display interface of an Android device. Each signal source window is used to display the signal source image, which can be a video, picture, recording, etc., and the signal source image is content obtained by the Android device from other terminals. The function of the signal source window is to achieve visual separation and operational separation of different signal source images. Without signal source windows, the boundaries between the various signal source images on the Android device's display interface would be unclear, making it impossible for users to perform effective multi-window operations.

[0091] The cropping operation can be used to crop the signal source image. In practice, it can be initiated by pressing a preset shortcut key (such as "Alt+a") or by pressing a preset key. Alternatively, the cropping operation can be performed by inputting the cropping position.

[0092] Typically, after triggering a cropping operation (pressing the left mouse button), you can drag the mouse and release it after dragging it to the desired position to complete the cropping operation. Alternatively, after triggering a cropping operation (clicking the display with your finger / stylus), you can move your finger / stylus and release it after moving it to the desired position to complete the cropping operation.

[0093] Users can perform one or more cropping operations on the signal source image displayed in the cropping window. The cropping window can represent the portion of the signal source window that the cropping operation indicates to be cropped. For example, the shape of the cropping window can be a rectangle, a triangle, etc.

[0094] Cropped data can be data generated by performing a cropping operation. As an example, cropped data can include cropping locations.

[0095] The clipping position can represent the relative position between the clipping window and the signal source window. The clipping position can include at least one of the following: the displacement between the center position of the clipping window and the center position of the signal source window, the distance between the two vertices of the clipping window's diagonal and the border of the signal source window, etc.

[0096] In practice, it can be determined whether a clipping operation has been detected by detecting mouse events or gesture events.

[0097] Taking gesture events as an example, you can add the `Modifier.pointerInput` modifier (point event input modifier) ​​to the signal source window to manage screen touch gestures. Then, you can call the `PointerInputScope.detectDragGestures` function (the function for detecting drag gestures) within the pointer input scope to listen for specific gesture events and perform the actual data collection, thereby determining whether a clipping operation is executed. In the Android system, drag gestures can be detected by implementing the `View.OnTouchListener` interface.

[0098] The `Modifier.pointerInput` modifier is used in composable interfaces (components) to handle pointer input (such as touch, mouse, etc.). It provides a convenient way to listen for and respond to pointer events, such as clicks, long presses, and drags.

[0099] For example, the Modifier.pointerInput modifier can be used by following these steps:

[0100] 1. Create one or more pointer event listeners: Use extension methods of the Modifier.pointerInput modifier, such as detectTapGestures, detectDragGestures, detectHorizontalDragGestures, detectVerticalDragGestures, etc., to define the pointer event types to be listened to and the corresponding callback functions.

[0101] 2. Handling pointer events: In the callback function, write the logic to handle pointer events. For example, in the callback of a click event, you can perform corresponding operations, such as updating the state or triggering an animation.

[0102] 3. Apply modifier: Apply the Modifier.pointerInput modifier to the Composable element to which you want to listen for pointer events.

[0103] Step 102: Define the transformation parameters of the graphics layer based on the cropping data, and create a first cropping window based on the transformation parameters of the graphics layer.

[0104] In this embodiment, the graphics layer can be a specific layer or area used to present visual elements such as graphics and images during the display or processing of the signal source screen.

[0105] The transformation parameters can be data for the first cropping window obtained based on calculations of the cropping data. For example, the transformation parameters could include the position, height, and width of the first cropping window.

[0106] The first cropping window can be a cropping window created based on the transformation parameters of the graphics layer.

[0107] The first cropping window can be independent of the signal source window, that is, the first cropping window and the signal source window are arranged alternately; or, the first cropping window can also be superimposed on the signal source window, that is, the screen content displayed in the first cropping window covers the signal source screen located in the superimposed area of ​​the signal source window, and only the screen content displayed in the first cropping window is displayed in the superimposed area.

[0108] Step 103: Based on the cropping data, determine the cropping image located at the cropping position from the second signal source image.

[0109] The signal source window and the first cropping window each form their own layer, and the two layers coexist without interfering with each other. Correspondingly, the signal source window acquires the display screen of the signal source device, and the first cropping window also acquires the display screen of the signal source device. Here, and in the following text, the signal source screen, second signal source screen, third signal source screen, fourth signal source screen, and fifth signal source screen represent the screen content acquired separately from the signal source device at different times. The screen content of each signal source screen can be the same (originating from the same signal source device) or completely different (originating from different signal source devices). In this embodiment, the cropping screen can correspond to a sub-screen of the signal source screen. For example, the cropping screen is a partial screen of the signal source screen corresponding to the cropping position indicated by the cropping data. Here, after determining the cropping position, the screen within the area covered by the aforementioned cropping position in the second signal source screen can be used as the cropping screen.

[0110] Step 104: Display the cropping screen in the first cropping window.

[0111] In this embodiment, after the cropped image is determined, it can be displayed in the first cropping window. Specifically, the cropped image can be displayed in the first cropping window arranged at intervals from the signal source windows, or in a first cropping window arranged superimposed on the signal source windows.

[0112] The signal source image cropping method provided in this application utilizes the Compose UI system framework on Android devices to perform partial cropping of the signal source image. This can improve the touch sensitivity and cropping efficiency when cropping signal source images on Android devices.

[0113] As an example, the `Modifier.graphicsLayer` modifier (screen layout modifier) ​​can be used to display the cropped image in the first cropping window. Specifically, the scaling factor and displacement of the first cropping window are sent as parameters to the `Modifier.graphicsLayer` modifier. The `Modifier.graphicsLayer` modifier is a modifier in the Compose framework used to set and control the graphics layer of Composable elements. It provides a convenient way to apply various graphic effects, such as scaling, rotation, transparency, shadows, and cropping.

[0114] Here are the general steps for using the Modifier.graphicsLayer modifier:

[0115] Create one or more graphic layer effects: You can use the parameters of the Modifier.graphicsLayer modifier to set various effects, such as scaleX, scaleY, translationX, translationY, etc.

[0116] Apply graphic layer effects to Composable elements: Apply the Modifier.graphicsLayer modifier to the Composable element to which you want to add graphic layer effects.

[0117] Combining multiple graphic layer effects: More complex graphic transformations and effects can be achieved by nesting multiple graphic layer effects in Modifier.graphicsLayer.

[0118] By using the Modifier.graphicsLayer modifier, various graphic effects can be easily achieved without directly manipulating the underlying graphics drawing code. This makes graphic customization and animation in Compose simpler and more intuitive.

[0119] It's important to note that the transition from the signal source window to the first cropping window is merely an intermediate step from the original (state) signal source image to the captured state signal source image. The first cropping window's purpose is simply to send a capture signal to the program. Since the first cropping window is formed by cropping from the signal source window, its display size is necessarily smaller than the signal source window's display size. The first cropping window initially captures the complete signal source image (second signal source image) from the signal source device. To display the entire signal source image in the first cropping window, the displayed image (second signal source image) is scaled down relative to the image displayed in the original signal source window. To achieve "displaying the signal source image in the first cropping window (i.e., a partial image of the original signal source image) in proportion to the signal source image displayed in the signal source window," it's necessary to adjust (e.g., enlarge) the display ratio of the initial signal source streaming media (i.e., the signal source image) in the first cropping window. In other words, to display the signal source image in the first cropping window in proportion to the signal source image displayed in the original signal source window, it's necessary to adjust and enlarge the initial display size of the signal source image captured in the first cropping window.

[0120] Adjusting the image from the second signal source requires the following two steps.

[0121] First, based on the first rectangle and the signal source window, calculate the ratio of the horizontal outer border value of the signal source window to the horizontal outer border value of the first rectangle to obtain a horizontal magnification ratio; calculate the ratio of the vertical outer border value of the signal source window to the vertical outer border value of the first rectangle to obtain a vertical magnification ratio. Based on the horizontal magnification ratio, magnify the second signal source image horizontally; based on the vertical magnification ratio, magnify the second signal source image vertically.

[0122] In some of the application scenarios described above, the `scaleX` and `scaleY` parameters of the `Modifier.graphicsLayer` modifier are used to adjust the display ratio of the second signal source image. Specifically, the `scaleX` parameter represents the horizontal magnification ratio of the signal source window relative to the first cropping window, which is also equal to the horizontal magnification ratio of the second signal source image: `scaleX = horizontal outer border value of the signal source window / horizontal outer border value of the first cropping window`. The `scaleY` parameter represents the vertical magnification ratio of the signal source window relative to the first cropping window, which is also equal to the vertical magnification ratio of the second signal source image: `scaleY = vertical outer border value of the signal source window / vertical outer border value of the first cropping window`. After being magnified both horizontally and vertically, the second signal source image will be proportional to the signal source image in the signal source window.

[0123] The second step involves obtaining the center coordinates of the signal source window and the center coordinates of the first rectangle. The horizontal coordinates of the signal source window and the first rectangle are then subtracted to obtain a horizontal difference. This horizontal difference is multiplied by the horizontal magnification ratio to obtain a horizontal displacement. Based on this horizontal displacement, the center point of the magnified second signal source image is moved horizontally. Similarly, the vertical coordinates of the signal source window and the first rectangle are subtracted to obtain a vertical difference. This vertical difference is multiplied by the vertical magnification ratio to obtain a vertical displacement. Based on this vertical displacement, the center point of the magnified second signal source image is moved vertically.

[0124] In some of the application scenarios described above, the `translationX` and `translationY` parameters of the `Modifier.graphicsLayer` modifier are used to adjust the coordinates of the center point of the second signal source image. Specifically, the `translationX` parameter represents the horizontal displacement of the center point of the signal source window relative to the center point of the first cropping window, where `translationX` = (x-coordinate of the center point of the signal source window - x-coordinate of the center point of the first cropping window). The `translationY` parameter represents the vertical displacement of the center point of the signal source window relative to the center point of the first cropping window, where `translationY` = (y-coordinate of the center point of the signal source window - y-coordinate of the center point of the first cropping window). Multiplying `translationX` by `scaleX` yields the horizontal displacement of the center point of the second signal source image; multiplying `translationY` by `scaleY` yields the vertical displacement of the center point of the second signal source image.

[0125] For example, assuming the signal source window is located entirely in the first quadrant of the coordinate system, and the lower left corner of the signal source window is located at the origin of the coordinate system, if the value of translationX multiplied by scaleX and the value of translationY multiplied by scaleY are both negative, it indicates that the center point of the second signal source image is located to the upper right of the center point of the signal source image. Therefore, the center point of the second signal source image needs to be moved to the lower left. Specifically, it needs to be moved to the left by the value of translationX multiplied by scaleX and moved downwards by the value of translationY multiplied by scaleY, to coincide with the coordinate position of the center point of the signal source image. If the value of translationX multiplied by scaleX is negative and the value of translationY multiplied by scaleY is positive, it indicates that the center point of the second signal source image is located to the lower right of the center point of the signal source image. Therefore, the center point of the second signal source image needs to be moved to the upper left. Specifically, it needs to be moved to the left by the value of translationX multiplied by scaleX and moved upwards by the value of translationY multiplied by scaleY, to coincide with the coordinate position of the center point of the signal source image. If the value of translationX multiplied by scaleX is positive and the value of translationY multiplied by scaleY is negative, it means that the center point of the second signal source image is located to the upper left of the center point of the signal source image. In this case, the center point of the second signal source image needs to be moved to the lower right. Specifically, it needs to be moved to the right by the value of translationX multiplied by scaleX and moved downwards by the value of translationY multiplied by scaleY, until it coincides with the coordinates of the center point of the signal source image. If the value of translationX multiplied by scaleX is positive and the value of translationY multiplied by scaleY is positive, it means that the center point of the second signal source image is located to the lower left of the center point of the signal source image. In this case, the center point of the second signal source image needs to be moved to the upper right. Specifically, it needs to be moved to the right by the value of translationX multiplied by scaleX and moved upwards by the value of translationY multiplied by scaleY, until it coincides with the coordinates of the center point of the signal source image.

[0126] In this technical solution, since there may be multiple first cropping windows, and the scaling ratio of each first cropping window may be different, the magnification ratio and the number of moved pixels of the second signal source image will also be different. The movement distance calculated based on the scaling ratio can avoid errors.

[0127] After the above two steps, the captured image content will be displayed in the first cropping window. The display ratio of this image content is consistent with the display ratio of the signal source image in the signal source window. It should be noted that the signal source image content located outside the border of the first cropping window layer will be cropped out, either placed at the bottom layer or set to transparent, so that only the signal source image content within the selected area of ​​the first cropping window is visible to the user. The cropped image display scheme using Modifier.graphicsLayer performs encoding and decoding processing on the complete signal source image of the signal source device without changing the underlying encoding and decoding logic. For example, if the resolution of the signal source image is 1080P, the encoding and decoding will always output the signal source image at this size, regardless of whether cropping is performed. The Modifier.graphicsLayer modifier performs magnification and displacement processing on the signal source image without interfering with the original data of the signal source device. Therefore, the signal source image will not be blurred or distorted due to the cropping operation. This cropping operation is fast and the displayed image is clear. From the user's perspective, it looks like a partial view taken directly from the signal source, resulting in a good user experience.

[0128] In some optional implementations of this embodiment, the following method can be used: based on the cropping data, define the transformation parameters of the graphics layer, and create a first cropping window based on the transformation parameters of the graphics layer:

[0129] The first step is to add the cropped data to the field properties of the signal source window.

[0130] The field properties of the signal source window are used to store the corresponding clipping data when clipping the signal source window.

[0131] Specifically, a window object (in Kotlin, the programming language) is created for the signal source window. Field properties are set on this window object. These field properties can include (save) at least one of the following clipping data: the horizontal coordinate of the clipping start point, the vertical coordinate of the clipping start point, the ratio of the horizontal outer border of the image, and the ratio of the vertical outer border of the image. The horizontal coordinate of the clipping start point can be the horizontal coordinate of the top-left corner of the first clipping window, or the horizontal relative position between the start point of the first clipping window and the start point of the signal source window. The vertical coordinate of the clipping start point can be the vertical coordinate of the top-left corner of the first clipping window, or the vertical relative position between the start point of the first clipping window and the start point of the signal source window. The horizontal outer border ratio represents the ratio of the horizontal outer border of the first clipping window to the horizontal outer border of the signal source window. The vertical outer border ratio represents the ratio of the vertical outer border of the first clipping window to the vertical outer border of the signal source window.

[0132] The second step is to define a graphic layer using screen layout modifiers, obtain the cropping data of the field attributes of the graphic layer, and obtain the first starting point and the first ending point that are diagonally related based on the cropping data and the original data of the signal source window.

[0133] Among them, the layout modifier is a tool or attribute used to adjust the layout of the screen. It can affect the position, size, alignment, spacing, and other aspects of various elements in the screen.

[0134] The first starting point can represent the starting point of the cropping operation performed in the cropped data.

[0135] The first cutoff point can represent the termination point of the cropping operation performed in the cropped data.

[0136] The third step is to construct a first diagonal line based on the first starting point and the first ending point, and draw a first rectangle based on the first diagonal line, using the first rectangle as the first clipping window.

[0137] The first diagonal can be the diagonal from the first starting point to the first ending point.

[0138] The first rectangle can be a rectangle drawn based on the first diagonal.

[0139] It is understandable that, in the above optional implementation methods, since the first cropping window is determined by the screen layout modifier, the encoding and decoding logic of the signal source video stream will not be changed.

[0140] In some application scenarios of the above-mentioned optional implementation methods, the cropping image located at the cropping position can be determined from the second signal source image based on the cropping data in the following manner:

[0141] The first step is to obtain the coordinates of the starting point of the cropped image based on the first starting point.

[0142] Here, the coordinates of the top left corner of the first cropping window in the preset coordinate system can be determined as the starting point coordinates of the cropping screen.

[0143] The second step is to obtain the coordinates of the cutoff point of the cropped image based on the first cutoff point.

[0144] Here, the coordinates of the lower right corner of the first cropping window in the preset coordinate system can be determined as the coordinates of the cutoff point of the cropping screen.

[0145] The third step is to obtain the cropping outer border of the cropped image based on the first rectangle.

[0146] Here, for example, the first rectangle can be used as the outer border of the cropped image.

[0147] The fourth step is to define the cropped image as the image within the outer frame of the second signal source image, which is located from the starting point coordinates to the ending point coordinates.

[0148] Understandably, in the above application scenarios, the cropping image can be determined more accurately by using the first starting point, the first ending point, and the first rectangle.

[0149] In some of the above application scenarios, the following steps can also be performed:

[0150] The first step is to determine the second cropping data corresponding to the second cropping operation in response to the second cropping operation of the second signal source image played in the first cropping window.

[0151] The second cropping operation can be used to crop the second signal source image played in the first cropping window.

[0152] The second cropping data can be data generated by performing a second cropping operation. As an example, the second cropping data may include the cropping position indicated by the second cropping operation.

[0153] The second step is to define the second transformation parameters of the graphics layer based on the second cropping data, and create a second cropping window based on the second transformation parameters of the graphics layer.

[0154] A graphics layer can be a specific layer or area used to present visual elements such as graphics and images during the display or processing of a signal source screen.

[0155] The second transformation parameter can be data for the second cropping window obtained based on calculations of the second cropping data. For example, the second transformation parameter may include the position, height, and width of the second cropping window.

[0156] The second cropping window can be a cropping window created based on the second transformation parameters.

[0157] The clipping position can represent the relative position between the second clipping window and the signal source window (each clipping is calculated based on the relevant data of the signal source window). The clipping position can include at least one of the following: the displacement between the center position of the second clipping window and the center position of the signal source window, the distance between the two vertices of the diagonal of the second clipping window and the border of the signal source window, etc.

[0158] In practice, it can be determined whether a clipping operation has been detected by detecting mouse events or gesture events.

[0159] The second cropping window can be independent of the first cropping window, or the second cropping window can be superimposed on the first cropping window.

[0160] The third step is to determine the second cropping screen located at the cropping position from the third signal source screen based on the second cropping data.

[0161] Here, after determining the cropping position, the area covered by the cropping position in the third signal source image can be used as the second cropped image.

[0162] The fourth step is to display the second cropping screen in the second cropping window.

[0163] After the second cropping frame is determined, it can be displayed in the second cropping window. Specifically, the second cropping frame can be displayed in a second cropping window that is spaced apart from the first cropping window, or it can be displayed as a second cropping window superimposed on the first cropping window.

[0164] The specific method of displaying the second cropped screen can be referred to the method of displaying the cropped screen, and will not be repeated here.

[0165] It is understandable that, in the above situation, the already cropped image can be cropped again. This allows for multiple nested cropping of the signal source image.

[0166] In the embodiments of this application, the starting coordinates and ending coordinates of the second cropping window are calculated based on the width and height of the first cropping window and the width and height of the signal source window.

[0167] The x-coordinate of the starting point of the second cropping window = the x-coordinate of the top left corner of the second cropping window relative to the first cropping window ÷ the width of the signal source window × the width of the first cropping window + the x-coordinate of the top left corner of the first cropping window relative to the signal source window.

[0168] The y-coordinate of the starting point of the second cropping window = the y-coordinate of the top left corner of the second cropping window relative to the first cropping window ÷ the height of the signal source window × the height of the first cropping window + the y-coordinate of the top left corner of the first cropping window relative to the signal source window.

[0169] It should be noted that the second cropping window, relative to the first cropping window, is defined with the center of the first cropping window located at the origin of the quadrant, and the values ​​of the second cropping window are determined accordingly. Similarly, the first cropping window, relative to the signal source window, is defined with the center of the signal source window located at the origin of the quadrant, and the values ​​of the first cropping window are determined accordingly. The above calculation formula yields the values ​​of the second cropping window relative to the signal source window.

[0170] The calculation formulas for the width and height of the second clipping window are related to the values ​​of the signal source window and the first clipping window.

[0171] The width of the second cropping window = the width of the second cropping window relative to the first cropping window ÷ the width of the signal source window × the width of the first cropping window relative to the signal source window.

[0172] The height of the second clipping window = the height of the second clipping window relative to the first clipping window ÷ the height of the signal source window × the height of the first clipping window relative to the signal source window.

[0173] For example, the values ​​are as follows:

[0174] The signal source window is 1000 pixels wide and 800 pixels high (all units below are pixels).

[0175] The starting coordinates of the second cropping window relative to the first cropping window are (100, 100), the width of the second cropping window relative to the first cropping window is 300 pixels, and the height of the second cropping window relative to the first cropping window is 200 pixels.

[0176] The starting coordinates of the first cropping window relative to the signal source window are (200, 200), the width of the first cropping window relative to the signal source window is 500 pixels, and the height of the first cropping window relative to the signal source window is 400 pixels.

[0177] The x-coordinate of the starting point of the second cropping window = 100 ÷ 1000 × 500 + 200 = 250;

[0178] The y-coordinate of the starting point of the second cropping window = 100 ÷ 800 × 400 + 200 = 250;

[0179] The width of the second cropping window = 300 ÷ 1000 × 500 = 150;

[0180] The height of the second cutting window = 200 ÷ 800 × 400 = 100;

[0181] The starting coordinates of the second cropping window (relative to the signal source window) are (250, 250). The width of the second cropping window relative to the signal source window is 150 pixels, and the height of the second cropping window relative to the signal source window is 100 pixels.

[0182] In some of the above application scenarios, the following steps can also be performed:

[0183] The first step is to determine the third cropping data corresponding to the third cropping operation in response to the third cropping operation on the signal source image played in the signal source window and the second signal source image played in the first cropping window that is at least partially superimposed on it.

[0184] The third cropping data can be data generated by performing a third cropping operation. As an example, the third cropping data can include the cropping position indicated by the third cropping operation.

[0185] The second step is to define the third transformation parameters of the graphics layer based on the third cropping data, and create a third cropping window based on the third transformation parameters of the graphics layer.

[0186] The graphics layer can be a specific layer or area used to present visual elements such as graphics and images during the display or processing of the signal source screen.

[0187] The third transformation parameter can be data for the third cropping window obtained based on calculations of the third cropping data. For example, the third transformation parameter may include the position, height, and width of the third cropping window.

[0188] The third cropping window can be a cropping window created based on the third transformation parameters.

[0189] The third step is to determine the third cropping image located at the cropping position from the fourth signal source image based on the third cropping data.

[0190] Here, after determining the cropping position, the area covered by the cropping position in the fourth signal source image can be used as the third cropped image.

[0191] The fourth step is to display the third cropping screen in the third cropping window.

[0192] After the third cropped image is determined, it can be displayed in the third cropped window. Specifically, the third cropped image can be displayed in a third cropped window that is spaced apart from the first cropped window and the signal source window, or superimposed on the first cropped window and the signal source window.

[0193] The specific method of displaying the third cropped screen can be referred to the method of displaying the cropped screen, and will not be repeated here.

[0194] In the embodiments of this application, after receiving the third cropping operation, it is determined whether the position of the third starting point (e.g., the upper left corner of the third cropping window) and the position of the third ending point (e.g., the lower right corner of the third cropping window) of the third cropping window formed by the cropping operation are located on the same layer. If the position of the third starting point and the position of the third ending point are on the same layer, then the signal source image of that layer is used as the target content of the cropping operation. If the position of the third starting point and the position of the third ending point are not on the same layer, the signal source image of the layer where the third starting point is located can be used as the target content of the cropping operation; the signal source image of the layer where the third ending point is located can also be used as the target content of the cropping operation; or a combination of the signal source images of the layers where the third starting point is located and the signal source images of the layers where the third ending point is located (dual signal source images) can be used as the target content of the cropping operation.

[0195] Taking the example of 'the first cropping window is smaller than the signal source window and is superimposed on the signal source window, the third starting point of the third cropping window is located in the signal source window, the third ending point of the third cropping window is located in the first cropping window, and the signal source image played in the signal source window where the third starting point is located is used as the target content of the cropping operation', the user performs a start cropping operation in the signal source window, the third starting point of the cropping operation is located on the signal source image of the signal source window, and performs a finish cropping operation in the first cropping window, the third ending point of the cropping operation is located on the second signal source image of the first cropping window. Then the third ending point is transmitted through the first cropping window to the signal source window located at the bottom of the first cropping window, and then the coordinate point (the third ending point) is located in the signal source window. Then the signal source image played in the signal source window is captured from the corresponding signal source device side to obtain the fourth signal source image. After magnification and movement processing of the fourth signal source image, the third cropped image captured by the above processing is displayed in the third cropping window. With the technical solution of this application, users do not need to perform display processing on the signal source image to be captured (e.g., move, delete, or place other superimposed windows at the bottom). They only need to specify the target content to be captured. Even if the content at the top layer is selected, the image content at the bottom layer of the top layer can still be displayed in the cropping window. The operation is simple and the user experience is good.

[0196] In the above scenario, the signal source image played in the signal source window and the second signal source image played in the first cropping window, which is at least partially superimposed on it, can be cropped again. This allows for cropping of the superimposed display.

[0197] Figure 2This is a flowchart illustrating another signal source image cropping method based on an Android device, provided as an embodiment of this application. Figure 2 As shown, in some of the application scenarios described above, the following steps can also be performed:

[0198] Step 201: In response to the fourth cropping operation at multiple intervals of the signal source image played in the signal source window, determine the fourth cropping data corresponding to the fourth cropping operation at multiple intervals respectively, so as to obtain the fourth cropping data group.

[0199] Step 202: Based on the fourth cropping data group, define a cropping quantity graphic layer corresponding to the fourth cropping data group, define a fourth transformation parameter corresponding to a fourth cropping data for each graphic layer, and create multiple fourth cropping windows corresponding to the cropping quantity based on the fourth transformation parameter of each graphic layer.

[0200] Step 203: Based on the fourth cropping data group, determine each fourth cropping frame located at the cropping position from the fifth signal source frame;

[0201] Step 204: Display the corresponding fourth cropping screen in each fourth cropping window.

[0202] In this embodiment, the user can perform cropping operations on multiple locations of the signal source image in the same batch. The corresponding fourth cropping windows formed by each cropping operation are spaced apart, and the selected content is independent of each other. In this case, only the fifth signal source image of the signal source device needs to be captured once. The fifth signal source image is then subjected to the same zoom and movement processing as described above. By performing image content selection operations on the corresponding fourth cropping windows on the processed fifth signal source image, the corresponding fourth cropped images are displayed in multiple fourth cropping windows.

[0203] It should be noted that control commands to the signal source screen displayed on the Android device (such as opening a document or playing a video) will execute the corresponding operation on the signal source device. However, cropping commands input to the Android device will only crop the screen displayed on the Android device, and will not crop the signal source screen on the signal source device. That is, the encoding and decoding logic of the signal source screen on the signal source device will not be changed.

[0204] In some optional implementations of this embodiment, the following steps may also be performed:

[0205] The first step is to add a dot event input modifier to respond to touch operations on the screen of the Android device;

[0206] The second step is to call the function that detects drag gestures within the pointer input scope.

[0207] The third step is to obtain the drag start parameter and drag end parameter of the drag gesture detection function;

[0208] Fourth step: Based on the drag start parameters, obtain the drag start coordinates, and use the coordinates corresponding to the drag start coordinates as the starting point coordinates of the cropped image;

[0209] Fifth step: Determine the drag cutoff point coordinates based on the drag end parameters, and use the coordinates corresponding to the drag cutoff point coordinates as the cutoff point coordinates of the cropped screen.

[0210] Specifically, taking gesture events as an example, the Modifier.pointerInput modifier (point event input modifier) ​​can be added to the signal source window to manage screen touch gestures (responding to touch operations on the Android device's screen). The PointerInputScope.detectDragGestures function (the function for detecting drag gestures) of the pointer input scope can be called to listen for specific gesture events and perform specific data collection work, thereby determining whether the clipping operation is executed.

[0211] In this application, the drag start parameter (onDragStart) and drag end parameter (onDragEnd) can be obtained through the PointerInputScope.detectDragGestures function. Specifically, the drag operation (i.e., the clipping operation) can be performed and data recorded as follows:

[0212] ①onDragStart (Gesture Start): Use your finger / stylus to click on a point on the screen and record the coordinates of that point as the starting point (top left corner) coordinates of the selection box (cropping window);

[0213] ②onDrag (gesture movement): Move your finger / stylus to move the selected point of the selection box (cropping window) to the desired position of the screen content. Update the coordinates in real time as the position of the selected point is obtained. Record the latest updated coordinates of the selected point (meaning that no other updated coordinate information is obtained after this update) as the coordinates of the end point (bottom right corner of the selection box).

[0214] ③onDragEnd (Gesture End): Lifting your finger / stylus stops recording, indicating the end of this gesture event group.

[0215] Based on the drag start parameters, the coordinates of the drag start point (top left corner) are obtained. The coordinates corresponding to the drag start point are used as the starting point coordinates of the cropping frame. Based on the drag end parameters, indicating the end of the touch selection box, the coordinates of the selection box's end point are determined as the drag cutoff point coordinates (bottom right corner). The coordinates corresponding to the drag cutoff point are used as the ending point coordinates of the cropping frame. The line connecting the top left and bottom right corners is used as the diagonal of the selection box, and the size of the rectangular selection box is determined based on this diagonal.

[0216] It is understandable that, in the above optional implementation methods, after displaying the cropping window, the cropping window can be dragged to another location for display.

[0217] In some of the examples described above, at least one corresponding coordinate adjustment process can be performed on the drag start point coordinates and the drag cutoff point coordinates based on the positional relationship between the drag start point coordinates and the drag cutoff point coordinates.

[0218] The corresponding coordinate adjustment process includes: keeping the coordinate values ​​unchanged, taking cross-valued coordinate values, and swapping coordinate values.

[0219] After the selection is completed, the starting and ending points determined above are the initial shapes. The ending point is relative to the starting point and may be in any quadrant of the starting point. Taking the method of determining the selection by drawing a diagonal line from the upper left to the lower right as an example, the starting and ending points of the initial shape need to be adjusted according to the specific quadrant situation. The following explanation will be based on the starting point being regarded as the origin located in the quadrant.

[0220] Specifically, when the positional relationship indicates that the endpoint is in the fourth quadrant relative to the starting point (that is, the coordinates of the starting point and the coordinates of the cut-off point are in a left-up-right-down positional relationship), i.e., when the gesture moves to the lower right, the coordinates of the starting point are used as the starting point coordinates of the cropped image; and the coordinates of the cut-off point are used as the ending point coordinates of the cropped image, i.e., the coordinates of the starting point and the cut-off point remain unchanged (the coordinate values ​​remain unchanged).

[0221] When the positional relationship indicates that the endpoint is in the third quadrant relative to the starting point (that is, the starting point coordinates and the cutoff point coordinates are in a right-upper-left-lower positional relationship), that is, when the gesture moves to the lower left, the 'x-coordinate of the cutoff point coordinates and the 'y-coordinate of the starting point coordinates' are used as the starting point coordinates of the cropped image; the 'x-coordinate of the starting point coordinates and the 'y-coordinate of the cutoff point coordinates' are used as the ending point coordinates of the cropped image, that is, the coordinate values ​​are adjusted by cross-taking.

[0222] When the positional relationship indicates that the endpoint is in the second quadrant relative to the starting point (that is, the starting point coordinates and the cutoff point coordinates are in a right-lower-left-upper positional relationship), that is, when the gesture moves to the upper left, the starting point coordinates are used as the cutoff point coordinates of the cropped image; and the cutoff point coordinates are used as the starting point coordinates of the cropped image, that is, the coordinate values ​​are interchanged.

[0223] When the positional relationship indicates that the endpoint is in the first quadrant relative to the starting point (i.e., the starting point coordinates and the endpoint coordinates are in a lower left and upper right positional relationship), that is, when the gesture moves to the upper right, the 'x-coordinate of the starting point coordinates and the 'y-coordinate of the endpoint coordinates' are used as the starting point coordinates of the cropped image; the 'x-coordinate of the endpoint coordinates and the 'y-coordinate of the starting point coordinates' are used as the ending point coordinates of the cropped image, that is, the coordinate values ​​are adjusted by cross-taking.

[0224] It is understandable that, in the above example, by performing at least one corresponding coordinate adjustment process on the drag start point coordinates and the drag cutoff point coordinates according to the positional relationship between the drag start point coordinates and the drag cutoff point coordinates, the cropping accuracy of the signal source screen of the Android device can be further improved.

[0225] In related technologies, Android devices can display and play multiple signal source frames. To meet users' needs for playing a portion of a complete signal source frame, Android devices need to support the function of partially selecting the signal source frame, i.e., signal source frame cropping. In existing technologies, Android devices may use either an XML-based UI system framework or a Compose-based UI system framework. With the XML UI system framework, partially selecting the signal source frame is costly; touch sensitivity is poor, and if the cropping is very fast, the selection box may break; the API design is poor, only returning the coordinates relative to the screen during movement, without returning the difference before and after the movement, which requires further calculation and thus consumes memory. As for the Compose UI system framework, there are currently virtually no solutions on the market that support partially selecting the signal source frame.

[0226] This technical solution is designed for Android devices using the Compose UI system framework.

[0227] Please see Figures 3A-3D , Figures 3A-3D This is a schematic diagram illustrating an application scenario of another signal source image cropping method based on an Android device, provided in an embodiment of this application.

[0228] like Figure 3AAs shown, the page can display multiple signal source images (two are shown in the image). Each signal source image is displayed in a separate signal source window. Therefore, cropping can be performed on any signal source image.

[0229] For example, in Figure 3B In the process, cropping operations were performed on four different signal source images, and the cropping operation performed on each signal source image could produce different cropped images.

[0230] exist Figure 3C In this process, a cropping operation can be performed on the signal source image to obtain a cropped image of the signal source image. Furthermore, a cropping operation can be performed on the cropped image again to obtain a cropped image of the cropped image.

[0231] exist Figure 3D Furthermore, it allows for further cropping operations on the cropped image.

[0232] Figure 4 This is a schematic diagram of a signal source image cropping device based on an Android device, provided in an embodiment of this application. Specifically, it includes:

[0233] The first determining unit 401 is used to determine the cropping data corresponding to the cropping operation in response to the cropping operation of the signal source image played in the signal source window.

[0234] The first creation unit 402 is used to define the transformation parameters of the graphics layer according to the cropping data, and to create a first cropping window according to the transformation parameters of the graphics layer.

[0235] The second determining unit 403 is used to determine the cropping screen located at the cropping position from the second signal source screen based on the cropping data;

[0236] The first display unit 404 is used to display the cropping screen in the first cropping window.

[0237] The signal source image cropping device based on an Android device provided in this embodiment can be as follows: Figure 4 The signal source image cropping device based on Android devices shown can execute all the steps of the signal source image cropping methods based on Android devices described above, thereby achieving the technical effects of the signal source image cropping methods based on Android devices described above. For details, please refer to the relevant descriptions above. For the sake of brevity, it will not be elaborated here.

[0238] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5The illustrated electronic device 500 includes at least one processor 501, a memory 502, at least one network interface 504, and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to implement communication between these components. In addition to a data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 5 The general designated all buses as Bus System 505.

[0239] The user interface 503 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0240] It is understood that the memory 502 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0241] In some implementations, memory 502 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 5021 and application program 5022.

[0242] The operating system 5021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 5022 includes various applications, such as a media player and a browser, used to implement various application functions. Programs implementing the methods of this application embodiment can be included in application program 5022.

[0243] In this embodiment, the processor 501 executes the method steps provided in each method embodiment by calling the program or instructions stored in the memory 502, specifically the program or instructions stored in the application program 5022.

[0244] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in the form of software. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the above method.

[0245] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described above in this application, or combinations thereof.

[0246] For software implementation, the techniques described herein can be implemented by units that perform the functions described above. The software code can be stored in memory and executed by a processor. The memory can be implemented within the processor or external to the processor.

[0247] The electronic device provided in this embodiment may be as follows: Figure 5 The electronic device shown can execute all the steps of the signal source image cropping methods based on Android devices described above, thereby achieving the technical effects of the signal source image cropping methods based on Android devices described above. For details, please refer to the relevant descriptions above. For the sake of brevity, they will not be elaborated here.

[0248] This application also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.

[0249] When one or more programs in the storage medium can be executed by one or more processors to implement the above-mentioned signal source image cropping method based on Android devices executed on the electronic device side.

[0250] The processor described above is used to execute a signal source image cropping program based on an Android device stored in the memory, so as to implement the following steps of the signal source image cropping method based on an Android device executed on the electronic device side.

[0251] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0252] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0253] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0254] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A signal source picture cropping method based on an Android device, characterized in that, The method includes: In response to a cropping operation on the signal source image played in the signal source window, cropping data corresponding to the cropping operation is determined; Based on the cropping data, define the transformation parameters of the graphics layer, and create a first cropping window based on the transformation parameters of the graphics layer; Based on the cropping data, the cropping image located at the cropping position is determined from the second signal source image; The cropping screen is displayed in the first cropping window; Based on the first rectangle and the signal source window, the ratio of the horizontal outer border value of the signal source window to the horizontal outer border value of the first rectangle is calculated to obtain the horizontal magnification ratio; the ratio of the vertical outer border value of the signal source window to the vertical outer border value of the first rectangle is calculated to obtain the vertical magnification ratio, and the first rectangle is used as the first clipping window. Based on the horizontal magnification ratio, the second signal source image is magnified horizontally; based on the vertical magnification ratio, the second signal source image is magnified vertically. The signal source image, the second signal source image, the third signal source image, the fourth signal source image, and the fifth signal source image represent the image content obtained separately from the signal source side device in stages. The center coordinates of the signal source window are obtained based on the signal source window, and the center coordinates of the first rectangle are obtained based on the first rectangle. The difference between the center horizontal coordinate of the signal source window and the center horizontal coordinate of the first rectangle is obtained to obtain the horizontal difference value. The horizontal difference value is multiplied by the horizontal magnification ratio value to obtain the horizontal displacement. Based on the horizontal displacement, the center point of the magnified second signal source image is moved horizontally. The vertical difference is obtained by subtracting the vertical coordinate of the center of the signal source window from the vertical coordinate of the center of the first rectangle. The vertical difference is then multiplied by the vertical magnification ratio to obtain the vertical displacement. Based on the vertical displacement, the center point of the magnified second signal source image is moved vertically.

2. The method according to claim 1, characterized in that, The step of defining transformation parameters for the graphics layer based on the cropping data, and creating a first cropping window based on the transformation parameters of the graphics layer, includes: Add the cropped data to the field properties of the signal source window; A graphic layer is defined using screen layout modifiers. The graphic layer obtains the cropping data of the field attributes. Based on the cropping data and the original data of the signal source window, a first starting point and a first ending point that are diagonally related are obtained. A first diagonal is constructed using the first starting point and the first ending point, and a first rectangle is drawn based on the first diagonal, which is then used as the first clipping window.

3. The method according to claim 2, characterized in that, The method further includes: Create a window object for the signal source window, and set field attributes for the window object. The field attributes include at least one of the following cropping data: the horizontal coordinate value of the cropping start point, the vertical coordinate value of the cropping start point, the ratio of the horizontal outer border of the image, and the ratio of the vertical outer border of the image.

4. The method according to claim 2, characterized in that, The step of determining the cropped image located at the cropping position from the second signal source image based on the cropping data includes: Based on the first starting point, the coordinates of the starting point of the cropped image are obtained; Based on the first cutoff point, the coordinates of the cutoff point of the cropped image are obtained; Based on the first rectangle, the outer border of the cropped image is obtained; The frame in the second signal source image that starts from the starting point coordinates and ends at the ending point coordinates, and is located within the outer border of the cropping frame, is defined as the cropped frame.

5. The method according to claim 4, characterized in that, The method further includes: In response to a second cropping operation on the second signal source image played in the first cropping window, second cropping data corresponding to the second cropping operation is determined; Based on the second cropping data, define the second transformation parameters of the graphics layer, and create a second cropping window based on the second transformation parameters of the graphics layer; Based on the second cropping data, determine the second cropping screen located at the cropping position from the third signal source screen; The second cropping screen is displayed in the second cropping window.

6. The method according to claim 4, characterized in that, The method further includes: In response to a third cropping operation on the signal source image played in the signal source window and the second signal source image played in the first cropping window that is at least partially superimposed thereon, third cropping data corresponding to the third cropping operation is determined; Based on the third cropping data, define the third transformation parameters of the graphics layer, and create a third cropping window based on the third transformation parameters of the graphics layer; Based on the third cropping data, the third cropping image located at the cropping position is determined from the fourth signal source image; The third cropping screen is displayed in the third cropping window.

7. The method according to claim 1, characterized in that, The method further includes: In response to the fourth cropping operation at multiple intervals of the signal source image played in the signal source window, the fourth cropping data corresponding to the fourth cropping operation at each of the multiple intervals is determined to obtain the fourth cropping data group. Based on the fourth cropping data group, define a cropping quantity graphic layer corresponding to the fourth cropping data group, define a fourth transformation parameter corresponding to a fourth cropping data for each graphic layer, and create multiple fourth cropping windows corresponding to the cropping quantity based on the fourth transformation parameter of each graphic layer. Based on the fourth cropping data group, each fourth cropping frame located at the cropping position is determined from the fifth signal source frame; The corresponding fourth cropping screen is displayed in each fourth cropping window.

8. The method according to claim 4, characterized in that, The method further includes: Add a dot event input modifier to respond to touch operations on the screen of the Android device; Call the function that detects drag gestures within the pointer input scope; Obtain the drag start parameter and drag end parameter of the drag gesture detection function; Based on the drag start parameters, the drag start coordinates are obtained, and the coordinates corresponding to the drag start coordinates are used as the starting point coordinates of the cropped image. Based on the drag end parameters, determine the drag cutoff point coordinates, and use the coordinates corresponding to the drag cutoff point coordinates as the cutoff point coordinates of the cropped image.

9. The method according to claim 8, characterized in that, The method further includes: Based on the positional relationship between the drag start point coordinates and the drag cutoff point coordinates, perform at least one corresponding coordinate adjustment process on the drag start point coordinates and the drag cutoff point coordinates; The corresponding coordinate adjustment process includes: keeping the coordinate values ​​unchanged, taking cross-valued coordinate values, and swapping coordinate values.

10. A signal source image cropping device based on an Android device, characterized in that, The device includes: The first determining unit is used to determine the cropping data corresponding to the cropping operation in response to the cropping operation of the signal source image played in the signal source window. The first creation unit is used to define the transformation parameters of the graphics layer according to the cropping data, and to create a first cropping window according to the transformation parameters of the graphics layer. The second determining unit is used to determine the cropping image located at the cropping position from the second signal source image based on the cropping data. The first display unit is used to display the cropping image in the first cropping window; The magnification unit is used to calculate the ratio of the horizontal outer border value of the signal source window to the horizontal outer border value of the first rectangle based on the first rectangle and the signal source window, to obtain a horizontal magnification ratio value; calculate the ratio of the vertical outer border value of the signal source window to the vertical outer border value of the first rectangle, to obtain a vertical magnification ratio value, wherein the first rectangle serves as the first cropping window; magnify the second signal source image horizontally based on the horizontal magnification ratio value; and magnify the second signal source image vertically based on the vertical magnification ratio value. The signal source image, the second signal source image, the third signal source image, the fourth signal source image, and the fifth signal source image represent the image content acquired separately from the signal source side device in stages. The moving unit is configured to: obtain the center coordinates of the signal source window based on the signal source window; obtain the center coordinates of the first rectangle based on the first rectangle; subtract the center horizontal coordinate of the signal source window from the center horizontal coordinate of the first rectangle to obtain a horizontal difference value; multiply the horizontal difference value by the horizontal magnification ratio value to obtain a horizontal displacement; and move the center point of the magnified second signal source image horizontally based on the horizontal displacement; subtract the center vertical coordinate of the signal source window from the center vertical coordinate of the first rectangle to obtain a vertical difference value; multiply the vertical difference value by the vertical magnification ratio value to obtain a vertical displacement; and move the center point of the magnified second signal source image vertically based on the vertical displacement.

11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, it implements the signal source image cropping method based on any one of claims 1-9 of the preceding description.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the signal source image cropping method based on any one of claims 1-9 of the above.