A method, device, electronic device and storage medium for selecting a graphic object
By determining the target cell area in the spreadsheet office software and traversing the graphic objects to determine their positional relationships, the problem of low efficiency in selecting graphic objects is solved and efficient selection is achieved when the display area is exceeded.
Patent Information
- Application Number
- CN201910265034.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-03
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-04-03
AI Technical Summary
When using spreadsheet office software, the efficiency of selecting graphic objects is low because when the graphic object is outside the worksheet, the mouse scrolls slowly, causing the selection process to take a long time.
By determining the target cell area that is currently selected in the worksheet, and traversing the graphic object, judging its positional relationship with the target cell area, if it overlaps, mark it as an object to be selected and perform the selection operation to improve the selection efficiency.
When the distribution of graphic objects exceeds the display area, selecting cell areas significantly improves the selection efficiency and reduces the time consumption of the selection process.
Smart Images

Figure CN111784800B
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphics processing technology, and in particular to a method, device, electronic device and storage medium for selecting a graphics object. Background Art
[0002] When using spreadsheet office software, you often need to select graphic objects to be inserted into a worksheet, where the graphic objects can be self-selected graphics, charts, or pictures, etc.
[0003] In the related art, a graphic object is selected through the object selection function provided by spreadsheet office software. The specific process is: the user makes the mouse selection mode enter the object selection mode, and then the user uses the mouse to select the graphic object.
[0004] Although the above-mentioned related technologies can realize the selection of graphic objects, there are the following problems:
[0005] When entering the object selection mode, it is difficult to scroll the worksheet display area with the mouse, and even if the display area is scrolled, the speed is very slow. Then, if the position of the graphic object to be selected in the worksheet exceeds the display area, the user will need to spend a lot of time to select the graphic object, resulting in low efficiency in selecting the graphic object. Summary of the invention
[0006] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for selecting a graphic object, so as to improve the efficiency of selecting a graphic object. The specific technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for selecting a graphic object, comprising:
[0008] After obtaining the graphic object selection instruction issued by the user, determine the target cell area that is currently selected in the worksheet;
[0009] Traversing each graphic object in the worksheet, when traversing to each graphic object, determining whether the position relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship, and if so, marking the graphic object as an object to be selected;
[0010] A selection operation is performed on each marked object to be selected.
[0011] Optionally, before the step of determining the target cell area currently selected in the worksheet, the method further includes:
[0012] Determine the type of the data content currently selected in the worksheet, whether it is a cell type;
[0013] When it is determined that the type of the data content currently selected in the worksheet is a cell type, the step of determining the target cell area currently selected in the worksheet is performed.
[0014] Optionally, a method for selecting a graphic object provided in an embodiment of the present application further includes:
[0015] When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window is output;
[0016] Wherein, the prompt window is used to prompt the user to select a cell area.
[0017] Optionally, the determining whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship includes:
[0018] It is determined whether the target cell area completely contains the area where the graphic object is located. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0019] Optionally, the determining whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship includes:
[0020] It is determined whether the target cell area and the area where the graphic object is located have the same position point. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0021] In a second aspect, an embodiment of the present application provides a device for selecting a graphic object, including:
[0022] A cell determination module is used to determine the target cell area currently in the selected state in the worksheet after obtaining a graphic object selection instruction issued by the user;
[0023] An object marking module, used for traversing each graphic object in the worksheet, and when traversing to each graphic object, determining whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, and if so, marking the graphic object as an object to be selected;
[0024] The object selection module is used to perform a selection operation on each marked object to be selected.
[0025] Optionally, the cell determination module is specifically used to:
[0026] After obtaining the graphic object selection instruction issued by the user, determine the type of the data content currently selected in the worksheet, whether it is a cell type;
[0027] When it is determined that the type of the data content currently selected in the worksheet is a cell type, a target cell area currently selected in the worksheet is determined.
[0028] Optionally, the cell determination module is further used for:
[0029] When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window is output;
[0030] Wherein, the prompt window is used to prompt the user to select a cell area.
[0031] Optionally, the object marking module determines whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, including:
[0032] It is determined whether the target cell area completely contains the area where the graphic object is located. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0033] Optionally, the object marking module determines whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, including:
[0034] It is determined whether the target cell area and the area where the graphic object is located have the same position point. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0036] Memory, used to store computer programs;
[0037] The processor is used to implement the steps of a graphic object selection method provided in an embodiment of the present application when executing a program stored in the memory.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of a graphic object selection method provided in an embodiment of the present application are implemented.
[0039] In the solution provided by the embodiment of the present application, after obtaining the graphic object selection instruction issued by the user, the target cell area in the worksheet that is currently in the selected state is determined; each graphic object in the worksheet is traversed, and when each graphic object is traversed, it is determined whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship. If so, the graphic object is marked as an object to be selected; and then, the selection operation is performed on each marked object to be selected. Since the scrolling speed of the display area is high in the cell selection mode, the selection of the graphic object is realized by selecting the cell area, which can greatly improve the efficiency of selecting the graphic object when the distribution position of the graphic object to be selected exceeds the display area.
[0040] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] 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, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flowchart of a method for selecting a graphic object provided in an embodiment of the present application;
[0043] Figure 2 Another flow chart of a method for selecting a graphic object provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the structure of a device for selecting a graphic object provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0046] FIG5( a) is a schematic diagram of a worksheet interface exemplarily provided in an embodiment of the present application;
[0047] FIG5( b ) is a schematic diagram of another worksheet interface provided exemplarily in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0049] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, electronic device and storage medium for selecting a graphic object to improve the efficiency of selecting a graphic object.
[0050] The following first introduces a method for selecting a graphic object provided in an embodiment of the present application.
[0051] A method for selecting a graphic object provided in an embodiment of the present application can be applied to an electronic device. In a specific application, the electronic device can be a device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. that can run spreadsheet office software. In addition, a method for selecting a graphic object provided in an embodiment of the present application can be applied to the selection of multiple graphic objects, and of course, it can also be applied to the selection of one graphic object.
[0052] Furthermore, the functional software implementing the graphic object selection method may be a functional plug-in embedded in an existing spreadsheet office software. Of course, the functional software implementing the graphic object selection method may also be a specialized spreadsheet office software, which may be a new software that adds a graphic object selection function to the existing spreadsheet office software.
[0053] In addition, the table office software involved in the embodiment of the present application can be any software that uses electronic tables as processing objects, such as: execl table software, wps table software, etc.; and the type of graphic objects to be selected in the worksheet can include but is not limited to self-selected graphics, charts or pictures. Among them, execl table software is a spreadsheet processing software under Microsoft, and wps table software is a spreadsheet processing software under Kingsoft.
[0054] like Figure 1 As shown, a method for selecting a graphic object provided in an embodiment of the present application may include the following steps:
[0055] S101, after obtaining a graphic object selection instruction issued by a user, determining a target cell area that is currently selected in the worksheet;
[0056] The worksheet is an active worksheet, that is, a worksheet that can be currently operated by the user.
[0057] Before executing the process of the present solution, in the cell mode of the worksheet, the user can, based on the position of the graphic object to be selected, perform a selection operation on a cell area that has a predetermined overlapping position relationship with the graphic object to be selected, and after selecting the cell area, issue a graphic object selection instruction; further, the electronic device can obtain the graphic object selection instruction issued by the user, and after obtaining the graphic object selection instruction issued by the user, it can determine the target cell area in the worksheet that is currently in a selected state, and perform subsequent operations.
[0058] In a specific application, the so-called cell area having a predetermined overlapping relationship with the graphic object to be selected may refer to: a cell area that completely includes the area where the graphic object to be selected is located, that is, after the graphic object to be selected is determined, the user determines the cell area that completely includes the area where the graphic object to be selected is located, and performs a selection operation on the determined cell. Of course, the so-called cell area having a predetermined overlapping relationship with the graphic object to be selected may also refer to: a cell area that has the same position point as the area where the graphic object to be selected is located, that is, after the graphic object to be selected is determined, the user can determine the cell area that has the same position point as the area where the graphic object to be selected is located, and perform a selection operation on the determined cell area.
[0059] It can be understood that when there are multiple graphic objects to be selected, the so-called cell area that completely contains the area where the graphic objects to be selected are: the cell area that completely contains the areas where each graphic object to be selected is located, as shown in Figure 5(a); and the so-called cell area that has the same position point as the area where the graphic objects to be selected are located is: the cell area that has the same position point as each graphic object to be selected, as shown in Figure 5(b). Among them, the area contained in the black border in Figure 5(a) and Figure 5(b) is the selected target cell area, and the three graphic objects in Figure 5(a) and Figure 5(b) are the graphic objects to be selected.
[0060] In addition, there may be multiple ways for a user to issue a graphic object selection instruction. Exemplarily, in one implementation, a button for a graphic object selection instruction may be provided in the function menu area of a worksheet, so that a user may issue a graphic object selection instruction by clicking the button for the graphic object selection instruction. Exemplarily, in another implementation, a user may issue a graphic object selection instruction by issuing a specified gesture operation through an operating body such as a mouse, a stylus, or a finger. The above-mentioned ways for a user to issue a graphic object selection instruction are merely examples and should not constitute limitations on the embodiments of the present application.
[0061] S102, traversing each graphic object in the worksheet, and when traversing to each graphic object, determining whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, and if so, marking the graphic object as an object to be selected;
[0062] After determining the target cell area currently in the selected state in the worksheet, the electronic device can traverse each graphic object in the worksheet, and when traversing to each graphic object, determine whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, and perform different operations according to different determination results. Specifically, when it is determined that the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, the graphic object can be marked as an object to be selected, and the next graphic object can be traversed; and when it is determined that the position relationship between the area where the graphic object is located and the target cell area is not a predetermined overlapping relationship, the graphic object can be not marked, and the next graphic object can be traversed.
[0063] Exemplarily, in one implementation, determining whether the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship may include:
[0064] It is determined whether the target cell area completely contains the area where the graphic object is located. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0065] For this determination method, the cell area having a specified positional relationship with the graphic object to be selected refers to: a cell area that completely contains the area where the graphic object to be selected is located.
[0066] Exemplarily, in another implementation, determining whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship may include:
[0067] It is determined whether the target cell area and the area where the graphic object is located have the same position point. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0068] For this determination method, the cell area having a specified position relationship with the graphic object to be selected refers to: a cell area having the same position point as the area where the graphic object to be selected is located.
[0069] The above-mentioned specific implementation method for determining whether the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship is merely an example and should not constitute a limitation on the embodiments of the present application. In addition, for the sake of clarity of layout and solution, the specific implementation method for determining whether the target cell area completely contains the area where the graphic object is located, and determining whether the target cell area and the area where the graphic object is located have the same position point, is introduced below by way of example.
[0070] S103: performing a selection operation on each marked object to be selected.
[0071] It is understandable that, in the process of traversing the graphic objects, each time a to-be-selected object is marked, a selection operation may be performed on the to-be-selected object. Alternatively, after traversing all the graphic objects, a selection operation may be performed on all the to-be-selected graphic objects at once.
[0072] In addition, in a specific application, in order to traverse the graphic objects in the worksheet, illustratively, in one implementation, in the functional software that implements the graphic object selection method, a graphic type variable a, a cell type variable b, a graphic area type variable c, and an array variable d can be declared. Among them, the graphic type variable a is used for the graphic object to enter the loop and represents the graphic object pointed to by the loop; the cell type variable b is used to store the target cell area currently selected in the worksheet; the graphic area type variable c is used to store the graphic area located in the cell selection area, that is, the graphic object to be selected; the array variable d is used to store the name of the graphic object located in the cell selection area. And, using the name contained in the array variable d as the range, a graphic area is defined and assigned to the graphic area variable c, and then the variable c executes the selection command. At this time, all graphic objects in the cell selection area of the active worksheet will be selected.
[0073] In the solution provided by the embodiment of the present application, after obtaining the graphic object selection instruction issued by the user, the target cell area in the worksheet that is currently in the selected state is determined; each graphic object in the worksheet is traversed, and when each graphic object is traversed, it is determined whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship. If so, the graphic object is marked as an object to be selected; and then, the selection operation is performed on each marked object to be selected. Since the scrolling speed of the display area is high in the cell selection mode, the selection of the graphic object is realized by selecting the cell area, which can greatly improve the efficiency of selecting the graphic object when the distribution position of the graphic object to be selected exceeds the display area.
[0074] For a clear layout and solution, the following is an example of a specific implementation method for determining whether the target cell area completely contains the area where the graphic object is located, and determining whether the target cell area and the area where the graphic object is located have the same location point.
[0075] Exemplarily, in one implementation, determining whether the target cell area completely includes the area where the graphic object is located may include:
[0076] Determine whether the positional relationship between the area where the graphic object is located and the target cell area satisfies the following four conditions at the same time:
[0077] (1) The horizontal coordinate of the upper left corner vertex of the area where the graphic object is located is greater than or equal to the horizontal coordinate of the upper left corner vertex of the target cell area;
[0078] (2) The first value corresponding to the graphic object is less than or equal to the first value corresponding to the target cell area. The first value corresponding to the graphic object is the value obtained by adding the abscissa of the upper left corner vertex of the graphic object to the width of the graphic object. The first value corresponding to the target cell area is the value obtained by adding the abscissa of the upper left corner vertex of the target cell area to the width of the target cell area.
[0079] (3) The ordinate of the upper left corner vertex of the graphic object is greater than or equal to the ordinate of the upper left corner vertex of the target cell area;
[0080] (4) The second numerical value corresponding to the graphic object is less than or equal to the second numerical value corresponding to the target cell area. The second numerical value corresponding to the graphic object is: the value obtained by adding the ordinate of the upper left corner vertex of the graphic object to the height of the graphic object. The second numerical value corresponding to the target cell area is: the value obtained by adding the ordinate of the upper left corner vertex of the target cell area to the height of the target cell area.
[0081] It can be understood that in the above specific implementation method, the upper left corner vertex of the graphic object and the upper left corner vertex of the target cell area are used as the basis for judgment. Of course, the upper right corner vertex of the graphic object and the upper right corner vertex of the target cell area can also be used as the basis for judgment, the lower left corner vertex of the graphic object and the lower left corner vertex of the target cell area can be used as the basis for judgment, or the lower right corner vertex of the graphic object and the lower right corner vertex of the target cell area can be used as the basis for judgment, which are all reasonable.
[0082] Exemplarily, in one implementation, determining whether the target cell area and the area where the graphic object is located have the same location point may include the following steps:
[0083] Determine whether the positional relationship between the area where the graphic object is located and the target cell area meets one of the following four conditions:
[0084] (1) The horizontal coordinate of the upper left corner vertex of the graphic object is within the horizontal coordinate range of the target cell area, and the vertical coordinate of the upper left corner vertex of the graphic object is within the vertical coordinate range of the target cell area;
[0085] (2) the horizontal coordinate of the upper right corner vertex of the graphic object is within the horizontal coordinate range of the target cell area, and the vertical coordinate of the upper right corner vertex of the graphic object is within the vertical coordinate range of the target cell area;
[0086] (3) The horizontal coordinate of the lower left corner vertex of the graphic object is within the horizontal coordinate range of the target cell area, and the vertical coordinate of the lower left corner vertex of the graphic object is within the vertical coordinate range of the target cell area;
[0087] (4) The horizontal coordinate of the lower right corner vertex of the graphic object is within the horizontal coordinate range of the target cell area, and the vertical coordinate of the lower right corner vertex of the graphic object is within the vertical coordinate range of the target cell area.
[0088] It is understandable that the above-mentioned specific implementation method for determining whether the target cell area and the area where the graphic object is located have the same position point is merely an example and should not constitute a limitation on the embodiments of the present application. Any specific implementation method that can determine whether the target cell area and the area where the graphic object is located have the same position point can be used as an implementation method of the present application.
[0089] In some cases, when a user wants to select a graphic object, the user may not select a cell area as required, but other content, such as a graphic object or text content in a cell. In this case, in order to ensure the effective execution of the graphic object selection process and the user experience, verification of the selected content can be added. Therefore, the embodiment of the present application also provides a method for selecting a graphic object. Figure 2 As shown, a method for selecting a graphic object provided in an embodiment of the present application may include the following steps:
[0090] S201, after obtaining the graphic object selection instruction issued by the user, determine the type of the data content currently selected in the worksheet, whether it is a cell type, if yes, execute S203; otherwise, execute S202;
[0091] In this embodiment, after obtaining the graphic object selection instruction issued by the user, the target cell area in the worksheet that is currently selected is not directly determined, but the type of data content that is currently selected in the worksheet is judged, whether it is a cell type, and then different operations are performed according to different judgment results.
[0092] Specifically, when it is determined that the type of the data content currently selected in the worksheet is a cell type, it can be indicated that the issuance of the graphic object selection instruction is not an erroneous operation, and at this time, S203 can be executed to start the graphic object selection process. When it is determined that the type of the data content currently selected in the worksheet is not a cell type, it can be indicated that the issuance of the graphic object selection instruction is an erroneous operation, and at this time, S202 can be executed to start the graphic object selection process.
[0093] S202, outputting a prompt window, wherein the prompt window is used to prompt the user to select a cell area;
[0094] When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window may be output to prompt the user to select the cell area.
[0095] The content in the prompt window can be simple text content, for example: please select the cell area containing the graphic object to be selected. Of course, in order to facilitate users to understand the specific operation, the content in the prompt window can also be in the form of text plus pictures to prompt users more vividly.
[0096] S203, determining the target cell area currently selected in the worksheet;
[0097] S204, traversing each graphic object in the worksheet, and when traversing to each graphic object, determining whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, and if so, marking the graphic object as an object to be selected;
[0098] S205: performing a selection operation on each of the marked objects to be selected.
[0099] In this embodiment, steps S203 to S205 are the same as steps S102 to S104 in the above embodiment, and are not described in detail here.
[0100] Since the scrolling speed of the display area is high in the cell selection mode, the selection of graphic objects can be realized by selecting the cell area, which can greatly improve the efficiency of selecting graphic objects when the distribution position of the graphic objects to be selected exceeds the display area. In addition, by adding verification and window prompts about the selected content, the effective execution of the graphic object selection process and user experience can be guaranteed.
[0101] Corresponding to the above method embodiment, the present application embodiment also provides a graphic object selection device. Figure 3 As shown, the graphic object selection device may include:
[0102] The cell determination module 310 is used to determine the target cell area currently in the selected state in the worksheet after obtaining the graphic object selection instruction issued by the user;
[0103] The object marking module 320 is used to traverse each graphic object in the worksheet, and when traversing each graphic object, determine whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, and if so, mark the graphic object as an object to be selected;
[0104] The object selection module 330 is used to perform a selection operation on each marked object to be selected.
[0105] In the solution provided by the embodiment of the present application, after obtaining the graphic object selection instruction issued by the user, the target cell area in the worksheet that is currently in the selected state is determined; each graphic object in the worksheet is traversed, and when each graphic object is traversed, it is determined whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship. If so, the graphic object is marked as an object to be selected; and then, the selection operation is performed on each marked object to be selected. Since the scrolling speed of the display area is high in the cell selection mode, the selection of the graphic object is realized by selecting the cell area, which can greatly improve the efficiency of selecting the graphic object when the distribution position of the graphic object to be selected exceeds the display area.
[0106] Optionally, the cell determination module 310 is specifically used to:
[0107] After obtaining the graphic object selection instruction issued by the user, determine the type of the data content currently selected in the worksheet, whether it is a cell type;
[0108] When it is determined that the type of the data content currently selected in the worksheet is a cell type, a target cell area currently selected in the worksheet is determined.
[0109] Optionally, the cell determination module 310 is further configured to:
[0110] When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window is output;
[0111] Wherein, the prompt window is used to prompt the user to select a cell area.
[0112] Optionally, the object marking module 320 determines whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, which may include:
[0113] It is determined whether the target cell area completely contains the area where the graphic object is located. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0114] Optionally, the object marking module 320 determines whether the position relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship, which may include:
[0115] It is determined whether the target cell area and the area where the graphic object is located have the same position point. If so, it is determined that the positional relationship between the area where the graphic object is located and the target cell area is a predetermined overlapping relationship.
[0116] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404;
[0117] Memory 403, used for storing computer programs;
[0118] The processor 401 is used to implement the steps of the graphic object selection method provided in the embodiment of the present application when executing the program stored in the memory 403.
[0119] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0120] The communication interface is used for communication between the above electronic device and other devices.
[0121] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0122] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0123] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the graphic object selection method provided in the embodiment of the present application are implemented.
[0124] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0125] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0126] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for selecting a graphic object. It is characterized in that include: After obtaining the graphic object selection instruction issued by the user, determine the target cell area that is currently selected in the worksheet; Traversing each graphic object in the worksheet, when traversing to each graphic object, determining whether the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship, and when determining that the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship, marking the graphic object as an object to be selected, and continuing to traverse the next graphic object; When it is determined that the positional relationship between the region where the graphic object is located and the target cell region is not a predetermined overlapping relationship, the graphic object is not marked, and the next graphic object is traversed; wherein the type of the graphic object includes a free-selected graphic, a chart or a picture; and the graphic object is content inserted into the worksheet; Performing a selection operation on each marked object to be selected; The region where the graphic object is located has a predetermined overlapping relationship with the target cell region, including: the target cell region completely includes the region where the graphic object is located; When the positional relationship between the region where the graphic object is located and the target cell region satisfies the following four conditions at the same time, determining that the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship; (1) The horizontal coordinate of the upper left corner vertex of the area where the graphic object is located is greater than or equal to the horizontal coordinate of the upper left corner vertex of the target cell area; (2) The first value corresponding to the graphic object is less than or equal to the first value corresponding to the target cell area. The first value corresponding to the graphic object is the value obtained by adding the abscissa of the upper left corner vertex of the graphic object to the width of the graphic object. The first value corresponding to the target cell area is the value obtained by adding the abscissa of the upper left corner vertex of the target cell area to the width of the target cell area. (3) The ordinate of the upper left corner vertex of the graphic object is greater than or equal to the ordinate of the upper left corner vertex of the target cell area; (4) The second numerical value corresponding to the graphic object is less than or equal to the second numerical value corresponding to the target cell area. The second numerical value corresponding to the graphic object is: the value obtained by adding the ordinate of the upper left corner vertex of the graphic object to the height of the graphic object. The second numerical value corresponding to the target cell area is: the value obtained by adding the ordinate of the upper left corner vertex of the target cell area to the height of the target cell area.
2. The method according to claim 1, It is characterized in that Before the step of determining the target cell area currently selected in the worksheet, the method further includes: Determine the type of the data content currently selected in the worksheet, whether it is a cell type; When it is determined that the type of the data content currently selected in the worksheet is a cell type, the step of determining the target cell area currently selected in the worksheet is performed.
3. The method according to claim 2, It is characterized in that Also includes: When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window is output; Wherein, the prompt window is used to prompt the user to select a cell area.
4. A graphic object selection device, It is characterized in that include: A cell determination module is used to determine the target cell area currently in the selected state in the worksheet after obtaining a graphic object selection instruction issued by the user; an object marking module, for traversing each graphic object in the worksheet, and when traversing to each graphic object, determining whether the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship, and when determining that the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship, marking the graphic object as an object to be selected, and continuing to traverse the next graphic object; When it is determined that the positional relationship between the region where the graphic object is located and the target cell region is not a predetermined overlapping relationship, the graphic object is not marked, and the next graphic object is traversed; wherein the type of the graphic object includes a free-selected graphic, a chart or a picture; and the graphic object is content inserted into the worksheet; An object selection module is used to perform a selection operation on each marked object to be selected; The region where the graphic object is located has a predetermined overlapping relationship with the target cell region, including: the target cell region completely includes the region where the graphic object is located; When the positional relationship between the region where the graphic object is located and the target cell region satisfies the following four conditions at the same time, determining that the positional relationship between the region where the graphic object is located and the target cell region is a predetermined overlapping relationship; (1) The horizontal coordinate of the upper left corner vertex of the area where the graphic object is located is greater than or equal to the horizontal coordinate of the upper left corner vertex of the target cell area; (2) The first value corresponding to the graphic object is less than or equal to the first value corresponding to the target cell area. The first value corresponding to the graphic object is the value obtained by adding the abscissa of the upper left corner vertex of the graphic object to the width of the graphic object. The first value corresponding to the target cell area is the value obtained by adding the abscissa of the upper left corner vertex of the target cell area to the width of the target cell area. (3) The ordinate of the upper left corner vertex of the graphic object is greater than or equal to the ordinate of the upper left corner vertex of the target cell area; (4) The second numerical value corresponding to the graphic object is less than or equal to the second numerical value corresponding to the target cell area. The second numerical value corresponding to the graphic object is: the value obtained by adding the ordinate of the upper left corner vertex of the graphic object to the height of the graphic object. The second numerical value corresponding to the target cell area is: the value obtained by adding the ordinate of the upper left corner vertex of the target cell area to the height of the target cell area.
5. The device according to claim 4, It is characterized in that The cell determination module is specifically used for: After obtaining the graphic object selection instruction issued by the user, determine the type of the data content currently selected in the worksheet, whether it is a cell type; When it is determined that the type of the data content currently selected in the worksheet is a cell type, a target cell area currently selected in the worksheet is determined.
6. The device according to claim 5, It is characterized in that The cell determination module is also used for: When it is determined that the type of the data content currently selected in the worksheet is not a cell type, a prompt window is output; Wherein, the prompt window is used to prompt the user to select a cell area.
7. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-3 when executing a program stored in a memory.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
