A method, device and equipment for generating a screenshot mixed color animation and a storage medium
By generating an initial animated image and combining it with real-time updates of the screenshot texture displayed after interface switching, and using preset color mixing rules to dynamically fuse the initial texture and target texture, the problem of traditional screenshots lacking dynamic visual effects is solved. This achieves real-time fusion of screenshot content and dynamic animation, improves the interactive experience, and reduces resource consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WINGTECH TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional system screenshot functions lack dynamic visual effects, cannot be integrated with the screenshot content in real time, have a monotonous interactive experience, and rely on third-party application color mixing animation technology, which consumes a lot of resources.
By responding to the screenshot command, an initial animated image is generated and bound to an initial texture. The screenshot texture is then updated in real time in conjunction with the animation loop and the corresponding screenshot texture after the interface switches. The initial texture and the target texture are dynamically blended using preset color mixing rules to generate a screenshot color mixing animation.
It enables real-time fusion of screenshot content and dynamic animation, improving the interactive experience, simplifying the operation process, reducing system resource consumption, and avoiding abnormal issues such as screen tearing and frame loss.
Smart Images

Figure CN122195550A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of animation technology, and in particular to a method, apparatus, device, and storage medium for generating screen capture color mixing animation. Background Technology
[0002] System screenshot refers to the technical means of capturing the static pixel information currently displayed on the screen and saving it as an image file. It is a basic function of electronic devices for recording screen content.
[0003] Current traditional system screenshot functions rely on basic static screenshot technology, which captures static pixels on the screen and saves them as images, lacking dynamic visual effects. For some customized systems, simple additional animation technology uses frame overlays of fade-in / fade-out, scaling, and other independent upper-level animations after the static screenshot is generated, which cannot be integrated with the screenshot content in real time, resulting in a monotonous interactive experience. On the other hand, color mixing animation technology that relies on third-party applications requires users to manually import static screenshots across applications and complete the color mixing through rendering or simple rendering by the third-party application, which consumes a lot of resources. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method, apparatus, device, and storage medium for generating screenshot color-blending animations.
[0005] This disclosure provides a method for generating a screenshot color-blending animation. The method includes: responding to a screenshot command, performing a screenshot operation to capture an initial image of the system interface and bind it to an initial texture; starting an animation loop and displaying a first animation image based on the initial texture; switching the system interface and performing a screenshot operation after each system interface switch to capture an image of the system interface after the switch and bind it to a target texture; after each update of the target texture, performing color blending processing on the initial texture and the target texture based on a preset color blending rule to generate a second animation image and display the second animation image; and obtaining a screenshot color-blending animation of the first animation image and at least one second animation image in response to the end of the animation loop.
[0006] In this implementation, an initial animated image is generated and an initial texture is bound in response to a screenshot command. The screenshot texture corresponding to the display and interface switching is updated in real time through animation loop, which solves the problem of traditional static screenshots lacking dynamic visual effects. The initial texture and target texture are dynamically fused by combining color mixing rules to achieve real-time fusion of screenshot content and dynamic animation, giving the screenshot a dynamic visual performance and improving the interactive experience. Moreover, this application uses the native system to implement color mixing animation, without relying on third-party applications, which can simplify the operation process and reduce system resource consumption.
[0007] In one possible implementation, switching the system interface and performing a screenshot operation after each system interface switch, capturing the image of the switched interface and binding it to the target texture, includes: determining whether the previous frame image has been fully displayed; wherein the previous frame image includes a first animation image or a previous frame second animation image; if the previous frame image has been fully displayed, then switching the system interface; wherein switching the system interface includes switching the system theme or switching the system color mode; performing a screenshot operation to capture the image of the switched interface; if the previous frame image is the first animation image, directly binding the captured image of the switched interface to the target texture; if the previous frame image is the previous frame second animation image, updating the binding of the captured image of the switched interface to the target texture.
[0008] In this implementation, the mechanism of judging the completion of the previous frame ensures precise synchronization between the interface switching and the animation frame rendering rhythm, avoiding abnormal issues such as screen tearing and frame loss caused by asynchronous execution, and ensuring the continuity of animation playback. After each interface switching, a screenshot operation is performed to directly obtain the real image data of the interface after the switching, providing accurate material support for color mixing animation and ensuring the consistency between animation content and interface state. The initial binding and subsequent update binding are handled separately, which not only realizes the initial construction of the target texture, but also completes the real-time iteration of texture data, avoiding texture data redundancy or overwriting errors, and improving the accuracy and efficiency of texture processing.
[0009] In one possible implementation, the initial texture and the target texture are mixed according to a preset color mixing rule to generate and display a second animation image, including: updating the animation progress value, obtaining the color mixing parameters, and determining the color mixing ratio based on the animation progress value and the color mixing parameters; using a shader, the initial texture and the target texture are mixed at the pixel level according to the color mixing ratio to generate and display the second animation image.
[0010] In this implementation, the color mixing ratio is determined by updating the animation progress value and combining it with color mixing parameters. This ensures precise synchronization between the color mixing logic and the animation playback rhythm, achieving smooth transitions in each frame and avoiding abrupt animation jumps caused by fixed-ratio color mixing. Pixel-level color mixing is performed using shaders, leveraging hardware acceleration for parallel computation. This improves processing efficiency, reduces system resource overhead for real-time rendering, and decreases code complexity, facilitating later maintenance and version iteration. The color mixing process achieves a natural fusion of the initial and target textures, ensuring high-quality generation and display of the second animation image, significantly enhancing the visual delicacy and smoothness of the interface transition animation.
[0011] In one possible implementation, the color mixing parameters are obtained, and the color mixing ratio is determined based on the animation progress value and the color mixing parameters, including: loading a preset image and binding it to a color mixing texture, and determining the color mixing ratio based on the animation progress value and the color parameters of the color mixing texture.
[0012] In this implementation, a preset image is loaded and bound to a color mixing texture. The color mixing ratio is determined based on the animation progress value and the color parameters of the color mixing texture. Non-linear and differentiated transition effects can be achieved by using the color and transparency distribution of the image, giving the animation more cool visual expression forms.
[0013] In one possible implementation, obtaining color mixing parameters and determining the color mixing ratio based on the animation progress value and the color mixing parameters includes: loading preset color mixing parameters and determining the color mixing ratio based on the animation progress value and the preset color mixing parameters.
[0014] This implementation method loads preset color mixing parameters and determines the color mixing ratio based on the animation progress value and the preset color mixing parameters. This reduces resource consumption, improves the efficiency of color mixing ratio calculation, and adapts to the performance requirements of low-end and mid-range devices. Determining the path using two color mixing ratios balances the richness of visual effects with the flexibility of computational logic, meeting the animation needs of different scenarios.
[0015] In one possible implementation, loading preset color mixing parameters and determining the color mixing ratio based on the animation progress value and the preset color mixing parameters includes: dividing the initial texture into multiple grid regions and loading preset color mixing parameters for each region; determining the color mixing ratio for each region based on the animation progress value and the preset color mixing parameters; and using a shader to perform pixel-level color mixing processing on the initial texture and the target texture according to the color mixing ratio to generate and display the second animation image, which includes: using a shader to perform pixel-level color mixing processing on the initial texture and the target texture according to the color mixing ratio corresponding to each region to generate the second animation image.
[0016] In this implementation, by dividing the initial texture into multiple grid regions and loading exclusive preset color mixing parameters for each region, the color mixing ratio control of different interface regions can be achieved. The transition rhythm and effects of each region can be customized, which can enhance the visual hierarchy and personalized expression of the animation, improve rendering efficiency, and optimize the user's visual experience.
[0017] In one possible implementation, the method for generating the screenshot color-blending animation further includes: initializing the animation layer and setting the animation layer to not participate in the screenshot mode; after starting the animation loop based on the animation duration and animation frame rate, displaying the screenshot color-blending animation of the first animation image and at least one second animation image in the animation layer.
[0018] This implementation initializes an independent animation layer and sets it to not participate in screenshot mode, preventing subsequent screenshot operations from capturing the animation again. This resolves rendering anomalies such as ghosting and content chaos caused by repeated capture of animation frames, ensuring the purity and stability of the animation display. Simultaneously, by starting an animation loop based on animation duration and frame rate, the playback rhythm and total number of frames can be precisely controlled, ensuring a smooth and even transition and avoiding issues like playback being too fast, too slow, or uneven frame intervals. Displaying the animation image within an animation layer enables layered rendering of the animation and system interface content, enhancing the independence and controllability of animation rendering without affecting the normal display and interaction of the system interface, further optimizing the overall user experience.
[0019] This disclosure also provides a device for generating screenshot color-blending animations. The device includes an animation control module, a screenshot module, a system interface switching module, and a color-blending module. The animation control module controls the screenshot module and the color-blending module. Specifically, the screenshot module, in response to a screenshot command, performs a screenshot operation, capturing an initial image of the system interface and binding it to an initial texture. The animation control module starts an animation loop, displaying a first animation image based on the initial texture. The system interface switching module switches the system interface. The screenshot module also performs a screenshot operation after each system interface switch, capturing an image of the switched system interface and binding it to a target texture. The color-blending module, after each target texture update, performs color-blending processing on the initial texture and the target texture based on preset color-blending rules to generate a second animation image. The animation control module ends the animation loop and displays the screenshot color-blending animation of the first animation image and at least one second animation image in the display area.
[0020] This disclosure also provides a computing device, which includes: a processor; a memory for storing processor-executable instructions; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the screenshot color mixing animation generation method provided in this disclosure.
[0021] This disclosure also provides a computer-readable storage medium storing a computer program for executing the screenshot color mixing animation generation method provided in this disclosure. Attached Figure Description
[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 A flowchart illustrating a method for generating a screenshot color-blending animation provided in this embodiment of the disclosure; Figure 2 A schematic diagram of the structure of a screenshot color mixing animation generation device provided in an embodiment of this disclosure; Figure 3 A schematic diagram of a user-triggered screenshot process provided in an embodiment of this disclosure; Figure 4 A schematic diagram of a texture provided for an embodiment of this disclosure; Figure 5 This is a diagram illustrating the operational framework of an Android system screenshot color mixing animation provided in this embodiment of the disclosure. Figure 6 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present disclosure. Detailed Implementation
[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0025] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0026] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0028] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0029] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0030] Traditional screenshots rely on system interfaces to generate only static images, lacking dynamic visual expression capabilities; moreover, animations use fixed templates and cannot be integrated with the screenshot content in real time, resulting in a monotonous interactive experience; color mixing animations require third-party applications to implement, increasing system resource consumption and development and adaptation complexity; furthermore, the low efficiency of hardware acceleration layer and system thread collaboration easily causes animation stuttering, making it difficult to meet users' needs for high-performance and customizable interface transition effects.
[0031] To address the aforementioned issues, this disclosure provides a method for generating a screenshot color-blending animation. The method includes: responding to a screenshot command, performing a screenshot operation to capture an initial image of the system interface and bind it to an initial texture; starting an animation loop to display a first animation image based on the initial texture; switching the system interface and performing a screenshot operation after each interface switch to capture an image of the switched system interface and bind it to a target texture; after each target texture update, performing color blending processing on the initial texture and the target texture based on preset color blending rules to generate and display a second animation image; and obtaining a screenshot color-blending animation consisting of the first animation image and at least one second animation image upon the end of the animation loop. By generating an initial animation image and binding it to an initial texture in response to a screenshot command, and updating the displayed screenshot texture corresponding to the interface switch in real time through an animation loop, the problem of traditional static screenshots lacking dynamic visual effects is solved. Furthermore, by combining color blending rules to dynamically fuse the initial texture and the target texture, real-time fusion of the screenshot content and dynamic animation is achieved, giving the screenshot a dynamic visual appearance and improving the interactive experience. Moreover, this application utilizes the native system to implement the color-blending animation, eliminating the need for third-party applications, simplifying the operation process, and reducing system resource consumption.
[0032] The method will be described below with reference to specific embodiments.
[0033] Figure 1 This is a flowchart illustrating a method for generating a screenshot color-blending animation according to an embodiment of the present disclosure. This method can be executed by a device for generating screenshot color-blending animations, which can be implemented in software and / or hardware, and is generally integrated into a computing device. Figure 1 As shown, the method includes: S101. In response to the screenshot command, perform the screenshot operation, capture the initial image of the system interface and bind it to the initial texture.
[0034] When the system receives a screenshot command from the user, it activates the dynamic screenshot function. First, it captures a preset area of the system interface currently displayed in the foreground at the pixel level, generating a corresponding initial image. This initial image is the first image captured by the dynamic screenshot.
[0035] Optionally, the user's screenshot commands include keyboard shortcuts, interface button clicks, gesture commands, etc.
[0036] Optionally, the user's screenshot command may also include selecting a preset area to capture, such as the system interface, function menu area, content display area, control operation area, etc. Correspondingly, when performing a screenshot operation, a pixel-level screenshot is taken based on the preset area selected by the user, obtaining an initial image that perfectly matches the area boundary.
[0037] Furthermore, the initial image is bound to the initial texture. Here, the texture is a digitized image data carrier and a fundamental resource used in the graphics rendering pipeline.
[0038] Specifically, the initial image is converted and stored in the initial texture according to a format recognizable by graphics rendering. For example, formats recognizable by graphics rendering include RGB format, RGBA format, etc. S102. Start the animation loop and display the first animation image based on the initial texture.
[0039] Among them, the animation loop is a loop of dynamic image capture and color mixing animation generated by dynamic screenshot.
[0040] In one possible implementation, the animation duration and frame rate are preset, and an animation loop is started. In another possible implementation, the animation loop is started based on the Vsync signal. At the initial stage of the animation loop, image data from the initial texture is directly read, and the first animated image is rendered and displayed.
[0041] In one possible implementation, the first animated image is displayed in a preset animation layer.
[0042] Specifically, after the system completes the binding of the initial image and initial texture, an animation layer is initialized and set to not participate in the screenshot mode. Understandably, the animation layer is used to hold and display the screenshot's color-blending animation, isolated from the normal display layers of the system interface. In any subsequent screenshot operation, the screenshot function automatically filters the content of the animation layer, capturing only the actual content layer of the system interface. This method avoids rendering anomalies such as image overlap and nested loops caused by secondary capture of the animation image.
[0043] Furthermore, the system initiates an animation loop process according to the animation duration and frame rate, loads the image from the initial texture into the initialized animation layer, and generates and displays the first animation image. Understandably, the first animation image serves as the starting frame for the screenshot color mixing animation. The display position of the first animation image is consistent with the preset area of the system interface.
[0044] This implementation initializes an independent animation layer and sets it to not participate in screenshot mode, preventing subsequent screenshot operations from capturing the animation again. This resolves rendering anomalies such as ghosting and content chaos caused by repeated capture of animation frames, ensuring the purity and stability of the animation display. Simultaneously, by starting an animation loop based on animation duration and frame rate, the playback rhythm and total number of frames can be precisely controlled, ensuring a smooth and even transition and avoiding issues like playback being too fast, too slow, or uneven frame intervals. Displaying the animation image within an animation layer enables layered rendering of the animation and system interface content, enhancing the independence and controllability of animation rendering without affecting the normal display and interaction of the system interface, further optimizing the overall user experience.
[0045] S103. Switch the system interface and perform a screenshot operation after each system interface switch, capture the image of the system interface after the switch and bind it to the target texture.
[0046] A screenshot operation is triggered after each system interface switch. Specifically, after a system interface switch, a preset area of the currently displayed system interface is captured pixel by pixel according to the user's screenshot command to obtain the corresponding image.
[0047] Optionally, switching the system interface includes switching the system theme or switching the system color mode. Switching the system theme includes switching from a light theme to a dark theme, and switching the system color mode includes switching from RGB color mode to monochrome mode.
[0048] Furthermore, the captured image is bound to the target texture. Similarly, the captured image is converted and stored in the target texture according to a format recognizable by graphics rendering.
[0049] Understandably, when switching the system interface is the first time, the captured image is directly bound to the target texture. When switching the system interface is not the first time, the target texture is still bound to the previous frame image, so the newly captured image is updated and bound to the target texture.
[0050] S104. After each update of the target texture, the initial texture and the target texture are mixed according to the preset color mixing rules to generate a second animation image and display the second animation image.
[0051] Each time the initial binding or update binding of the target texture is completed, the system starts the color mixing process, and performs color mixing processing on the initial system interface image in the initial texture and the image of the system interface after switching in the target texture according to the preset color mixing rules, generating a second animation image after the current system interface and the initial system interface are mixed.
[0052] Specifically, the preset color mixing rules include color mixing parameters related to the current animation progress, and the color mixing ratio is determined based on the animation progress value and the color mixing parameters.
[0053] The current animation progress refers to the playback progress within the animation layer, such as 0.001, 0.002, 0.003, etc. The color mixing parameters include the target effect's color value, transparency gradient coefficient, pixel weight allocation ratio, color channel blending threshold, and target color value. The target effect's color value includes color values for effects such as target grayscale or target cool colors. The color mixing parameters are calculated and set based on the current animation progress.
[0054] In this implementation, the color mixing ratio is determined by updating the animation progress value and combining it with color mixing parameters. This ensures precise synchronization between the color mixing logic and the animation playback rhythm, achieving smooth transitions in each frame and avoiding abrupt animation jumps caused by fixed-ratio color mixing. Pixel-level color mixing is performed using shaders, leveraging hardware acceleration for parallel computation. This improves processing efficiency, reduces system resource overhead for real-time rendering, and decreases code complexity, facilitating later maintenance and version iteration. The color mixing process achieves a natural fusion of the initial and target textures, ensuring high-quality generation and display of the second animation image, significantly enhancing the visual delicacy and smoothness of the interface transition animation.
[0055] In one possible implementation, a preset image is loaded and bound to a color blending texture, and the color blending ratio is determined based on the animation progress value and the color parameters of the color blending texture.
[0056] Specifically, a preset image is initialized, and its pixel data is bound to a color mixing texture. The preset image is a mask image used for color mixing, such as a gradient image, a mask image, or a color map.
[0057] Read the color parameters of the blend texture and calculate the blending ratio based on the animation progress value and the color parameters of the blend texture. For example, the color parameter is the transparency of the blend texture.
[0058] Specifically, the method for calculating the color mixing ratio is as follows: float alpha = smoothstep(texture1Color.a - uProgress, texture1Color.a, uProgress).
[0059] Here, `smoothstep` is a built-in function in shader programming languages used to perform smooth interpolation between two values. `texture1Color.a` is the color parameter of the blended texture, and `uProgress` is the animation progress value.
[0060] For example, the color parameter of the color mixing texture is 0.7, the animation progress value is 0.5, and texture1Color.a -uProgress is 0.2. The smooth difference between the animation progress value and the range of 0.2 and 0.7 is calculated to obtain a color mixing ratio of 0.68.
[0061] In this implementation, a preset image is loaded and bound to a color mixing texture. The color mixing ratio is determined based on the animation progress value and the color parameters of the color mixing texture. Non-linear and differentiated transition effects can be achieved by using the color and transparency distribution of the image, giving the animation more cool visual expression forms.
[0062] In one possible implementation, the color mixing ratio is determined based on the animation progress value and the preset color mixing parameters when loading preset color mixing parameters.
[0063] Similarly, the method for calculating the color mixing ratio is as follows: float alpha = smoothstep(presetColor.a - uProgress, presetColor.a,uProgress).
[0064] Here, presetColor.a represents the preset color mixing parameters. The specific calculation method is the same as described in the above embodiment and will not be repeated here.
[0065] Furthermore, using shaders, pixel-level color mixing is performed on the initial texture and the target texture according to the color mixing ratio to generate a second animation image.
[0066] Specifically, the initial texture, target texture, and blending ratio are loaded into the shader. The shader then blends the initial and target textures in the opposite manner, that is, it integrates all pixels according to the blending ratio to obtain the completed second animation image. The blending calculation method is as follows: gl_FragColor = mix(texture2Color, texture3Color, alpha) Where texture2Color is the color parameter of the initial texture, and texture3Color is the color parameter of the target texture.
[0067] For example, when the color mixing ratio is 0.68, the initial texture and the target texture are mixed pixel-level to generate a second animation image, with the target texture having a pixel ratio of 0.32 and the initial texture having a pixel ratio of 0.68.
[0068] In this implementation, by loading preset color mixing parameters and determining the color mixing ratio based on the animation progress value and the preset color mixing parameters, resource consumption can be reduced, the efficiency of color mixing ratio calculation can be improved, and the performance requirements of low-end and mid-range devices can be adapted.
[0069] In another possible implementation, the initial texture is divided into multiple grid regions, preset color mixing parameters are loaded for each region, the color mixing ratio of each region is determined based on the animation progress value and the preset color mixing parameters, and pixel-level color mixing processing is performed on the initial texture and the target texture according to the color mixing ratio corresponding to different regions to generate the second animation image.
[0070] In this implementation, by dividing the initial texture into multiple grid regions and loading exclusive preset color mixing parameters for each region, the color mixing ratio control of different interface regions can be achieved. The transition rhythm and effects of each region can be customized, which can enhance the visual hierarchy and personalized expression of the animation, improve rendering efficiency, and optimize the user's visual experience.
[0071] The path is determined by the two color mixing ratios mentioned above, which balances the richness of visual effects with the flexibility of computational logic, thus meeting the animation needs of different scenarios.
[0072] Furthermore, a second animated image is displayed in a preset animation layer. Specifically, the second animated image is further loaded into the initialized animation layer.
[0073] In one possible implementation, the system interface switching operation is performed after the previous frame image has been displayed in the animation layer. Here, "the previous frame image has been displayed in the animation layer" means that the rendering duration of the previous frame image in the animation layer reaches the single-frame duration corresponding to the animation duration and animation frame rate.
[0074] Specifically, the display status of the first animated image in the animation layer is monitored in real time to determine whether the first animated image has finished displaying. When the first animated image has finished displaying, a system interface switching operation is triggered, and the system interface is switched for the first time. After the first system interface switch, the dynamic screenshot function is immediately activated to capture the corresponding preset area of the switched interface at the pixel level, capturing the image of the switched interface. At this time, the previous frame image is the first animated image. The captured image of the switched interface is directly bound to the target texture, and the initial texture and the target texture are mixed according to the preset color mixing rules to generate the second animated image, which is then displayed in the animation layer.
[0075] Furthermore, the display status of the second animated image in the animation layer is monitored in real time to determine whether the second animated image has finished displaying. When the second animated image has finished displaying, a system interface switching operation is triggered to switch the system interface. After switching the system interface, the dynamic screenshot function is immediately activated to capture the corresponding preset area of the switched interface at the pixel level, capturing the image of the switched interface. At this time, the previous frame image is the second animated image. The captured image of the switched interface is updated and bound to the target texture. Based on the preset color mixing rules, the initial texture and the target texture are mixed to generate the second animated image, which is then displayed in the animation layer. Similarly, the second animated image is continuously generated and displayed using the above method.
[0076] In this implementation, the mechanism of judging the completion of the previous frame ensures precise synchronization between the interface switching and the animation frame rendering rhythm, avoiding abnormal issues such as screen tearing and frame loss caused by asynchronous execution, and ensuring the continuity of animation playback. After each interface switching, a screenshot operation is performed to directly obtain the real image data of the interface after the switching, providing accurate material support for color mixing animation and ensuring the consistency between animation content and interface state. The initial binding and subsequent update binding are handled separately, which not only realizes the initial construction of the target texture, but also completes the real-time iteration of texture data, avoiding texture data redundancy or overwriting errors, and improving the accuracy and efficiency of texture processing.
[0077] S105. In response to the end of the animation loop, obtain a screenshot color mixing animation of the first animation image and at least one second animation image.
[0078] When the system detects that the animation loop has reached the preset termination condition, it terminates the animation loop and the target texture update, and obtains a screenshot color-blended animation of the first animation image and at least one second animation image.
[0079] Specifically, the animation loop's duration is used to determine whether the animation loop has ended. When the animation loop ends, a continuous screenshot color-blending animation is output.
[0080] Understandably, each frame of the animated image in the screenshot color mixing animation is displayed in real time in the animation layer, and the animation display ends when the animation loop ends.
[0081] In this implementation, an initial animated image is generated and an initial texture is bound in response to a screenshot command. The screenshot texture corresponding to the display and interface switching is updated in real time through animation loop, which solves the problem of traditional static screenshots lacking dynamic visual effects. The initial texture and target texture are dynamically fused by combining color mixing rules to achieve real-time fusion of screenshot content and dynamic animation, giving the screenshot a dynamic visual performance and improving the interactive experience. Moreover, this application uses the native system to implement color mixing animation, without relying on third-party applications, which can simplify the operation process and reduce system resource consumption.
[0082] To implement the above embodiments, this disclosure also proposes an apparatus for generating screenshot color-blending animations. This apparatus can be implemented by software and / or hardware, and is generally integrated into a computing device. Figure 2 This is a schematic diagram of the structure of a screenshot color mixing animation generation device provided in an embodiment of the present disclosure, as shown below. Figure 2 As shown, the screenshot color mixing animation generation device includes a resource loading module, a resource unloading module, an animation control module, a screenshot module, a system interface switching module, and a color mixing module. The animation control module is used to control the screenshot module and the color mixing module. The color mixing module includes a color mixing parameter generation submodule and a rendering submodule.
[0083] The resource loading module is responsible for loading preset image resources, creating and initializing EGL Surfaces, and initializing textures. The resource unloading module is responsible for releasing preset image resources, destroying EGL Displays, Surfaces, and textures to prevent memory leaks.
[0084] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating a user-triggered screenshot process according to an embodiment of this disclosure. When a user performs a click operation, the UI (User Interface Design) is set in the user device module (SystemUI), and a listener is set in the UI mode listening module (system_server) to trigger a system screenshot. An animation is then displayed in the animation implementation module (native animation). Further, after the animation is displayed in the animation implementation module, the UI continues to be set, and the animation display result is monitored in the UI mode listening module. Once the animation is complete, a UI effect switching is triggered, and the switch is performed in the UI effect implementation module (Application).
[0085] The specific process of the screenshot color mixing animation method in this application is as follows: Call the resource loading module, initialize the animation layer, and set the animation layer to not participate in the screenshot mode.
[0086] Call the resource loading module to initialize the shader, load the preset image, and bind it to the blending texture.
[0087] The screenshot module is invoked to take a screenshot, and the MediaProjection or SurfaceControl interface is invoked to capture the system interface image, and the initial image is bound to the initial texture.
[0088] The animation control module displays the first animated image of the initial texture in the animation layer.
[0089] The system interface switching module is invoked to switch the system theme, update application icons, and switch color modes after the first animated image is displayed.
[0090] The animation control module starts the animation loop based on the Vsync signal or the preset animation duration and frame rate.
[0091] The color mixing parameter generation submodule in the color mixing module is called to set the color mixing parameters, update the animation progress, and input the color mixing texture, initial texture and target texture into the shader to generate a dynamic color parameter sequence according to the preset color mixing rules.
[0092] The rendering submodule within the color mixing module is invoked. In the shader, pixel-level color mixing operations are performed on the initial and target textures according to preset color mixing parameters or color parameters such as the transparency of the color mixing texture. The rendered color mixing results are then displayed on the animation layer in the buffer. Specifically, the rendering submodule includes a shader compilation unit and a texture mapping unit. The shader compilation unit compiles the color mixing algorithm into a Graphics Processing Unit (GPU) executable program, and the texture mapping unit binds the screenshot to the GPU texture unit.
[0093] The screenshot module is invoked to take a screenshot. After the system interface switches, the screenshot image is updated and bound to the target texture. For an example, please refer to [link to example]. Figure 4 , Figure 4 This is a schematic diagram of a texture provided for an embodiment of the present disclosure.
[0094] The animation control module decides whether to end the animation loop as needed. If the animation is ended, the resource unloading module is called to release the resources. Otherwise, the animation loop continues to execute, rendering the color mixing results frame by frame to the display buffer to form a continuous animation.
[0095] For example, the code for taking a screenshot includes: Bitmap screenshot= SurfaceControl.screenshot(newRect(0,0,1080,1920)) The code for configuring color mixing parameters includes: int targetColor = Color.parseColor("#FF4081"); / / Pink target color long duration = 500; / / Animation duration 500msInterpolator interpolator = new LinearInterpolator(); / / Linear interpolator The GPU rendering process includes: creating an EGLContext and binding it to the GPU thread; uploading the screenshot bitmap as a GL_TEXTURE_2D texture; and performing color blending in the fragment shader. precision mediump float;uniform sampler2D uTexture;uniform vec3uTargetColor;uniform float uAlpha;void main() { vec4 original = texture2D(uTexture, vTexCoord); gl_FragColor = vec4(mix(original.rgb, uTargetColor, uAlpha),original.a);} The key code for color mixing in the shaders of the rendering submodule includes: void main() { vec4 mColor = texture2D(vMaskTexture, vCoordinate); vec4 bColor = texture2D(vBackgroundTexture,vCoordinate); vec4 fColor = texture2D(vForegroundTexture, vCoordinate); fColor = rgbToGray(fColor, uChangeAlpha); bColor = rgbToColor(bColor, uChangeAlpha); if (uTurnGray == 0) { gl_FragColor = mix(bColor, fColor, smoothstep(mColor.a -uChangeAlpha, mColor.a, uChangeAlpha)); } else { gl_FragColor = mix(fColor, bColor, smoothstep(mColor.a -uChangeAlpha, mColor.a, uChangeAlpha)); } } The animation-driven code includes: Choreographer.getInstance().postFrameCallback(newChoreographer.FrameCallback() { @Override public void doFrame(long frameTimeNanos) { float progress = Math.min(1.0f, (System.currentTimeMillis() -startTime) / duration); float alpha = interpolator.getInterpolation(progress); / / Update shader uAlpha and render if(progress<1.0f)Choreographer.getInstance().postFrameCallback(this); }}); The method and apparatus for generating screenshot color-blending animations disclosed herein can be applied to the Android system. Please refer to... Figure 5 , Figure 5 This disclosure provides a framework diagram for the operation of an Android system screenshot color mixing animation, as shown in the embodiment. Figure 5 As shown, the operational framework diagram includes: The left side is the trigger layer, serving as both user interaction and system entry points. SystemUI is the entry point for users to initiate theme switching operations, including system interface entries such as dropdown panels and mode selection pop-ups. Settings is the entry point for users to initiate system settings applications, including the Settings homepage and mode selection page. Launcher receives broadcasts of style changes to reload application icons. The font update module receives broadcasts of style changes to reload system fonts.
[0096] SettingsProvider is an intermediate storage and distribution module for system settings data, responsible for synchronizing theme change commands to various system services.
[0097] The middle layer is the core service layer, used to implement the aforementioned methods for generating screenshot color-blending animations. Among them, `system_server` (ColorModeService) is the core system service, responsible for managing the global logic of color mode switching, including triggering CoAnimation, listening for interface redraws, and controlling the animation rhythm. `SurfaceFlinger` is the system's underlying compositing service, responsible for receiving the interface layers from various applications, compositing them, and outputting them to the screen; it is the core component of the final animation rendering.
[0098] The right side is the animation execution layer, where the CoAnimation module is responsible for coordinating the transition animations of all interfaces.
[0099] The specific process is as follows: Users can set a screenshot instruction in SystemUI and Settings, which is then sent to system_server via SettingsProvider.
[0100] The system_server continuously monitors changes in the Settings value. When a change in the Settings value is detected, indicating a screenshot indication, CnAnimation is started, and the init process is initiated.
[0101] In CnAnimation, according to Figure 1-3 The method initializes and creates a Surface animation layer, which then waits for the image in SurfaceFlinger. Further steps include capturing the foreground and background images, loading a mask, updating the rendering progress, and updating the image content to the Surface animation layer. Next, animation properties are set, the animation begins, sound effects are played, and the animation loop starts. The animation loop includes drawing content to the Surface, continuously capturing the background image, updating the rendering progress, and waiting for intervals. For example, the rendering progress ranges from 0 to 4500 ms, and the waiting interval is 11.1 ms.
[0102] After the animation starts, the system_server continuously monitors for changes in attribute values to update the desktop, lock screen wallpaper, etc., and broadcasts style changes in real time, updating them in the Launcher and font update modules. Furthermore, it sets the screen color space mode, i.e., color mixing parameters, etc.
[0103] Finally, a screenshot color blending animation is generated in SurfaceFlinger.
[0104] The screenshot color mixing animation in this application can be performed as an independent process, and the animation layer level can be configured as needed, enabling global playback anywhere on mobile devices. By preloading images and extracting the transparency of the image patterns, the transparency value is used as a color mixing parameter to mix the screenshot, achieving cool and complex interface transition effects. Color mixing rendering of screenshots is performed through shaders, reducing code complexity and real-time computing overhead. It is also compatible with different Android versions and devices, solving the problems of traditional screenshot functions lacking dynamic effects and consuming large amounts of third-party application resources, and achieving a high-performance, customizable native color mixing animation experience.
[0105] Figure 6 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present disclosure.
[0106] The following is a detailed reference. Figure 6 The diagram illustrates a structural schematic suitable for implementing the computing device 600 in the embodiments of this disclosure. The computing device 600 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The computing device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0107] like Figure 6 As shown, computing device 600 may include a processor (e.g., central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from memory 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of computing device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0108] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows computing device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 A computing device 600 with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0109] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a memory 608, or installed from a ROM 602. When the computer program is executed by the processor 601, it performs the functions defined in the screenshot color mixing animation generation method of embodiments of this disclosure.
[0110] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0111] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0112] The aforementioned computer-readable medium may be included in the aforementioned computing device; or it may exist independently and not assembled into the computing device.
[0113] The aforementioned computer-readable medium carries one or more programs, which, when executed by the computing device, cause the computing device to perform the aforementioned method for generating screenshot color mixing animation.
[0114] The computing device can be programmed with computer program code in one or more programming languages or a combination thereof to perform the operations of this disclosure. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0116] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0117] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0118] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0119] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0120] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0121] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating a screenshot color-blending animation, characterized in that, The method includes: In response to a screenshot command, perform a screenshot operation, capture the initial image of the system interface, and bind it to the initial texture; Start the animation loop and display the first animation image based on the initial texture; Switch the system interface and take a screenshot after each interface switch, capturing the image of the system interface after the switch and binding it to the target texture. After each update of the target texture, the initial texture and the target texture are mixed according to a preset color mixing rule to generate a second animation image and display the second animation image; In response to the end of the animation loop, a screenshot color-blended animation of the first animation image and at least one of the second animation images is obtained.
2. The method for generating screenshot color mixing animation according to claim 1, characterized in that, The process of switching the system interface and taking a screenshot after each interface switch, capturing an image of the interface after the switch, and binding it to a target texture includes: Determine whether the previous frame image has been fully displayed; wherein, the previous frame image includes the first animation image or the previous frame second animation image; Once the previous frame image has finished displaying, the system interface is switched; wherein, switching the system interface includes switching the system theme or switching the system color mode; Perform a screenshot operation to capture an image of the interface after the switch; When the previous frame image is the first animation image, the image of the captured and switched interface is directly bound to the target texture; when the previous frame image is the previous frame second animation image, the image of the captured and switched interface is updated and bound to the target texture.
3. The method for generating screenshot color mixing animation according to claim 1, characterized in that, The process of performing color mixing on the initial texture and the target texture based on preset color mixing rules to generate and display the second animation image includes: Update the animation progress value, obtain the color mixing parameters, and determine the color mixing ratio based on the animation progress value and the color mixing parameters; Using a shader, pixel-level color mixing is performed on the initial texture and the target texture according to the color mixing ratio to generate and display the second animation image.
4. The method for generating screenshot color mixing animation according to claim 3, characterized in that, The step of obtaining the color mixing parameters and determining the color mixing ratio based on the animation progress value and the color mixing parameters includes: Load a preset image and bind it to a color blending texture, and determine the color blending ratio based on the animation progress value and the color parameters of the color blending texture.
5. The method for generating screenshot color mixing animation according to claim 3, characterized in that, The step of obtaining the color mixing parameters and determining the color mixing ratio based on the animation progress value and the color mixing parameters includes: Load preset color mixing parameters, and determine the color mixing ratio based on the animation progress value and the preset color mixing parameters.
6. The method for generating screenshot color mixing animation according to claim 5, characterized in that, The loading of preset color mixing parameters, and determining the color mixing ratio based on the animation progress value and the preset color mixing parameters, includes: The initial texture is divided into multiple grid regions, and preset color mixing parameters for each region are loaded. The color mixing ratio of each region is determined based on the animation progress value and the preset color mixing parameters; The step of using a shader to perform pixel-level color mixing processing on the initial texture and the target texture according to the color mixing ratio, generating the second animation image, and displaying the second animation image includes: Using shaders, pixel-level color mixing is performed on the initial texture and the target texture according to the color mixing ratio corresponding to each region to generate the second animation image.
7. The method for generating screenshot color mixing animation according to claim 1, characterized in that, The method further includes: Initialize the animation layer and set it to not participate in the screenshot mode; After starting the animation loop based on the animation duration and animation frame rate, a screenshot-mixed animation of the first animation image and at least one second animation image is displayed in the animation layer.
8. A device for generating screenshot color-blending animations, characterized in that, The device includes an animation control module, a screenshot module, a system interface switching module, and a color mixing module. The animation control module is used to control the screenshot module and the color mixing module. The screenshot module is used to respond to a screenshot command, perform a screenshot operation, capture the initial image of the system interface, and bind it to the initial texture; The animation control module is used to start the animation loop and display the first animation image based on the initial texture; The system interface switching module is used to switch the system interface; The screenshot module is also used to perform a screenshot operation after each system interface switch, capture the image of the system interface after the switch and bind it to the target texture; The color mixing module is used to perform color mixing processing on the initial texture and the target texture based on a preset color mixing rule after each update of the target texture, so as to generate a second animation image; The animation control module is used to end the animation loop and display a screenshot of the first animation image and at least one of the second animation images in the display area.
9. A computing device, characterized in that, The computing device includes: a processor; a memory for storing executable instructions of the processor; the processor for reading the executable instructions from the memory and executing the instructions to implement the method for generating a screenshot color mixing animation as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the method for generating a screenshot color-blending animation according to any one of claims 1 to 7.