Control configuration method, device, computer readable medium and electronic device
By determining the control binding area and configuring the control in the interface, the control configuration flexibility and friendliness are solved, and more efficient control display and user interaction are achieved.
Patent Information
- Application Number
- CN202110971279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-08-20
AI Technical Summary
The prior art is difficult to achieve the flexibility and friendliness of control configuration in the interface, and the control form and arrangement methods are relatively fixed, which cannot meet the flexible needs of users.
By obtaining the number of controls to be configured and the target image, determine the control binding area that matches the number of controls, and configure controls in these areas, use the standard deviation of pixel value and color to distinguish boundaries to determine the control binding area, and enhance the control display features and interactivity.
It improves the flexibility and display friendliness of control configuration in the interface, and enhances the display characteristics and user experience of controls.
Smart Images

Figure CN113610836B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and front-end display technology, and in particular to a control configuration method, device, computer-readable medium and electronic device. Background Art
[0002] In the application scenario of control configuration, for example, in the application scenario of configuring and displaying controls, each control is usually directly arranged and displayed in the interface. However, this approach makes the form and arrangement of controls in the interface relatively fixed, and cannot meet the user's dual needs for control configuration flexibility and control display friendliness. Based on this, how to improve the flexibility of control configuration and control display friendliness in the interface is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a control configuration method, apparatus, computer program product or computer program, computer-readable medium and electronic device, thereby improving the flexibility of control configuration in an interface at least to a certain extent.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a control configuration method is provided, the method comprising: obtaining the number of controls to be configured; obtaining a target image, and determining control binding areas that match the number of controls in the target image; and configuring the controls to be configured in each control binding area of the target image.
[0006] According to one aspect of an embodiment of the present application, a control configuration device is provided, comprising: a first acquisition unit, used to acquire the number of controls to be configured; a second acquisition unit, used to acquire a target image and determine control binding areas that match the number of controls in the target image; and a configuration unit, used to configure the controls to be configured in each control binding area of the target image.
[0007] In some embodiments of the present application, based on the aforementioned scheme, the device further includes: a determination unit, which is used to determine the selected original control as the control to be configured in response to a selection operation on the original control in the interface before obtaining the number of controls to be configured.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit is configured to: acquire a first image to be selected, and determine at least one image parameter of the first image to be selected; and determine the target image from the first image to be selected based on at least one image parameter of the first image to be selected.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the image parameters include image size, and the second acquisition unit is configured to: determine a second image to be selected from the first image to be selected, and the image size of the second image to be selected matches the size of the interface area where the control to be configured is located; determine the target image from the second image to be selected.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the image parameters include image resolution, and the second acquisition unit is configured to: determine an image whose image resolution exceeds a first predetermined threshold from the first candidate images to obtain a third candidate image; and determine the target image from the third candidate image.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit is configured to: acquire pixel values of each pixel unit in the target image; and determine a control binding area in the target image that matches the number of controls based on the pixel values of each pixel unit in the target image.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit is configured to: determine the candidate areas that match the number of controls in the target image, and calculate the standard deviation of the pixel values of the pixel units in each candidate area; when there is at least one candidate area whose corresponding pixel value standard deviation exceeds the second predetermined threshold, update the area boundaries of each candidate area until the pixel value standard deviation corresponding to each candidate area is lower than the second predetermined threshold; determine the candidate area whose pixel value standard deviation is lower than the second predetermined threshold as the control binding area.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit is configured to: determine a pixel demarcation point in the target image, wherein the pixel value difference between adjacent pixel units of the pixel demarcation point exceeds a third predetermined threshold; determine a color distinction boundary in the target image based on the position of each pixel demarcation point in the target image; and determine a control binding area in the target image that is limited by the color distinction boundary and matches the number of controls.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit is configured to: in response to a outlining operation in the target image, acquire an outlining trajectory in the target image; and determine in the target image a control binding area limited by the outlining trajectory and matching the number of controls.
[0015] In some embodiments of the present application, based on the aforementioned scheme, the configuration unit is configured to: obtain control events corresponding to each of the controls to be configured, the control events being used to implement control functions; establish a binding relationship between the control events and the control binding areas; and based on the binding relationship, configure the controls to be configured in each of the control binding areas of the target image.
[0016] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a trigger unit, which is used to, after configuring the to-be-configured controls in each control binding area of the target image based on the binding relationship, trigger a control event bound to any one of the control binding areas in the target image when a click operation is detected on the any one of the control binding areas in the target image; and an execution unit, which is used to execute program instructions corresponding to the control event based on the control event.
[0017] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a rendering unit, which is used to render the background color of the target image based on the background color of the interface area where the control to be configured is located after configuring the control to be configured in each control binding area of the target image, and configure the target image in the interface area where the control to be configured is located.
[0018] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the control configuration method described in the above embodiment.
[0019] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the control configuration method as described in the above embodiment is implemented.
[0020] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the control configuration method as described in the above embodiments.
[0021] In the technical solutions provided in some embodiments of the present application, based on the number of controls to be configured, a control binding area matching the number of controls is determined in the target image, and the controls to be configured are configured in each control binding area of the target image. On the one hand, the controls to be configured can be configured in the target image according to actual needs, which improves the flexibility of control configuration in the interface. On the other hand, configuring controls in the image can enhance the friendliness of control display.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0024] Figure 1 A schematic diagram showing an exemplary hardware environment to which the technical solution of the embodiments of the present application can be applied;
[0025] Figure 2 A flowchart of a control configuration method according to an embodiment of the present application is shown;
[0026] Figure 3 A detailed flow chart of acquiring a target image according to an embodiment of the present application is shown;
[0027] Figure 4 A detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0028] Figure 5 A detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0029] Figure 6 An interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0030] Figure 7 A detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0031] Figure 8An interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0032] Fig. 9 A detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0033] Fig.10 An interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application is shown;
[0034] Fig.11 A detailed flowchart of configuring the to-be-configured controls in each control binding area of the target image according to an embodiment of the present application is shown;
[0035] Fig.12 An interface demonstration diagram showing configuration of the target image in the interface area where the control to be configured is located according to an embodiment of the present application is shown;
[0036] Fig.13 A block diagram of a control configuration device according to an embodiment of the present application is shown;
[0037] Fig.14 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0039] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0041] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0042] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those shown or described.
[0044] Figure 1 A schematic diagram of an exemplary hardware environment to which the technical solution of the embodiments of the present application can be applied is shown.
[0045] like Figure 1 As shown, the implementation environment of the technical solution of the embodiment of the present application may include a terminal device. For example, including Figure 1 Any one of the smart phone 101, tablet computer 102, touch display 103 and portable computer 104 shown in the figure may of course be other electronic devices with touch or non-touch display functions, etc.
[0046] In one embodiment of the present application, the user can use a smart phone with a touch or non-touch display function to implement the technical solution of the embodiment of the present application, for example Figure 1 The smartphone 101 shown in FIG. Specifically, the screen of the smartphone can display an interface, and controls can be configured in the interface displayed on the screen.
[0047] In this embodiment, if Figure 1Any terminal device shown can obtain the number of controls to be configured and a target image, determine control binding areas that match the number of controls in the target image, and then configure the controls to be configured in each control binding area of the target image.
[0048] In this embodiment, by configuring the controls to be configured in each control binding area of the target image, the flexibility of control configuration in the interface can be improved, and the friendliness of control display can be enhanced.
[0049] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0050] Figure 2 A flowchart of a control configuration method according to an embodiment of the present application is shown. The control configuration method can be executed by a device having a computing processing function, such as Figure 1 Refer to the terminal device shown in Figure 2 As shown, the control configuration method at least includes steps 220 to 260, which are described in detail as follows:
[0051] In step 220, the number of controls to be configured is obtained.
[0052] In this application, a control refers to a visual graphic "element" that can be placed on an interface, such as a button, a file edit box, etc. A control has the function of executing a function or triggering code to run and complete a response through an "event".
[0053] In an embodiment before step 220, that is, before obtaining the number of controls to be configured, the controls to be configured may be determined in the following manner: that is, in response to a selection operation on an original control in the interface, the selected original control is determined as the control to be configured.
[0054] In a specific scenario, the user may select at least one original control (ie, a control existing in the interface) in the interface through a touch operation in the interface, and determine the selected original control as the control to be configured.
[0055] In this scenario, the touch operation can be any one of sliding the original control in the interface, long pressing the original control in the interface, and continuously clicking the original control in the interface.
[0056] In this embodiment, after the original control is determined as the control to be configured in the interface, the controls to be configured may be directly counted to obtain the number of controls to be configured.
[0057] In this embodiment, the user selects at least one original control in the interface as a control to be configured through touch operations in the interface. The advantage is that the interactivity between the user and the interface during the control configuration process can be enhanced, thereby improving the user experience.
[0058] Continue to refer to Figure 2 In step 240, a target image is acquired, and a control binding area matching the number of controls is determined in the target image.
[0059] In one embodiment of step 240, acquiring the target image may be acquiring a target image prepared in advance, or acquiring a target image selected by a user.
[0060] In another embodiment of step 240, the target image is acquired, and the target image may be acquired from a plurality of images to be selected.
[0061] In this embodiment, a target image can be obtained from a plurality of candidate images as follows: Figure 3 Follow the steps shown.
[0062] See also Figure 3 , shows a detailed flow chart of acquiring a target image according to an embodiment of the present application. Specifically, it includes steps 241 to 242:
[0063] In step 241, a first image to be selected is acquired, and at least one image parameter of the first image to be selected is determined.
[0064] In step 242, the target image is determined from the first candidate images based on at least one image parameter of the first candidate images.
[0065] In this embodiment, the image parameters include image size, or image resolution, or both image size and image resolution.
[0066] When the image parameters include image size, determining the target image from the first candidate images based on at least one image parameter of the first candidate images may be achieved by executing the following steps:
[0067] Step 1: Determine a second image to be selected from the first images to be selected, wherein the image size of the second image to be selected matches the size of the interface area where the control to be configured is located.
[0068] Step 2: determine the target image from the second candidate images.
[0069] In this embodiment, the target image is determined from the second candidate images, and an image may be randomly selected from the second candidate images as the target image, or a user may select an image from the second candidate images as the target image.
[0070] In this embodiment, the second candidate image is selected from the first candidate image by taking the image size as a parameter. The advantage of this is that in the subsequent control configuration process, the image can be more smoothly embedded into the interface area where the control to be configured is located, thereby improving the control configuration efficiency.
[0071] When the image parameters include image resolution, determining the target image from the first candidate images based on at least one image parameter of the first candidate images may be achieved by executing the following steps:
[0072] Step 1: Determine an image whose image resolution exceeds a first predetermined threshold from the first candidate images to obtain a third candidate image.
[0073] Step 2: determine the target image from the third candidate images.
[0074] In this embodiment, the target image is determined from the third candidate images by selecting the third candidate image with the highest image resolution as the target image, or by randomly selecting an image from the third candidate images as the target image, or by the user selecting an image from the third candidate images as the target image.
[0075] In this embodiment, the third candidate image is screened out from the first candidate image using image resolution as a parameter. This has the advantage that, in the subsequent control configuration process, it can prevent the target image from being severely distorted when displayed in the interface, thereby making the display effect of the target image in the interface clearer and improving the control configuration quality.
[0076] When the image parameters include both image size and image resolution, determining the target image from the first candidate images based on at least one image parameter of the first candidate images may be achieved by executing the following steps:
[0077] Step 1: determining a second image to be selected from the first images to be selected, wherein the image size of the second image to be selected matches the size of the interface area where the control to be configured is located;
[0078] Step 2, determining an image whose image resolution exceeds a first predetermined threshold from the second candidate images, to obtain a third candidate image;
[0079] Step three: determine the target image from the third candidate images.
[0080] In this embodiment, the third candidate image is screened out from the first candidate images using both image size and image resolution as parameters. This has the advantage that in the subsequent control configuration process, both the control configuration efficiency and the control configuration quality can be improved.
[0081] In the present application, control binding areas that match the number of controls are determined in the target image, that is, control binding areas having the same number as the number of controls are determined in the target image. For example, if the number of controls is 4, 4 control binding areas need to be determined in the target image.
[0082] In one embodiment of step 240, the control binding area matching the number of controls is determined in the target image, and the following method can be used: Figure 4 Follow the steps shown.
[0083] See also Figure 4 , shows a detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application. Specifically, it includes steps 243 to 244:
[0084] In step 243, the pixel value of each pixel unit in the target image is obtained.
[0085] In step 244, based on the pixel value of each pixel unit in the target image, a control binding area matching the number of controls is determined in the target image.
[0086] In the present application, the pixel value of each pixel unit in the target image determines the color distribution of the target image. Therefore, by determining the control binding area in the target image based on the pixel value, the control binding area reflected by the color area can be determined, so that in the subsequent control configuration process, the display characteristics and effects of the control are enhanced.
[0087] Furthermore, in Figure 4 In one embodiment of step 244, based on the pixel value of each pixel unit in the target image, the control binding area matching the number of controls is determined in the target image, which can be performed as follows: Figure 5 Follow the steps shown.
[0088] See also Figure 5 , shows a detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application. Specifically, it includes steps 2441 to 2443:
[0089] In step 2441, the candidate regions that match the number of the controls are determined in the target image, and the standard deviation of the pixel values of the pixel units in each candidate region is calculated.
[0090] In step 2442, when there is at least one candidate area whose corresponding pixel value standard deviation exceeds the second predetermined threshold, the region boundaries of each candidate area are updated until the pixel value standard deviation corresponding to each candidate area is lower than the second predetermined threshold.
[0091] In step 2443, the selected area whose pixel value standard deviation is lower than the second predetermined threshold is determined as the control binding area.
[0092] In such Figure 5 In one embodiment of step 2442 shown, updating the area boundaries of each selected area can be performed on the basis of the boundaries of the original selected area. For example, the boundaries of the original selected area can be reduced or expanded, or the boundaries of the original selected area can be moved, or new boundaries can be added to the original selected area to isolate the abrupt color areas in the original selected area.
[0093] In the present application, the standard deviation of pixel values can reflect the color complexity in the image region. The larger the standard deviation of pixel values, the higher the color complexity in the image region.
[0094] In the present application, in the candidate area where the standard deviation of pixel values is lower than the second predetermined threshold, the color complexity is small and has a strong identification. Therefore, the candidate area where the standard deviation of pixel values is lower than the second predetermined threshold is determined as the control binding area, so that in the subsequent control configuration process, the display characteristics and display effects of the control can be enhanced. At the same time, the control binding area can be automatically determined in the target image based on the standard deviation of pixel values, which can improve the efficiency of determining the control binding area, thereby improving the efficiency of control configuration.
[0095] In order to make those skilled in the art better understand this embodiment, Figure 6 This embodiment is described.
[0096] See also Figure 6 , shows an interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application.
[0097] like Figure 6As shown, the character image 601 (i.e., the target image) includes a to-be-selected area 602 and a to-be-selected area 604, wherein the pixel block 603 corresponds to the to-be-selected area 602, and the pixel block 605 corresponds to the to-be-selected area 604. As can be seen from the figure, the difference in pixel values between the various pixel units in the pixel block 603 is small, so the standard deviation of the pixel values corresponding to the to-be-selected area 602 is also small, making it more likely to be determined as a control binding area, while in the character image 601, the to-be-selected area 602 also has a strong identification and is suitable for binding controls. Further, the difference in pixel values between the various pixel units in the pixel block 605 is large, so the standard deviation of the pixel values corresponding to the to-be-selected area 604 is also large, making it less likely to be determined as a control binding area, while in the character image 601, the to-be-selected area 604 has a low identification and is not suitable for binding controls.
[0098] In such Figure 4 In another embodiment of step 244, based on the pixel value of each pixel unit in the target image, the control binding area matching the number of controls is determined in the target image, and the following method can also be used: Figure 7 Follow the steps shown.
[0099] See also Figure 7 , shows a detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application. Specifically, it includes steps 2444 to 2446:
[0100] In step 2444, a pixel demarcation point is determined in the target image, and the pixel value difference between adjacent pixel units of the pixel demarcation point exceeds a third predetermined threshold.
[0101] In step 2445, based on the positions of the respective pixel demarcation points in the target image, a color distinction boundary is determined in the target image.
[0102] In step 2446, a control binding area that is limited by the color distinction boundary and matches the number of controls is determined in the target image.
[0103] In the present application, when the difference in pixel values between adjacent pixel units at a pixel demarcation point in a target image is large, it means that the color jump span of the target image at the image position where the pixel demarcation point is located is large.
[0104] Furthermore, in the present application, the color distinction boundary is determined by each pixel dividing point, and the color complexity of the control binding area limited by the color distinction boundary is small and has strong identification. Therefore, the area limited by the color distinction boundary is determined as the control binding area, which can enhance the display characteristics and display effects of the control. At the same time, the color distinction boundary is determined by each pixel dividing point, and the control binding area is determined by the color distinction boundary, which can also improve the efficiency of determining the control binding area, thereby improving the control configuration efficiency.
[0105] In order to make those skilled in the art better understand this embodiment, Figure 6 This embodiment is described.
[0106] See also Figure 8 , shows an interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application.
[0107] like Figure 8 As shown, the character image 801 (i.e., the target image) includes multiple pixel demarcation points. Taking pixel demarcation point 802 as an example, it corresponds to pixel block 803. In pixel block 803, the pixel value difference between adjacent pixel units 5 and 4 is large, the pixel value difference between adjacent pixel units 5 and 7 is large, the pixel value difference between adjacent pixel units 5 and 8 is large, the pixel value difference between adjacent pixel units 5 and 9 is large, and the pixel value difference between adjacent pixel units 5 and 6 is large.
[0108] Continue as Figure 8 As shown, a color distinction boundary 804 can be determined in the target image 801 through multiple pixel demarcation points, and the control binding area (hair of the character image) limited by the color distinction boundary 804 has strong identification and is suitable for binding controls.
[0109] In another embodiment of step 240, the control binding area matching the number of controls is determined in the target image, and the following method can be used: Fig. 9 Follow the steps shown.
[0110] See also Fig. 9 , shows a detailed flow chart of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application. Specifically, it includes steps 245 to 246:
[0111] In step 245 , in response to the outlining operation in the target image, an outlining trajectory in the target image is acquired.
[0112] In step 246, a control binding area limited by the outline trajectory and matching the number of controls is determined in the target image.
[0113] In this embodiment, the user may perform a sketching operation in the target image and determine a corresponding sketching trajectory, and the sketching trajectory may be used to determine a control binding area that matches the number of controls. The advantage of this is that the interactivity between the user and the interface during the control configuration process may be enhanced, thereby improving the user experience.
[0114] In order to make those skilled in the art better understand this embodiment, Fig.10 This embodiment is described.
[0115] See also Fig.10 , shows an interface demonstration diagram of determining a control binding area matching the number of controls in the target image according to an embodiment of the present application.
[0116] like Fig.10 As shown, the face area of the character image 1001 (ie, the target image) is outlined to obtain an outline track 1002. Therefore, the area limited by the outline track 1002 (ie, the face area) can be determined as the control binding area.
[0117] In other embodiments of step 240, a control binding area that matches the number of controls is determined in the target image. It is also possible to identify various characteristic parts of the image in the target image through a pre-trained machine learning model, and determine the control binding area that matches the number of controls based on the area where the characteristic parts are located.
[0118] Specifically, for example, when the target image is a person image, the pre-trained machine learning model can be used to identify the characteristic parts of the task such as eyes, nose, mouth, hands, etc. in the person image, and the area where these characteristic parts are located is determined as the control binding area.
[0119] In the above embodiments, in the process of determining the control binding area that matches the number of controls, the control binding area that is larger than the number of controls may be determined first, and then the control binding area that matches the number of controls may be determined from the control binding areas that are larger than the number of controls according to the area of the control binding area. For example, if the number of controls is 4, 6 control binding areas may be determined first, and then the 4 control binding areas with the largest areas may be determined from the 6 control binding areas according to the order of the areas of the control binding areas from largest to smallest.
[0120] In the above-mentioned embodiments, in the process of determining the control binding area that matches the number of controls, it is also possible to first determine the control binding area that is greater than the number of controls, and then the user selects the control binding area that matches the number of controls from the control binding area that is greater than the number of controls.
[0121] Continue to refer to Figure 2 In step 260, the controls to be configured are configured in each control binding area of the target image.
[0122] In one embodiment of step 260, the to-be-configured controls are configured in each control binding area of the target image, and the configuration may be performed as follows: Fig.11 Follow the steps shown.
[0123] See also Fig.11 , shows a detailed flow chart of configuring the to-be-configured controls in each control binding area of the target image according to an embodiment of the present application. Specifically, it includes steps 261 to 263:
[0124] In step 261, a control event corresponding to each of the controls to be configured is obtained, and the control event is used to implement the control function.
[0125] In step 262, a binding relationship between the control event and the control binding area is established.
[0126] In step 263, based on the binding relationship, the to-be-configured controls are configured in each control binding area of the target image.
[0127] In step 262 of this embodiment, each control to be configured selected in the interface may be dragged to each control binding area of the target image in a one-to-one correspondence, thereby establishing a binding relationship between a control event corresponding to the control to be configured and the control binding area.
[0128] In step 262 of this embodiment, a binding relationship between the control events corresponding to the selected controls to be configured and the control binding area may also be randomly established.
[0129] In such Fig.11 In one embodiment of step 263, after configuring the to-be-configured controls in each control binding area of the target image based on the binding relationship, the following steps may also be performed:
[0130] Step 1: When a click operation on any one of the control binding areas in the target image is detected, a control event bound to the any one of the control binding areas is triggered.
[0131] Step 2: Based on the control event, execute the program instruction corresponding to the control event.
[0132] In this implementation, for example, a control binding area in the target image is bound to a control event for jumping to interface A. When the control binding area in the target image is clicked, the control event for jumping to interface A is triggered, and the program instructions corresponding to the control event for jumping to interface A are executed, ultimately achieving the interface jump to interface A.
[0133] In the present application, after configuring the to-be-configured controls in each control binding area of the target image, the following steps may also be performed:
[0134] Based on the background color of the interface area where the control to be configured is located, the background color of the target image is rendered, and the target image is configured in the interface area where the control to be configured is located.
[0135] In order to enable those skilled in the art to better understand how to configure the target image in the interface area where the control to be configured is located, the following will be combined with Fig.12 Provide explanation.
[0136] See also Fig.12 , showing an interface demonstration diagram of configuring the target image in the interface area where the control to be configured is located according to an embodiment of the present application.
[0137] like Fig.12 As shown, in the interface 1210, there are controls 1201 to be configured, namely control 1, control 2, control 3, and control 4. If the background color of the interface area where the control 1201 is located is transparent, the background color of the rendering target image 1202 is transparent. If the background color of the interface area where the control 1201 is located is blue, the background color of the rendering target image 1202 is blue.
[0138] After configuring the control 1201 to be configured in each control binding area of the target image 1202, the target image 1202 is configured in the interface area where the control 1201 to be configured is located. Fig.12 In the interface 1220 shown, the target image 1202 includes four control binding areas 1203, each of which is bound to a control. For example, the four control binding areas 1203 of the target image 1202 (i.e., the area where the character's hair is located, the area where the character's face is located, the area where the character's hand-held book is located, and the area where the character's shoes are located) are bound to control 1, control 2, control 3, and control 4, respectively.
[0139] In the technical solutions provided in some embodiments of the present application, based on the number of controls to be configured, a control binding area matching the number of controls is determined in the target image, and the controls to be configured are configured in each control binding area of the target image. On the one hand, the controls to be configured can be configured in the target image according to actual needs, which improves the flexibility of control configuration in the interface. On the other hand, configuring controls in the image can enhance the friendliness of control display.
[0140] The following describes an apparatus embodiment of the present application, which can be used to execute the control configuration method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the control configuration method of the present application.
[0141] Fig.13 A block diagram of a control configuration device according to an embodiment of the present application is shown.
[0142] Reference Fig.13 As shown, a control configuration device 1300 according to an embodiment of the present application includes: a first acquisition unit 1301 , a second acquisition unit 1302 and a configuration unit 1303 .
[0143] Among them, the first acquisition unit 1301 is used to obtain the number of controls to be configured; the second acquisition unit 1302 is used to obtain a target image and determine control binding areas that match the number of controls in the target image; the configuration unit 1303 is used to configure the controls to be configured in each control binding area of the target image.
[0144] In some embodiments of the present application, based on the aforementioned scheme, the device further includes: a determination unit, which is used to determine the selected original control as the control to be configured in response to a selection operation on the original control in the interface before obtaining the number of controls to be configured.
[0145] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit 1302 is configured to: acquire a first image to be selected, and determine at least one image parameter of the first image to be selected; and determine the target image from the first image to be selected based on at least one image parameter of the first image to be selected.
[0146] In some embodiments of the present application, based on the aforementioned scheme, the image parameters include image size, and the second acquisition unit 1302 is configured to: determine a second image to be selected from the first image to be selected, and the image size of the second image to be selected matches the size of the interface area where the control to be configured is located; determine the target image from the second image to be selected.
[0147] In some embodiments of the present application, based on the aforementioned scheme, the image parameters include image resolution, and the second acquisition unit 1302 is configured to: determine an image whose image resolution exceeds a first predetermined threshold from the first candidate images to obtain a third candidate image; and determine the target image from the third candidate image.
[0148] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit 1302 is configured to: acquire the pixel value of each pixel unit in the target image; and determine the control binding area that matches the number of controls in the target image based on the pixel value of each pixel unit in the target image.
[0149] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit 1302 is configured to: determine the candidate areas that match the number of controls in the target image, and calculate the standard deviation of the pixel values of the pixel units in each candidate area; when there is at least one candidate area whose corresponding pixel value standard deviation exceeds the second predetermined threshold, update the area boundaries of each candidate area until the pixel value standard deviation corresponding to each candidate area is lower than the second predetermined threshold; determine the candidate area whose pixel value standard deviation is lower than the second predetermined threshold as the control binding area.
[0150] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit 1302 is configured to: determine a pixel demarcation point in the target image, where the pixel value difference between adjacent pixel units of the pixel demarcation point exceeds a third predetermined threshold; determine a color distinction boundary in the target image based on the position of each pixel demarcation point in the target image; and determine a control binding area in the target image that is limited by the color distinction boundary and matches the number of controls.
[0151] In some embodiments of the present application, based on the aforementioned scheme, the second acquisition unit 1302 is configured to: in response to a outlining operation in the target image, acquire an outlining trajectory in the target image; and determine in the target image a control binding area limited by the outlining trajectory and matching the number of controls.
[0152] In some embodiments of the present application, based on the aforementioned scheme, the configuration unit 1303 is configured to: obtain control events corresponding to each of the controls to be configured, the control events being used to implement control functions; establish a binding relationship between the control events and the control binding areas; and based on the binding relationship, configure the controls to be configured in each of the control binding areas of the target image.
[0153] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a trigger unit, which is used to, after configuring the to-be-configured controls in each control binding area of the target image based on the binding relationship, trigger a control event bound to any one of the control binding areas in the target image when a click operation is detected on the any one of the control binding areas in the target image; and an execution unit, which is used to execute program instructions corresponding to the control event based on the control event.
[0154] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a rendering unit, which is used to render the background color of the target image based on the background color of the interface area where the control to be configured is located after configuring the control to be configured in each control binding area of the target image, and configure the target image in the interface area where the control to be configured is located.
[0155] Fig.14 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0156] It should be noted that Fig.14 The computer system 1400 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0157] like Fig.14 As shown, the computer system 1400 includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1402 or the program loaded from the storage part 1408 to the random access memory (RAM) 1403, such as executing the method described in the above embodiment. In the RAM 1403, various programs and data required for system operation are also stored. The CPU 1401, the ROM 1402 and the RAM 1403 are connected to each other through the bus 1404. The input / output (I / O) interface 1405 is also connected to the bus 1404.
[0158] The following components are connected to the I / O interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed so that a computer program read therefrom is installed into the storage section 1408 as needed.
[0159] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1409, and / or installed from a removable medium 1411. When the computer program is executed by a central processing unit (CPU) 1401, various functions defined in the system of the present application are executed.
[0160] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0161] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0162] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0163] As another aspect, the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the control configuration method described in the above embodiment.
[0164] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the control configuration method described in the above embodiment.
[0165] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0166] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0167] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0168] It should be understood that the present application is not limited to the precise 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 application is limited only by the appended claims.
Claims
1. A control configuration method, characterized in that: The method comprises: Get the number of controls to be configured; Acquire a target image, and determine a control binding area matching the number of controls in the target image; Acquire control events corresponding to each of the controls to be configured, wherein the control events are used to implement control functions; Establishing a binding relationship between the control event and the control binding area; Based on the binding relationship, the to-be-configured controls are configured in each control binding area of the target image.
2. The method according to claim 1, characterized in that Before obtaining the number of controls to be configured, the method further includes: In response to a selection operation on an original control in the interface, the selected original control is determined as the control to be configured.
3. The method according to claim 2, characterized in that The acquiring of the target image comprises: Acquire a first image to be selected, and determine at least one image parameter of the first image to be selected; The target image is determined from the first candidate images based on at least one image parameter of the first candidate images.
4. The method according to claim 3, characterized in that The image parameter includes an image size, and determining the target image from the first candidate image based on at least one image parameter of the first candidate image includes: Determine a second image to be selected from the first image to be selected, wherein the image size of the second image to be selected matches the size of the interface area where the control to be configured is located; The target image is determined from the second candidate images.
5. The method according to claim 3, characterized in that: The image parameter includes an image resolution, and determining the target image from the first candidate image based on at least one image parameter of the first candidate image includes: Determine an image whose image resolution exceeds a first predetermined threshold from the first images to be selected, to obtain a third image to be selected; The target image is determined from the third candidate images.
6. The method according to claim 1, characterized in that The step of determining the control binding area matching the number of controls in the target image includes: Obtaining pixel values of each pixel unit in the target image; Based on the pixel value of each pixel unit in the target image, a control binding area matching the number of controls is determined in the target image.
7. The method according to claim 6, characterized in that The determining, based on the pixel value of each pixel unit in the target image, a control binding area matching the number of controls in the target image comprises: Determine in the target image the areas to be selected that match the number of the controls, and calculate the standard deviation of the pixel values of the pixel units in each area to be selected; When there is at least one to-be-selected area whose corresponding pixel value standard deviation exceeds a second predetermined threshold, updating the area boundaries of each to-be-selected area until the pixel value standard deviation corresponding to each to-be-selected area is lower than the second predetermined threshold; The selected area whose pixel value standard deviation is lower than the second predetermined threshold is determined as the control binding area.
8. The method according to claim 6, characterized in that The determining, based on the pixel value of each pixel unit in the target image, a control binding area matching the number of controls in the target image comprises: Determining a pixel demarcation point in the target image, where a pixel value difference between adjacent pixel units at the pixel demarcation point exceeds a third predetermined threshold; Determining a color distinction boundary in the target image based on a position of each pixel demarcation point in the target image; A control binding area limited by the color distinction boundary and matching the number of controls is determined in the target image.
9. The method according to claim 1, characterized in that: The step of determining the control binding area matching the number of controls in the target image includes: In response to a delineation operation in the target image, acquiring a delineation trajectory in the target image; A control binding area limited by the outline track and matching the number of controls is determined in the target image.
10. The method according to claim 1, characterized in that After configuring the to-be-configured controls in each control binding area of the target image based on the binding relationship, the method further includes: When a click operation on any one of the control binding areas in the target image is detected, a control event bound to the any one of the control binding areas is triggered; Based on the control event, a program instruction corresponding to the control event is executed.
11. The method according to claim 2, characterized in that After configuring the to-be-configured controls in each control binding area of the target image, the method further includes: Based on the background color of the interface area where the control to be configured is located, the background color of the target image is rendered, and the target image is configured in the interface area where the control to be configured is located.
12. A control configuration device, characterized in that: The device comprises: A first acquisition unit is used to acquire the number of controls to be configured; A second acquisition unit is used to acquire a target image and determine a control binding area matching the number of controls in the target image; The configuration unit is used to obtain control events corresponding to each control to be configured, wherein the control events are used to implement control functions; establish a binding relationship between the control events and the control binding areas; and configure the control to be configured in each control binding area of the target image based on the binding relationship.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed by the control configuration method according to any one of claims 1 to 11.
14. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the control configuration method as described in any one of claims 1 to 11.
