Color value capturing and spreading method, storage medium and electronic device
By capturing and automatically filling color values in the image editor, the cumbersome problems of color value acquisition and filling in the existing technology are solved, operational efficiency and accuracy are improved, and more efficient color management is achieved.
Patent Information
- Application Number
- CN202410661206.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, obtaining the image color values and filling them into the area in the picture editor requires manual input. The steps are cumbersome, time-consuming and labor-intensive, and prone to errors, which reduces work efficiency and accuracy.
By responding to the user's operation, it accurately captures the color value at the cursor, monitors the user's filling operation, automatically applies the color value to the target area, uses the color value insertion manual and API interface plug-in to accurately fill the color value, and stores it in shared memory. and delete when appropriate.
It reduces the tedious steps of manual input, improves operational efficiency and accuracy, ensures the accuracy of color value synchronization, avoids errors in manual operations, and achieves a more efficient workflow and more consistent color management.
Smart Images

Figure CN118537448A
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and more specifically, to a method for capturing and transmitting color values, a storage medium, and an electronic device. Background Art
[0002] In the prior art, if you want to use a certain color on an image and fill it into a certain area in a picture editor, you need to first open the image using the picture editor, then use the picture editor to extract the color value of the required color on the image, and then input the color value into the picture editor corresponding to the area to be filled.
[0003] Although this method can achieve the synchronization of color values, the steps are cumbersome, time-consuming and labor-intensive, and it is easy to make mistakes in filling in or obtaining color values. This not only wastes the user's time, but also reduces work efficiency and accuracy.
[0004] Accordingly, the art needs a new color value acquisition solution to solve the above problem. Summary of the invention
[0005] In order to overcome the above-mentioned defects, the present invention is proposed to solve or at least partially solve the technical problem in the prior art that obtaining the color value of an image requires manual input.
[0006] In a first aspect, the present invention provides a method for capturing and propagating color values, the method comprising: in response to a first operation of a user satisfying a preset acquisition operation, acquiring the color value at a cursor in an image; monitoring a second operation of the user until the second operation satisfies a preset fill operation, filling a first area based on at least the color value, wherein the first area is a fillable area selected by the user in a first image editor, wherein the first operation and the second operation both include at least the user's operation on the cursor.
[0007] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, during the monitoring of the user's second operation until the second operation satisfies a preset filling operation, at least before filling the first area based on the color value, the method further includes: scanning the system background running programs and identifying the running first image editor based on the process name or window title; in response to the first image editor not being in the preset permission list, obtaining the color value insertion manual of the first image editor; filling the first area at least based on the color value includes: filling the color value into the first area based on the color value insertion manual, wherein the second operation at least includes the user moving the cursor into the first area, and the color value insertion manual is used to fill the color value into the first area in the first image editor according to a preset operation step script therein.
[0008] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, after acquiring the color value at the cursor in the image and before monitoring the user's second operation, the method also includes: storing the color value in a preset format in a shared memory of the system; after filling the first area at least based on the color value, the method also includes: in response to the color value being successfully filled into the first area, deleting the color value from the shared memory.
[0009] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, the preset acquisition operation includes: placing the cursor on the image and being in a long press confirmation state and a static state at the same time, and the method also includes: in response to the user's first operation satisfying the preset acquisition operation, triggering a progress bar, wherein the progress bar is located near the cursor on the screen; when the progress of the progress bar is completed, the color value is stored.
[0010] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, in response to the user's first operation satisfying a preset acquisition operation, acquiring the color value of the cursor in the image also includes: in response to the user's first operation satisfying the preset acquisition operation, querying whether the content at the current position of the cursor is an image; in response to the content at the current position of the cursor being an image, executing "acquiring the color value at the cursor in the image".
[0011] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, after filling the color value into the first area based on the color value insertion manual, the method also includes: obtaining an API interface plug-in corresponding to the first image editor from a resource server; in response to obtaining the API interface plug-in, installing and configuring the plug-in, and adding the first image editor to the permission list.
[0012] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, the method also includes: in response to the first image editor being in a preset permission list, obtaining an API interface plug-in corresponding to the first image editor based on the permission list; filling the first area at least based on the color value includes: filling the color value into the first area based on the API interface plug-in, wherein the second operation at least includes the user moving the cursor into the first area.
[0013] As an alternative or supplement to the above solution, in a method according to an embodiment of the present invention, the preset acquisition operation includes at least one of the following methods 1 or 2: Method 1: putting the cursor in a long press confirmation state; Method 2: triggering by a preset key position or a combination of key positions. Or, the preset filling operation includes: driving the cursor to move from the image to the first area by dragging.
[0014] In a second aspect, a control device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple computer programs, and the computer programs are suitable for being loaded and run by the processor to execute the color value capture and propagation method described in any one of the technical solutions of the above-mentioned color value capture and propagation method.
[0015] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of computer programs are stored in the computer-readable storage medium, wherein the computer programs are suitable for being loaded and run by a processor to execute the color value capture and propagation method described in any one of the technical solutions of the above-mentioned color value capture and propagation method.
[0016] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0017] In the technical solution of the present invention, the color value at the cursor is accurately captured by responding to the user's acquisition operation; then the color value is automatically applied to the target area by monitoring the user's fill operation. This method effectively reduces the tedious steps of manual input and improves operational efficiency and accuracy. At the same time, the system's automated processing ensures the accuracy of color value synchronization, avoids errors in manual operation, and achieves a more efficient workflow and more consistent color management. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 is a schematic diagram of a hardware environment of an interaction method of a smart device according to an embodiment of the present application;
[0021] Figure 2 is a schematic flow chart of main steps of a method for capturing and propagating color values according to an embodiment of the present invention;
[0022] Figure 3 1 is a flowchart of the main steps of a method for capturing and propagating color values according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] The application scenarios of this method mainly include but are not limited to image processing, design, photography post-processing and other fields that require precise color management. For example, when a designer uses Adobe Photoshop or GIMP to edit an image, he or she may need to extract color values from a specific area in the image in order to use the same color or color matching in the above image editors.
[0026] After using this method, the designer can select the color value in the image through a preset acquisition operation (such as long pressing the left mouse button), and use the system's automatic recording and storage functions to apply the color value to the required location.
[0027] Embodiment 1:
[0028] See attached Figure 2 , Figure 2 FIG. 1 is a flow chart showing the main steps of a method for capturing and propagating color values according to an embodiment of the present invention. Figure 2 As shown, the color value capture and propagation method in the embodiment of the present invention mainly includes the following steps A to B.
[0029] Step A: In response to the user's first operation satisfying a preset acquisition operation, a color value at a cursor in an image is acquired.
[0030] In this embodiment, the first operation of the user is an operation performed through an input device, wherein the first operation at least includes an operation of the user on a cursor.
[0031] In one embodiment, the preset acquisition operation is a preset operation for checking whether the user has the intention to extract the color value. When the user's first operation satisfies the preset acquisition operation, it is determined that the user has the intention to obtain the color value at this time. After determining the user's intention, subsequent processing is performed. Therefore, the core purpose of setting the preset acquisition operation is actually to determine whether the user has the intention to obtain the color value at this time.
[0032] The preset acquisition operations can include a variety of specific user behaviors, such as long pressing the mouse, clicking a specific shortcut key or key combination, or performing a specific gesture through the touch screen, etc. These operations are designed to ensure that the user clearly expresses his or her intention so that the system can accurately recognize and respond.
[0033] In this embodiment, the color value refers to the color information of the image, which can be expressed in the format of RGB (red, green, blue) value, HEX (hexadecimal) code or other color model. RGB value represents the intensity of red, green and blue through three numerical values, usually ranging from 0 to 255; HEX code is a six-digit hexadecimal number used to represent the color value, for example, #FF5733 represents an orange color. In this embodiment, when the system obtains the color value, it needs to read the color information of the pixel at the cursor and convert it into a preset format for storage and subsequent processing.
[0034] In this embodiment, the cursor position refers to the exact pixel position of the mouse pointer or touch point on the screen when the user acquires the color value of the image. In one embodiment, the position of the cursor can be detected and read through the system API or the interface provided by the operating system. In an image editor or image viewer, the cursor is usually displayed as an arrow or a cross, and the position of the cursor changes in real time when the user moves the mouse, touchpad or touch screen. The system captures the exact position of the cursor when the first operation meets the preset acquisition operation to ensure that the acquired color value is accurate.
[0035] Furthermore, in one embodiment, the preset acquisition operation includes: placing the cursor on the image and being in a long press confirmation state and a static state at the same time. The advantage of this setting is that the accuracy of the system response can be significantly improved. By requiring the cursor to stay on the image for a long time and remain static, the system can more accurately determine that the user's intention is to obtain the color value of a specific point in the image, rather than performing conventional browsing or other irrelevant operations. The combination of long press and static state further ensures that the user deliberately selects the color of a specific area, rather than clicking accidentally. This operation mode is more intuitive and has a low learning cost.
[0036] In another embodiment, the preset acquisition operation includes: a preset key trigger and a cursor click on the image. The user can quickly start the color value acquisition function through the set shortcut key, and only determine the color value to be acquired through subsequent mouse click operations, which greatly improves the operation efficiency. The user can quickly capture the required color information through the shortcut key for color matching or adjustment of design elements. However, this method has a certain learning cost.
[0037] Furthermore, step A also includes steps S10 to S20, which are specifically as follows:
[0038] Step S10: Scan the system background running programs and identify the running first picture editor based on the process name or window title.
[0039] In this embodiment, the first image editor is an image editor that may eventually use color values.
[0040] In one implementation, the currently active application list is first accessed through the system's task manager or a related program interface. This process can utilize the API provided by the operating system, such as the Windows API function EnumWindows to enumerate all top-level windows, or use a ps command similar to Linux combined with grep to filter the process list. Through these methods, the system can obtain detailed information of all running applications, including but not limited to window titles, process identifiers (PIDs), and other related system resource information.
[0041] After obtaining this information, the system will analyze the window title or process name and match it with a predefined list of image editors. This list can include a series of well-known image editing software names, such as Adobe Photoshop, GIMP or CorelDRAW. During the matching process, the system will check whether the title or process name of each active window contains keywords of these editor names, so as to confirm which one is the first image editor currently used by the user.
[0042] After the recognition is completed, the execution of step S10 provides the system with an exact target application environment, which is the basis for the subsequent color value capture and propagation operations to be accurately performed. For example, by accurately identifying the image editor that the user is using, the system can call the specific API or script interface of the editor to perform color value extraction and insertion operations. In addition, ensuring that the color value operation is performed in the correct editor can avoid compatibility issues, improve the success rate of the operation, and ensure the accuracy and consistency of color information.
[0043] In one implementation, for the Windows operating system, using C++ language combined with Windows API implementation examples, the code will show how to scan the system background running programs and identify the first running picture editor based on the window title.
[0044]
[0045]
[0046] In the above sample code, targetEditors is used to define a list containing the names of target picture editors. EnumWindowsProc is the callback function for enumerating windows. In this function, get the title of each window and check whether it contains the target editor name. If a matching editor is found, output the window title and stop enumeration. EnumWindows is a Windows API function used to enumerate all top-level windows, and EnumWindowsProc is used as the callback function.
[0047] The above sample code is based on the window title. If you rely on the process name, you only need to change the scanning process to the following process:
[0048] Use the EnumProcesses function to obtain the IDs of all running processes in the system. Use functions such as OpenProcess and GetModuleBaseName to obtain the name of each process. Finally, check whether the name of each process contains the name of the target image editor. If it matches, the process is determined to be the target editor.
[0049] Step S20: In response to the first image editor not being in the preset permission list, obtaining a color value insertion manual of the first image editor.
[0050] In one implementation, this step is intended to ensure that the system can correctly insert color values in an unauthorized image editor, thereby achieving the functions of color value capture and propagation.
[0051] Specifically, the step first checks the permission list predefined in the system to determine whether the currently identified first image editor is authorized to directly perform the color value insertion operation. The permission list is a list of recognized and supported image editors, which are pre-configured to ensure that they are compatible with the color value operation of the system. The list is stored in a system configuration file or database, and contains the name of the editor, version information, etc.
[0052] When the system confirms that the current image editor is not in the permission list, step S20 automatically obtains the corresponding color value insertion manual. The color value insertion manual is a detailed script file that describes how to perform color value insertion operations in a specific image editor. The process of obtaining the color value insertion manual includes retrieving relevant documents from a server. The system obtains the latest manual file corresponding to the first image editor through a file download protocol (such as HTTP or FTP).
[0053] In this embodiment, the role of this step is to ensure that the system can accurately insert color values in various unauthorized image editors. By dynamically acquiring and applying the color value insertion manual, the system has high flexibility and scalability and can support more types and versions of image editors. In this way, even if it is the first time to use the first image editor, the system can implement the color value capture and propagation functions through the guidance provided by the color value insertion manual, ensure the consistency of user experience and the accuracy of operation, and comprehensively improve the overall user experience.
[0054] Furthermore, in one embodiment, after step A, the method further includes step S30:
[0055] Step S30: storing the color value in a shared memory of the system in a preset format.
[0056] In one implementation, the system creates or accesses a shared memory object. Shared memory is an inter-process communication (IPC) mechanism that allows multiple processes to access the same memory area. In Windows operating systems, shared memory objects can be created and mapped using the CreateFileMapping and MapViewOfFile functions; in Linux operating systems, similar operations can be performed using the shm_open, ftruncate, and mmap functions. The name of a shared memory object is unique to avoid conflicts with other shared memory objects in the system.
[0057] After creating the shared memory object, the system needs to convert the captured color value data into a preset format. Taking the RGB format as an example, the system splits the captured color value into three components: red, green, and blue, and stores the value of each component in the corresponding location in the shared memory.
[0058] In this embodiment, the color value is stored in the shared memory, and the system can efficiently realize the sharing and transmission of color values between different processes or applications. Secondly, by storing the color value data in a preset format, the system can ensure the consistency and standardization of the color value information. This not only simplifies the data access operation, but also improves the compatibility and scalability of the system. Regardless of the type of image editor or application, as long as the preset format is followed, the color value data in the shared memory can be seamlessly accessed and used, realizing the color value capture and dissemination function across platforms and applications.
[0059] Furthermore, in one embodiment, the preset acquisition operation includes: placing the cursor on the image and being in a long press confirmation state and a static state at the same time. In this embodiment, the method also includes: in response to the user's first operation satisfying the preset acquisition operation, triggering a progress bar, wherein the progress bar is located near the cursor on the screen; when the progress of the progress bar is completed, the color value is stored.
[0060] Specifically, when the cursor is determined to be in the image area and enters the long press confirmation state, the system further detects the static state of the cursor. The static state means that the cursor does not move significantly for a certain period of time during the long press process, which can be achieved by setting a small allowable movement range (such as 1-2 pixels). The system determines whether it is in a static state by continuously monitoring the changes in the cursor position. If the cursor remains within the allowable range within the set time, it is determined that it meets the static state.
[0061] In response to the user's first operation satisfying the above-mentioned preset acquisition operation, a progress bar is triggered. The progress bar can be designed as a circular or linear progress bar, which is displayed near the cursor on the screen so that the user can intuitively see the progress of the operation. The display of the progress bar not only enhances the user experience and makes the operation process more transparent, but also provides a clear visual feedback to reduce the uncertainty caused by user misoperation.
[0062] When the progress bar starts, a timer is started to record the duration of the long press. The update frequency of the progress bar is usually consistent with the update frequency of the timer to ensure that the progress bar can reflect the progress of the operation in real time. The user can judge whether the operation is successful by observing the changes in the progress bar. When the progress of the progress bar is completed, that is, the long press time reaches the preset threshold, the system automatically performs the color value storage operation, that is, stores it in the shared content.
[0063] In this embodiment, the design of the progress bar provides the user with clear visual feedback, making the operation process more intuitive and transparent. The display position of the progress bar is close to the cursor, ensuring that the user can easily observe it without affecting other operations. The progress bar also provides the user with an opportunity to interrupt the operation. If the user releases or moves the cursor before the progress bar is full, the color value will not be stored in the shared content.
[0064] Furthermore, in one embodiment, step A further comprises: steps A-1 to A-2, which are specifically as follows:
[0065] Step A-1: In response to the user's first operation satisfying a preset acquisition operation, query whether the content at the current cursor position is an image.
[0066] In one implementation, the system calls an API interface provided by the operating system or the image editor to obtain the current position of the cursor. The current position of the cursor is usually represented by screen coordinates (such as x, y), which can be obtained in real time by calling a system function. After obtaining the cursor coordinates, the system needs to query the content type corresponding to these coordinates to confirm whether the cursor is located in the image area.
[0067] Furthermore, at the operating system level, the system can confirm the content of the area where the cursor is located by obtaining window properties. For example, in the Windows operating system, the EnumWindows and GetWindowText functions can be used to obtain all windows and their titles, and by matching the window title and process name, it can be determined whether the current active window is an image editor or viewer, and further inquire whether the cursor coordinates are located in the image area.
[0068] The effect of this design is to ensure that the color value acquisition operation is only performed when the cursor is located in the image content, avoiding misoperation and invalid operation. By accurately querying the content type at the cursor position, the system can improve the accuracy of color value capture and ensure that the captured color value data is real and valid image information. This process also improves the intelligence level of the system, enabling it to automatically identify and adapt to different application environments, improving user experience.
[0069] Step A-2: In response to the content at the current position of the cursor being an image, executing "obtaining the color value at the cursor in the image".
[0070] In one implementation, after confirming that the content at the current cursor position is an image, the system will execute an operation of obtaining the color value of the cursor in the image.
[0071] Step B: monitoring the second operation of the user until the second operation satisfies a preset filling operation, and filling the first area at least based on the color value.
[0072] In this embodiment, the first area is a fillable area selected by a user in the first picture editor.
[0073] In one embodiment, the preset fill operation refers to a specific interactive action performed by the user in the image editor to trigger the color value fill process. The preset fill operation can be embodied in various forms, such as mouse clicks, drag operations, keyboard shortcuts, etc. The purpose of the preset fill operation is to make the system clear to which specific area in the image the user wants to apply the captured color value. In order to ensure the accuracy of the operation and user experience, the system needs to monitor and identify in real time whether the user's second operation satisfies the preset fill operation.
[0074] In one implementation, the second operation at least includes an operation of a cursor by a user.
[0075] Furthermore, the preset filling operation includes: moving the cursor into the first area and clicking the cursor.
[0076] Specifically, the system implements monitoring and identification of the second operation through the following technical steps:
[0077] In one embodiment, the user's input devices, including the mouse and keyboard, are continuously monitored during the background operation. When the user operates in the image editor, the system obtains and analyzes input events through the API interface, and captures the user's click and key events. After detecting the user's input events, the system further analyzes whether these events meet the preset fill operation conditions. The preset fill operation is set and managed in the system through predefined rules or configuration files.
[0078] The fillable area refers to the part that can be filled with color in the image editor, usually including layers, selections, shapes or paths, etc. Once it is confirmed that the user's operation meets the preset filling operation conditions, the system executes the color value filling process.
[0079] In this embodiment, by real-time monitoring of the user's input events and combining the preset filling operation conditions, the system can accurately identify the user's operation intention and ensure the accuracy and effectiveness of color value filling. This design can reduce misoperation and improve the user's operation experience and satisfaction.
[0080] The method of filling the first area at least based on the color value further includes step B-1.
[0081] Step B-1: Fill the color value into the first area based on the color value insertion manual, wherein the second operation at least includes the user moving the cursor into the first area.
[0082] In this embodiment, the color value insertion manual is used to fill the color value into the first area in the first image editor according to the preset operation step script.
[0083] In one implementation, the color value insertion manual includes an operation step script, wherein the operation step script is used to guide the user or the system to automatically complete the color value filling process. The color value insertion manual exists in the form of a document or a script file.
[0084] The operation steps in the color value insertion manual can be written in various scripting languages, such as JavaScript, Python, VBA, etc., depending on the support of the image editor. For example, for Adobe Photoshop, you can use JavaScript or AppleScript to write scripts; for GIMP, you can use Python scripts; for Microsoft PowerPoint, you can use VBA scripts.
[0085] The effect of this step is to ensure that the color value can be accurately and efficiently filled into the specified image area. Through the detailed guidance provided by the color value insertion manual, the system can perform consistent operations in different image editors to ensure the accuracy and consistency of color value filling. At the same time, the user only needs to move the cursor to the first area and click to automatically complete the color value filling, which greatly simplifies the operation process and improves work efficiency.
[0086] In one implementation, inserting a color value into a manual includes: reading a color value; setting a foreground color; and filling a selection.
[0087] Take Photoshop (an image editor) as an example, that is, the color value insertion manual first reads the color value to be filled from the shared memory. Then the read color value is set as the foreground color of Photoshop. Then the fill operation is started, and when the user clicks the first area, the color value will naturally be filled into the first area.
[0088] Furthermore, some code examples are provided for inserting outstanding values into the manual:
[0089]
[0090]
[0091]
[0092] In summary, in this embodiment, the use of the color value insertion manual also enhances the scalability and compatibility of the system. By directly setting the foreground color and prompting the user to fill it in manually, the script's dependence on complex operations is reduced. It is applicable to various versions of Photoshop and similar image editing software, and does not rely on specific APIs or complex script interfaces. By updating the content of the manual, more types and versions of image editors can be supported to meet the changing needs of users. No matter what editor the user uses, as long as the system has the corresponding color value insertion manual, the color value capture and propagation function across editors can be realized, ensuring color consistency and ease of operation between different platforms and tools.
[0093] Step B-2: In response to the color value being successfully filled into the first area, deleting the color value from the shared memory.
[0094] In one embodiment, after the color value is successfully filled into the first area, the color value is deleted from the shared memory of the system. This maintains the cleanliness and efficiency of the shared memory, and ensures system security and real-time data updates. In addition, by timely deleting color value data that is no longer needed, the accumulation of obsolete or useless data can be prevented, memory usage can be reduced, and the erroneous reuse of old color values can be avoided.
[0095] Furthermore, after step B, steps C-1 and C-2 are also included, such as Figure 3 As shown, the details are as follows:
[0096] Step C-1: Obtain the API interface plug-in corresponding to the first image editor from the resource server.
[0097] In one embodiment, the resource server is a server that stores and manages various resource files. In this embodiment, when the system detects that the currently used image editor is not in the permission list, the system will send a request to the resource server to obtain the corresponding API interface plug-in. The request usually contains necessary information such as the name and version number of the image editor so that the resource server can return the accurate plug-in file.
[0098] After receiving the request, the resource server locates the corresponding API interface plug-in by searching its database or file system, and packages the plug-in file and returns it to the client. After receiving the plug-in file, the client performs integrity verification and decompression, and prepares for installation and configuration.
[0099] Step C-2: In response to obtaining the API interface plug-in, install and configure the plug-in, and add the first image editor to the permission list.
[0100] In one implementation, the system decompresses the downloaded plug-in file to a specified directory and then executes necessary installation commands or operations to integrate the plug-in into the system.
[0101] After successful installation, the system will add the name and version information of the current image editor to the permission list. By adding the image editor to the permission list, the system can quickly identify and call the corresponding plug-in in subsequent operations to achieve efficient color value management.
[0102] In this embodiment, when the system is used for the first time by the user, if it detects that the first image editor is not in the preset permission list, the system will guide the user to manually fill in the color value through the color value insertion manual. Although manually filling in the color value is cumbersome, it ensures the feasibility of the operation. At the same time, the system will automatically download and install the corresponding API interface plug-in from the resource server, and add the image editor to the permission list. In this way, in subsequent operations, the system can automatically identify and use the installed API interface plug-in to fill in the color value, which greatly simplifies the operation process and improves efficiency and accuracy. In this way, the system effectively combines the initial manual operation with subsequent automated management and optimizes the user experience.
[0103] Furthermore, in one embodiment, the method further comprises steps D-1 to D-2, which are specifically as follows:
[0104] Step D-1: In response to the first image editor being in a preset permission list, obtaining an API interface plug-in corresponding to the first image editor based on the permission list.
[0105] In one embodiment, when a user is using an image editor to perform an operation, the system will first check whether the editor currently being used is in a preset permission list. When the system detects that the image editor being used by the user is in the permission list, the system will obtain the corresponding API interface plug-in based on the list.
[0106] The process of obtaining an API interface plugin involves accessing the local directory where the plugin is stored.
[0107] The step of filling the first area at least based on the color value comprises:
[0108] Step D-2: Filling the color value into the first area based on the API interface plug-in, wherein the second operation at least includes the user moving the cursor into the first area.
[0109] In one implementation, specifically, when the user moves the cursor to the target area through the second operation, the system calls the loaded API interface plug-in to apply the previously captured color value to the area.
[0110] In one implementation, the system queries the region attributes of the cursor coordinates, such as layers, selections, or shapes, through the API interface of the image editor. After confirming that the region is valid, the system calls the function module of the API interface plug-in to fill the captured color value (such as RGB value or HEX code) into the target region. The API interface plug-in usually provides a series of methods and functions for setting the foreground color, background color, fill style, etc. By calling these methods, the system can accurately control the application effect of the color value.
[0111] In this embodiment, through the combination of the preset permission list and the API interface plug-in, the system can efficiently and accurately perform the color value filling operation. Specifically, the API interface plug-in provides a rich functional interface, making the color value filling operation more flexible and accurate. Through these interfaces, the system can adjust the filling style, color parameters, etc. according to actual needs to meet the needs of different users and application scenarios.
[0112] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0113] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes a computer program, and the computer program can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0114] Furthermore, the present invention also provides a control device. In an embodiment of a control device according to the present invention, the control device includes a processor and a storage device. The storage device can be configured to store a program for executing the color value capture and propagation method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the color value capture and propagation method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.
[0115] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the color value capture and propagation method of the above method embodiment, and the program can be loaded and run by a processor to implement the above color value capture and propagation method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0116] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0117] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0118] According to one aspect of an embodiment of the present application, a method for interacting with a smart home device is provided. The method for interacting with a smart home device is widely used in smart home, smart home, smart home device ecosystem, smart home ecosystem and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for interacting with the smart home device can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0119] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0120] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A color value capture and propagation method, characterized in that: include: In response to the user's first operation satisfying a preset acquisition operation, a color value at a cursor in the image is acquired; Listen to the user's second operation until the second operation satisfies a preset fill operation, and fill the first area at least based on the color value, wherein the first area is a fillable area selected by the user in the first image editor, and wherein the first operation and the second operation both include at least the user's operation on the cursor.
2. The color value capture and propagation method according to claim 1, characterized in that: During the monitoring of the second operation of the user, until the second operation satisfies a preset filling operation, at least before the first area is filled based on the color value, the method further includes: Scanning the system background running programs and identifying the first running picture editor based on the process name or window title; In response to the first picture editor not being in a preset permission list, obtaining a color value insertion manual of the first picture editor; The filling of the first area at least based on the color value comprises: The color value is filled into the first area based on the color value insertion manual, wherein the second operation at least includes the user moving the cursor into the first area, and the color value insertion manual is used to fill the color value into the first area in the first image editor according to a preset operation step script therein.
3. The color value capture and propagation method according to claim 1, characterized in that: After acquiring the color value of the cursor in the image and before monitoring the second operation of the user, the method further includes: Storing the color value in a shared memory of the system in a preset format; After filling the first area at least based on the color value, the method further includes: In response to the color value being successfully filled into the first area, the color value is deleted from the shared memory.
4. The color value capture and propagation method according to claim 1, characterized in that: The preset acquisition operation includes: placing the cursor on the image and being in a long press confirmation state and a static state at the same time. The method also includes: In response to the user's first operation satisfying a preset acquisition operation, triggering a progress bar, wherein the progress bar is located near a cursor on the screen; When the progress of the progress bar is completed, the color value is stored.
5. The color value capture and propagation method according to claim 1, characterized in that: In response to the user's first operation satisfying a preset acquisition operation, acquiring the color value of the cursor in the image further includes: In response to the user's first operation satisfying a preset acquisition operation, querying whether the content at the current cursor position is an image; In response to the content at the current position of the cursor being an image, "obtaining the color value at the cursor in the image" is executed.
6. The color value capture and propagation method according to claim 2, characterized in that: After filling the color value into the first area based on the color value insertion manual, the method further includes: Obtaining an API interface plug-in corresponding to the first image editor from a resource server; In response to obtaining the API interface plug-in, the plug-in is installed and configured, and the first image editor is added to the permission list.
7. The color value capturing and propagation method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the first image editor being in a preset permission list, acquiring an API interface plug-in corresponding to the first image editor based on the permission list; The filling of the first area at least based on the color value comprises: The color value is filled into the first area based on the API interface plug-in, wherein the second operation at least includes the user moving the cursor into the first area and clicking the cursor.
8. The color value capture and propagation method according to claim 1, characterized in that: The preset filling operation includes: moving the cursor to the first area and clicking, or moving the cursor from the image to the first area by dragging.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the color value capturing and propagating method according to any one of claims 1 to 8 is executed when the program is run.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the color value capturing and propagating method according to any one of claims 1 to 8 through the computer program.
