Control background rendering method and device, storage medium and chip

By obtaining multiple hierarchical image data at the target control level, generating blurred background images and extracting target background images, the problems of cross-process processing complexity and resource consumption in the prior art are solved, and efficient control background processing is achieved.

CN119902677APending Publication Date: 2025-04-29BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311407397.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The prior art requires cross-process operations when processing control backgrounds, resulting in complex processing, high resource consumption and low efficiency.

Method used

By obtaining multiple hierarchical image data at the target control level, combining the control's position in the display interface, a blurred background image that can accommodate the control, and extract the target background image of the same size as the control, draw it to the target area of ​​the control, and implement the blurred background processing of the control.

Benefits of technology

Unified processing of multi-layer image data within the same process saves processing resources, improves processing efficiency, and simplifies the complexity of control background processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902677A_ABST
    Figure CN119902677A_ABST
Patent Text Reader

Abstract

The invention relates to a control background rendering method and device, a storage medium and a chip, and relates to the technical field of image processing, and the method comprises the steps: obtaining original image data which are image data corresponding to a plurality of hierarchies located below the hierarchy of a target control, the method comprises the steps of obtaining original image data of a target control, obtaining a blurred background image according to the original image data and a display position of the target control on a display interface, determining a target background image with the same size as the target control from the blurred background image according to image data corresponding to the target control, and displaying the target control according to the target background image. And finally, drawing the target background image to a target area where the target control is located to obtain a fuzzy background of the target control. Therefore, the multi-layer image data under the target control can be uniformly processed in the same process, the fuzzy background of the target control is obtained, processing resources are saved, and the processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to a control background rendering method, device, storage medium and chip. Background Art

[0002] Since the background of a control may involve data at multiple levels, and data at different levels may be processed by different processes, in the related art, only cross-process background blurring can be performed, that is, blurring the images of the background areas involved by using other processes different from the current process, which makes the processing more complicated, consumes more processing resources and has low processing efficiency. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a control background rendering method, device, storage medium and chip, which obtain image data corresponding to multiple levels below the level of the target control, and obtain a blurred background image that can accommodate the target control based on the obtained original image data and the display position of the target control on the display interface, and determine a target background image with the same size as the target control from the blurred background image based on the image data corresponding to the target control, and then draw the target background image to the target area where the target control is located to obtain the blurred background of the target control. In this way, the multiple layers of image data under the target control can be uniformly processed in the same process to obtain the blurred background of the target control, saving processing resources and improving processing efficiency.

[0004] According to a first aspect of an embodiment of the present disclosure, a control background rendering method is provided, comprising:

[0005] Acquire original image data, where the original image data is image data corresponding to multiple levels below the level of the target control;

[0006] Obtaining a blurred background image according to the original image data and the display position of the target control on the display interface, wherein the blurred background image is an image capable of accommodating the target control;

[0007] According to the image data corresponding to the target control, determining a target background image having the same size as the target control from the blurred background image;

[0008] The target background image is drawn to the target area where the target control is located to obtain a blurred background of the target control.

[0009] Optionally, determining a target background image having the same size as the target control from the blurred background image according to the image data corresponding to the target control includes:

[0010] According to the image data corresponding to the target control, a target control image having the same size as the target control is captured in a first canvas, where the first canvas is a newly created canvas capable of accommodating the target control;

[0011] According to the target control image, a target background image is determined from the blurred background image, and the target background image has the same size as the target control image.

[0012] Optionally, determining a target background image from the blurred background image according to the target control image includes:

[0013] Superimposing the target control image and the blurred background image to determine an overlapping area;

[0014] The overlapping area in the blurred background image is retained to obtain the target background image.

[0015] Optionally, obtaining a blurred background image according to the original image data and a display position of the target control on the display interface includes:

[0016] According to the original image data and the display position of the target control on the display interface, a candidate background image is captured in a second canvas, where the second canvas is a newly created canvas capable of accommodating the target control;

[0017] The candidate background image is processed to obtain the blurred background image.

[0018] Optionally, the capturing, in the second canvas, of a candidate background image according to the original image data and a display position of the target control on the display interface comprises:

[0019] Determining target image data from the original image data according to the display position of the target control on the display interface, the target image data being data in the original image data corresponding to the position of the target control;

[0020] According to the target image data, drawing in the second canvas to obtain an original background image;

[0021] The original background image is captured from the second canvas by taking a screenshot of the canvas to obtain the candidate background image.

[0022] Optionally, the processing the candidate background image to obtain the blurred background image includes:

[0023] Performing blur processing on the candidate background image to obtain an original blurred image;

[0024] Based on a target color number, the original blurred image is subjected to color mixing processing to obtain the blurred background image, wherein the target color number is a preset color number corresponding to the target control.

[0025] Optionally, the original image data includes bottom layer window image data and current layer window image data;

[0026] The obtaining of original image data comprises:

[0027] Acquire the bottom layer window image data corresponding to the bottom layer window under the current layer window where the target control is located;

[0028] The image data of the current layer window corresponding to multiple levels below the level of the target control in the current layer window is obtained.

[0029] Optionally, the acquiring the underlying window image data corresponding to the underlying window located below the current window where the target control is located includes:

[0030] The content of the bottom layer window located below the current layer window where the target control is located is captured through cross-process screenshot to obtain the bottom layer window image data.

[0031] Optionally, the acquiring the current layer window image data corresponding to a plurality of levels below the level of the target control in the current layer window includes:

[0032] The content of multiple levels below the level of the target control in the current window is captured from the third canvas through canvas screenshot to obtain the image data of the current window. The third canvas is used to draw the image of the current window.

[0033] According to a second aspect of an embodiment of the present disclosure, a control background rendering device is provided, including:

[0034] An acquisition module is configured to acquire original image data, where the original image data is image data corresponding to a plurality of levels below the level of the target control;

[0035] A first obtaining module is configured to obtain a blurred background image according to the original image data and a display position of the target control on the display interface, wherein the blurred background image is an image capable of accommodating the target control;

[0036] A determination module, configured to determine a target background image having the same size as the target control from the blurred background image according to the image data corresponding to the target control;

[0037] The second obtaining module is configured to draw the target background image to the target area where the target control is located to obtain the blurred background of the target control.

[0038] According to a third aspect of an embodiment of the present disclosure, a control background rendering device is provided, including:

[0039] processor;

[0040] a memory for storing processor-executable instructions;

[0041] Wherein, the processor is configured to implement the steps of the control background rendering method provided by the first aspect of the present disclosure when executing.

[0042] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the control background rendering method provided in the first aspect of the present disclosure are implemented.

[0043] According to a fifth aspect of an embodiment of the present disclosure, a chip is provided, including a processor and an interface; the processor is used to read instructions to execute the method for control background rendering provided by the first aspect of the present disclosure.

[0044] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0045] By acquiring image data corresponding to multiple levels below the level of the target control, and according to the acquired original image data, combined with the display position of the target control on the display interface, a blurred background image that can accommodate the target control is obtained, and according to the image data corresponding to the target control, a target background image of the same size as the target control is determined from the blurred background image, and then the target background image is drawn to the target area where the target control is located to obtain the blurred background of the target control. In this way, the multiple layers of image data below the target control can be uniformly processed in the same process to obtain the blurred background of the target control, saving processing resources and improving processing efficiency.

[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0048] Figure 1 The present invention is a schematic diagram showing the contents of a display interface including controls according to an exemplary embodiment.

[0049] Figure 2 The present invention is a flowchart of a control background rendering method according to an exemplary embodiment.

[0050] Figure 3 The invention is a flow chart showing a method for determining a blurred background image according to an exemplary embodiment.

[0051] Figure 4 The figure is a flowchart of a method for obtaining a candidate background image according to an exemplary embodiment.

[0052] Figure 5 The figure is a flow chart showing a method for obtaining a target background image according to an exemplary embodiment.

[0053] Figure 6 The figure is a flow chart showing another method for obtaining a target background image according to an exemplary embodiment.

[0054] Figure 7 is a schematic diagram of a target control with a mixed background according to an exemplary embodiment.

[0055] Figure 8 is a schematic diagram of another mixed-background target control according to an exemplary embodiment.

[0056] Fig. 9 The present invention is a block diagram of a control background rendering device according to an exemplary embodiment.

[0057] Fig.10 The invention is a block diagram showing a device for controlling a background rendering according to an exemplary embodiment. DETAILED DESCRIPTION

[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0059] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0060] Since the background of a control may involve data at multiple levels, and data at different levels may be processed by different processes. In the related art, only cross-process background blurring can be performed for background blurring of special-shaped controls, that is, blurring the images of the background areas involved by using other processes different from the current process, which results in more complicated processing, more processing resources are consumed, and the processing efficiency is low. Special-shaped controls are controls with unconventional shapes, such as controls with non-rectangular or non-rectangular shapes, and controls similar to rectangles may be in the shape of chamfered rectangles.

[0061] Figure 1 is a schematic diagram showing the contents of a display interface including controls according to an exemplary embodiment. Figure 2 is a flowchart of a control background rendering method according to an exemplary embodiment. Figure 1 and Figure 2 As shown, the method can be used in a terminal and may include the following steps.

[0062] In step S201, original image data is acquired, where the original image data is image data corresponding to multiple levels below the level of the target control.

[0063] In this embodiment, the target control is the control to be drawn, and the control whose background needs to be blurred. The target control may be a special-shaped control, which is a control with an unconventional shape, such as a control with a non-rectangular or non-rectangular shape, such as a cloud-shaped control, a number-shaped control, or a five-pointed star-shaped control, etc. Figure 1 As shown, Figure 1 The 101 in the figure is a special-shaped control in the shape of a number. The control similar to a rectangle may be a shape obtained by chamfering a rectangle.

[0064] like Figure 1As shown, for a target control, from the display perspective, the target control may be in another parent control, and the target control and the parent control of the target control are in the same current window, that is, there are multiple levels of data in the current window, and there may be other windows under the current window, and other windows also have their corresponding data, and different windows also belong to different levels. Taking the mobile phone display interface as an example, the target control can be an operable control that appears when a certain application icon is long pressed. The control may include adding widgets and editing icons, and may also include sharing or uninstalling. The parent control may be the invisible content under the target control, and the current window is the window where the target control and its parent control are located. The current window may also include icons of multiple other applications, as well as displayed time values, etc. The bottom window may be a window of a lower layer, which may include mobile phone wallpaper and other content. Multiple levels are superimposed on each other, and the content of the next level can be covered by the content of the previous level. Then, the background of the target control is the content covered by the target control, including the content of the covered parent control and the content of other covered windows. When processing the background of the target control, the image data corresponding to the multiple levels below the target control can be obtained first. When displayed, all content is displayed in the form of images, so each image data can be an image of content on at least one level. By obtaining the original image data, the data including different levels and from different processes can be processed uniformly.

[0065] In step S202, a blurred background image is obtained according to the original image data and the display position of the target control on the display interface. The blurred background image is an image that can accommodate the target control.

[0066] In this embodiment, the original image data can be used to draw a display image located below the level of the target control, and combined with the display position of the target control on the display interface, the display image drawn using the original image data can be intercepted. The intercepted image is the image covered by the target control. The intercepted image is further processed to obtain a blurred background image corresponding to the display position of the target control.

[0067] In another embodiment, each original image data can be captured directly according to the display position of the target control on the display interface, and the captured original image data can be used to draw the image covered by the target control, and the image covered by the target control can be further processed to obtain a blurred background image corresponding to the display position of the target control.

[0068] In step S203, a target background image having the same size as the target control is determined from the blurred background image according to the image data corresponding to the target control.

[0069] In this embodiment, the image data corresponding to the target control can be obtained, wherein the image data corresponding to the target control is used to draw the target control. The blurred background image can be intercepted according to the image data corresponding to the target control to obtain a target background image of the same size as the target control. For example, the blurred background image can be intercepted by superimposing the image corresponding to the target control with the blurred background image to obtain the target background image.

[0070] In step S204, the target background image is drawn to the target area where the target control is located to obtain a blurred background of the target control.

[0071] In this embodiment, the target area where the target control is located can be determined based on the display position of the target control on the display interface. In the process of drawing the image of the display interface, after drawing the images of multiple levels below the level of the target control, before drawing the target control, based on the obtained target background image, the target background image can be drawn to the target area corresponding to the display position of the target control to replace the original content, so as to obtain the blurred background of the target control.

[0072] In a possible implementation, the original image data includes bottom layer window image data and current layer window image data. The method for obtaining the original image data may be: obtaining bottom layer window image data corresponding to the bottom layer window located below the current layer window where the target control is located; obtaining current layer window image data corresponding to multiple layers located below the layer of the target control in the current layer window.

[0073] In this embodiment, the image drawing method for the display interface is that the content of a window is drawn through a canvas, and when drawing the content of each window, it is drawn from the lower layer to the upper layer in sequence. The content below the level of the target control can be obtained twice, that is, the original image data includes the bottom window image data and the current window image data, wherein the bottom window image data is the content of the bottom window below the current window where the target control is located, and the current window image data is the content of multiple levels below the level of the target control in the current window.

[0074] In a possible implementation, a method for obtaining underlying window image data corresponding to an underlying window located below the current window where a target control is located may be: capturing the contents of the underlying window located below the current window where the target control is located through cross-process screenshots to obtain the underlying window image data.

[0075] In this embodiment, the underlying window image data is the screenshot corresponding to the content of other underlying windows under the current window. The content of the underlying window under the current window where the target control is located can be captured through cross-process screenshot to obtain the underlying window image data. Specifically, the cross-process screenshot interface can be called to take a screenshot of the content of other underlying windows under the current window through SurfaceFlinger to generate SkImage: snap_sf, that is, the underlying window image data.

[0076] In a possible implementation, a method for obtaining image data of the current layer window corresponding to multiple levels below the level of the target control in the current layer window may be: by taking a screenshot of the canvas, the contents of multiple levels below the level of the target control in the current layer window are captured from a third canvas to obtain the image data of the current layer window, and the third canvas is used to draw the image of the current layer window.

[0077] In this embodiment, when drawing the content of the current window, a drawing task may be created, that is, a SkSurface may be created, and the content may be drawn through the third canvas corresponding to the drawing task, and the third canvas may be SkCanvas. In any drawing process, the content of the current third canvas may be captured by taking a screenshot of the canvas, wherein the canvas screenshot may be the SkSurface:makeImageSnapshot function.

[0078] When drawing to the target control that needs to blur the background, a screenshot is taken, that is, a screenshot is taken of the contents of multiple levels below the level of the target control in the current window, and the image data SkImage: snap_self of the current window can be obtained.

[0079] Figure 3 is a flow chart showing a method for determining a blurred background image according to an exemplary embodiment. Figure 3 As shown, in a possible implementation manner, obtaining a blurred background image according to the original image data and the display position of the target control on the display interface may include the following steps:

[0080] In step S301, a candidate background image is captured in a second canvas according to the original image data and the display position of the target control on the display interface. The second canvas is a newly created canvas capable of accommodating the target control.

[0081] In this embodiment, the candidate background image is the content covered by the target control, and the candidate background image can be captured through the second canvas. Specifically, a new drawing task can be created, that is, a new SkSurface is created, and the second canvas corresponding to the drawing task is determined. The second canvas can be SkCanvas, which is a canvas that can accommodate the target control. Since the target control is a special-shaped control, the second canvas is a canvas whose width and height are greater than or equal to the width and height of the target control. Based on the display position of the target control on the display interface, part of the data in the original image data is drawn to the second canvas and a screenshot is taken to obtain the candidate background image.

[0082] In step S302, the candidate background image is processed to obtain a blurred background image.

[0083] In this embodiment, the candidate image may be further processed, for example, blurred to obtain a blurred background image, or the blurred image may be further mixed to obtain a blurred background image.

[0084] Figure 4 is a flowchart of a method for obtaining a candidate background image according to an exemplary embodiment. Figure 4 As shown, in a possible implementation manner, according to the original image data and the display position of the target control on the display interface, intercepting the candidate background image in the second canvas may include the following steps:

[0085] In step S401, target image data is determined from the original image data according to the display position of the target control on the display interface. The target image data is data corresponding to the position of the target control in the original image data.

[0086] In this embodiment, the original image data can be intercepted based on the display position of the target control on the display interface, and the data corresponding to the position of the target control in the original image data can be intercepted as the target image data. Specifically, the coordinates of each pixel of the target control can be determined based on the display position of the target control on the display interface to obtain the first coordinates, and the coordinates of each pixel in the original image data can be determined to obtain the second coordinates. Since the same coordinate system is used, the target pixel with the same first coordinate can be determined from the second coordinates, and the data corresponding to the target pixel can be determined as the target image data.

[0087] In step S402, an original background image is drawn on a second canvas according to the target image data.

[0088] In this embodiment, the target image data can be drawn onto the second canvas, and an original background image having the same size as the target control can be obtained.

[0089] In step S403, the original background image is captured from the second canvas by taking a screenshot of the canvas to obtain a candidate background image.

[0090] In this embodiment, since the second canvas is a newly created smallest rectangular canvas that can accommodate the target control, a screenshot is taken of the contents of the canvas, and the captured candidate background image is a rectangular image with the same width and height as the target control. The candidate background image can be recorded as SkImage: snap_back.

[0091] In a possible implementation, the method for processing the candidate background image to obtain a blurred background image may be: blurring the candidate background image to obtain an original blurred image; and mixing the original blurred image based on a target color number to obtain a blurred background image, wherein the target color number is a pre-set color number corresponding to the target control.

[0092] In this embodiment, the candidate background image may be blurred to obtain the original blurred image. The blurring method may be at least one of Gaussian blur, kavass blur and custom blur. The original blurred image is mixed to obtain a blurred background image. In the color mixing process, the color of the mixed color used may be determined based on the target color number, and the target color number may be a pre-set color number. For example, one or more color numbers are pre-set first, and a color number is randomly selected during color mixing. Alternatively, the target color number is a color number corresponding to the target control that is pre-set based on the user's instructions. The blurred background image may be recorded as SkImage: snap_blur.

[0093] In a possible implementation manner, the candidate background image may be directly blurred to obtain a blurred background image.

[0094] Figure 5 is a flow chart of a method for obtaining a target background image according to an exemplary embodiment. Figure 5 As shown, in a possible implementation manner, according to the image data corresponding to the target control, determining a target background image having the same size as the target control from the blurred background image may include the following steps:

[0095] In step S501, according to the image data corresponding to the target control, a target control image having the same size as the target control is captured in a first canvas, where the first canvas is a newly created canvas capable of accommodating the target control.

[0096] In this embodiment, the original control image can be drawn in the first canvas according to the image data corresponding to the target control, and the original control image can be captured from the first canvas by canvas screenshot to obtain the target control image of the same size as the target control. The first canvas is a newly created canvas that can accommodate the target control, that is, the width and height of the first canvas are greater than or equal to the width and height of the target control.

[0097] In step S502, a target background image is determined from the blurred background image according to the target control image, and the target background image has the same size as the target control image.

[0098] In this embodiment, the blurred background image may be intercepted based on the obtained target control image to obtain a target background image having the same size as the target control image.

[0099] Figure 6 is a flow chart showing another method for obtaining a target background image according to an exemplary embodiment. Figure 6 In a possible implementation, determining the target background image from the blurred background image according to the target control image may include the following steps:

[0100] In step S601, the target control image and the blurred background image are superimposed to determine an overlapping area.

[0101] In this embodiment, the target control image and the blurred background image can be superimposed by using a superposition method to determine the overlap area between the two. In the superposition process, the overlap area is maximized as the target. Since the blurred background image is an image that can accommodate the target control, that is, the size of the blurred background image is greater than or equal to the size of the target control, the target control image can be completely superimposed on the blurred background image during superposition, that is, the size of the overlap area is equal to the size of the target control image.

[0102] In step S602, the overlapping area in the blurred background image is retained to obtain a target background image.

[0103] In this embodiment, the overlapping area in the blurred background image is retained, so that a target background image having the same size as the target control can be obtained.

[0104] In a possible implementation, the target background image is drawn to the target area where the target control is located to obtain a blurred background of the target control. Before drawing the target control, the target area corresponding to the target control is cut on a third canvas according to the display position of the target control on the display interface; and the target background image is drawn to the target area to obtain a blurred background of the target control.

[0105] In this embodiment, before drawing the target control, the blurred background corresponding to the target control is drawn first. Before drawing the blurred background corresponding to the target control, a target area equal in size and position to the target control is cut from the area corresponding to the target control on the first canvas according to the display position of the target control on the display interface, so as to draw the blurred background of the target control. Then, the target background image is directly drawn to the target area on the third canvas to obtain the blurred background of the target control.

[0106] For example, snap_blur is drawn to SkCanvas before drawing the contents of the target control on SkCanvas. Specifically, first call the clipPath or clipRRect of SkCavas to clip an area that needs to be blurred, and then call drawImageRect to draw the contents of the size of the target control in snap_blur to SkCanvas. At this time, the target control has a blurred background.

[0107] Figure 7 is a schematic diagram of a target control with a mixed background according to an exemplary embodiment. Figure 8 is a schematic diagram of another mixed background target control according to an exemplary embodiment. Figure 7 and Figure 8 As shown, in a possible implementation, the blurred background of the target control can be used to directly replace the target control, or the blurred background of the target control can be used as the background of the target control. The specific decision can be based on the type of the target control, such as Figure 8 As shown, a target control 801 without text content and a blurred background 802, if the target control does not contain text content, the blurred background of the target control is directly used to replace the target control, that is, after drawing the target background image, the target background image is directly used as the target control, and the target control is no longer drawn, and the target control 803 after the mixed background is obtained. Figure 7 As shown, a target control 701 including text content and a blurred background 702, if the target control includes text content, the blurred background of the target control is used as the background of the target control, that is, after drawing the target background image, the target control is continued to be drawn on the target background image. Based on the text content of the target control, the text content of the target control can be added to the target background image to obtain the target control, that is, the target control 703 after the mixed background is obtained.

[0108] Fig. 9 is a block diagram of a control background rendering device according to an exemplary embodiment. Fig. 9The control background rendering device 900 includes an acquisition module 901, a first acquisition module 902, a determination module 903 and a second acquisition module 904.

[0109] The acquisition module 901 is configured to acquire original image data, where the original image data is image data corresponding to multiple levels below the level of the target control;

[0110] The first obtaining module 902 is configured to obtain a blurred background image according to the original image data and the display position of the target control on the display interface, wherein the blurred background image is an image that can accommodate the target control;

[0111] The determination module 903 is configured to determine a target background image having the same size as the target control from the blurred background image according to the image data corresponding to the target control;

[0112] The second obtaining module 904 is configured to draw the target background image to the target area where the target control is located to obtain the blurred background of the target control.

[0113] Optionally, the determining module 903 includes:

[0114] A first interception submodule is configured to intercept, according to the image data corresponding to the target control, a target control image having the same size as the target control in a first canvas, wherein the first canvas is a newly created canvas capable of accommodating the target control;

[0115] The determination submodule is configured to determine a target background image from the blurred background image according to the target control image, wherein the target background image has the same size as the target control image.

[0116] Optionally, the determining submodule includes:

[0117] A first determining unit is configured to superimpose the target control image and the blurred background image to determine an overlapping area;

[0118] The first obtaining unit is configured to retain the overlapping area in the blurred background image to obtain the target background image.

[0119] Optionally, the first obtaining module 902 includes:

[0120] A second interception submodule is configured to intercept a candidate background image in a second canvas according to the original image data and a display position of the target control on the display interface, where the second canvas is a newly created canvas capable of accommodating the target control;

[0121] The obtaining submodule is configured to process the candidate background image to obtain the blurred background image.

[0122] Optionally, the second interception submodule includes:

[0123] A second determining unit is configured to determine target image data from the original image data according to a display position of the target control on the display interface, wherein the target image data is data corresponding to the position of the target control in the original image data;

[0124] A drawing unit, configured to draw an original background image in the second canvas according to the target image data;

[0125] The second obtaining unit is configured to capture the original background image from the second canvas by taking a screenshot of the canvas to obtain the candidate background image.

[0126] Optionally, the obtaining submodule includes:

[0127] A third obtaining unit is configured to perform blur processing on the candidate background image to obtain an original blurred image;

[0128] The fourth obtaining unit is configured to perform color mixing processing on the original blurred image based on a target color number to obtain the blurred background image, wherein the target color number is a preset color number corresponding to the target control.

[0129] Optionally, the original image data includes bottom layer window image data and current layer window image data;

[0130] The acquisition module 901 includes:

[0131] A first acquisition submodule is configured to acquire the bottom layer window image data corresponding to the bottom layer window located under the current layer window where the target control is located;

[0132] The second acquisition submodule is configured to acquire the current layer window image data corresponding to multiple levels below the level of the target control in the current layer window.

[0133] Optionally, the first acquisition submodule includes:

[0134] The fifth obtaining unit is configured to capture the content of the bottom layer window located below the current layer window where the target control is located through cross-process screenshot to obtain the bottom layer window image data.

[0135] Optionally, the second acquisition submodule includes:

[0136] The sixth obtaining unit is configured to capture the contents of multiple levels below the level of the target control in the current window from the third canvas through canvas screenshot to obtain the image data of the current window, and the third canvas is used to draw the image of the current window.

[0137] Regarding the control background rendering device 900 in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0138] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and when the program instructions are executed by a processor, the steps of the control background rendering method provided by the present disclosure are implemented.

[0139] Fig.10 1 is a block diagram of a device for widget background rendering according to an exemplary embodiment. For example, the device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0140] Reference Fig.10 , the device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output interface 1012 , a sensor component 1014 , and a communication component 1016 .

[0141] The processing component 1002 generally controls the overall operation of the device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the control background rendering method described above. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0142] The memory 1004 is configured to store various types of data to support the operation of the device 1000. Examples of such data include instructions for any application or method operating on the device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0143] The power supply component 1006 provides power to the various components of the device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1000.

[0144] The multimedia component 1008 includes a screen that provides an output interface between the device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0145] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the device 1000 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

[0146] The input / output interface 1012 provides an interface between the processing component 1002 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0147] The sensor assembly 1014 includes one or more sensors for providing various aspects of the status assessment of the device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the device 1000, the relative positioning of components, such as the display and keypad of the device 1000, the sensor assembly 1014 can also detect the position change of the device 1000 or a component of the device 1000, the presence or absence of user contact with the device 1000, the orientation or acceleration / deceleration of the device 1000, and the temperature change of the device 1000. The sensor assembly 1014 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1014 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0148] The communication component 1016 is configured to facilitate wired or wireless communication between the device 1000 and other devices. The device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0149] In an exemplary embodiment, the device 1000 can be implemented by 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), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned control background rendering method.

[0150] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the device 1000 to complete the above-mentioned control background rendering method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0151] In addition to being an independent electronic device, the above-mentioned device can also be a part of an independent electronic device. For example, in one embodiment, the device can be an integrated circuit (IC) or a chip, wherein the integrated circuit can be an IC or a collection of multiple ICs; the chip can include but is not limited to the following types: GPU (Graphics Processing Unit), CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), SOC (System on Chip, SoC), etc. The above-mentioned integrated circuit or chip can be used to execute executable instructions (or codes) to implement the above-mentioned control background rendering method. The executable instructions can be stored in the integrated circuit or chip, or can be obtained from other devices or equipment, such as the integrated circuit or chip including a processor, a memory, and an interface for communicating with other devices. The executable instruction can be stored in the memory, and when the executable instruction is executed by the processor, the above-mentioned control background rendering method is implemented; alternatively, the integrated circuit or chip can receive the executable instruction through the interface and transmit it to the processor for execution, so as to implement the above-mentioned control background rendering method.

[0152] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the above-mentioned control background rendering method when executed by the programmable device.

[0153] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0154] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A control background rendering method, characterized in that: include: Acquire original image data, where the original image data is image data corresponding to multiple levels below the level of the target control; Obtaining a blurred background image according to the original image data and the display position of the target control on the display interface, wherein the blurred background image is an image capable of accommodating the target control; According to the image data corresponding to the target control, determining a target background image having the same size as the target control from the blurred background image; The target background image is drawn to the target area where the target control is located to obtain a blurred background of the target control.

2. The control background rendering method according to claim 1, characterized in that: The step of determining a target background image having the same size as the target control from the blurred background image according to the image data corresponding to the target control includes: According to the image data corresponding to the target control, a target control image having the same size as the target control is captured in a first canvas, where the first canvas is a newly created canvas capable of accommodating the target control; According to the target control image, a target background image is determined from the blurred background image, and the target background image has the same size as the target control image.

3. The control background rendering method according to claim 2, characterized in that: The step of determining a target background image from the blurred background image according to the target control image includes: Superimposing the target control image and the blurred background image to determine an overlapping area; The overlapping area in the blurred background image is retained to obtain the target background image.

4. The control background rendering method according to any one of claims 1 to 3, characterized in that: The obtaining of a blurred background image according to the original image data and the display position of the target control on the display interface includes: According to the original image data and the display position of the target control on the display interface, a candidate background image is captured in a second canvas, where the second canvas is a newly created canvas capable of accommodating the target control; The candidate background image is processed to obtain the blurred background image.

5. The control background rendering method according to claim 4, characterized in that: The step of intercepting a candidate background image in a second canvas according to the original image data and the display position of the target control on the display interface includes: Determining target image data from the original image data according to the display position of the target control on the display interface, the target image data being data in the original image data corresponding to the position of the target control; According to the target image data, drawing in the second canvas to obtain an original background image; The original background image is captured from the second canvas by taking a screenshot of the canvas to obtain the candidate background image.

6. The control background rendering method according to claim 4, characterized in that: The step of processing the candidate background image to obtain the blurred background image includes: Performing blur processing on the candidate background image to obtain an original blurred image; Based on a target color number, the original blurred image is subjected to color mixing processing to obtain the blurred background image, wherein the target color number is a preset color number corresponding to the target control.

7. The control background rendering method according to any one of claims 1 to 3, characterized in that: The original image data includes bottom layer window image data and current layer window image data; The obtaining of original image data comprises: Acquire the bottom layer window image data corresponding to the bottom layer window under the current layer window where the target control is located; The image data of the current layer window corresponding to multiple levels below the level of the target control in the current layer window is obtained.

8. The control background rendering method according to claim 7, characterized in that: The step of acquiring the underlying window image data corresponding to the underlying window located below the current window where the target control is located includes: The content of the bottom layer window located below the current layer window where the target control is located is captured through cross-process screenshot to obtain the bottom layer window image data.

9. The control background rendering method according to claim 7, characterized in that: The acquiring the current layer window image data corresponding to a plurality of levels below the level of the target control in the current layer window includes: The content of multiple levels below the level of the target control in the current window is captured from the third canvas through canvas screenshot to obtain the image data of the current window. The third canvas is used to draw the image of the current window.

10. A control background rendering device, characterized in that: include: An acquisition module is configured to acquire original image data, where the original image data is image data corresponding to a plurality of levels below the level of the target control; A first obtaining module is configured to obtain a blurred background image according to the original image data and a display position of the target control on the display interface, wherein the blurred background image is an image capable of accommodating the target control; A determination module, configured to determine a target background image having the same size as the target control from the blurred background image according to the image data corresponding to the target control; The second obtaining module is configured to draw the target background image to the target area where the target control is located to obtain the blurred background of the target control.

11. A control background rendering device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the steps of the control background rendering method described in any one of claims 1 to 9 when executing.

12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the control background rendering method described in any one of claims 1 to 9 are implemented.

13. A chip, characterized in that: It comprises a processor and an interface; the processor is used to read instructions to execute the method for background rendering of a control as described in any one of claims 1 to 9.