This application claims priority and benefits to Chinese Application No. 202111152578.5, filed on Sep. 29, 2021, the entire content of which is incorporated herein by reference.
The disclosure relates to a field of image technologies, and in particular, to a method and a device for displaying material, an electronic device, and a storage medium.
With the development of various image applications, more and more people use the image applications to process images, such as adding favorite materials to an image or editing the materials. For example, the material can be moved to a user-designated position of the image. During the process of moving the material, a material selecting frame may be moved to the outside of a canvas, and function keys on the material selecting frame will be moved to the outside of the canvas correspondingly.
According to one aspect, a method for displaying material is provided. The method includes:
displaying an image to be edited, a target material, a material selecting frame, and at least one editing control in an image editing area, in which the at least one editing control is on the material selecting frame and the target material is within the material selecting frame;
in response to a dragging operation of the target material, moving the target material and the material selecting frame along a trajectory of the dragging operation; and
in a case where a part of the material selecting frame is within the image editing area in response to the dragging operation, displaying the at least one editing control in the image editing area.
According to another aspect, an electronic device is provided. The electronic device includes:
a processor;
a memory configured to store instructions executable by the processor;
in which the processor is configured to execute the instructions to implement a method for displaying material as described above.
According to another aspect, a non-transitory computer-readable storage medium is provided. When instructions in the non-transitory computer-readable storage medium are executed by a processor of an electronic device, the electronic device is caused to execute a method for displaying material as described above.
It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the disclosure, and together with the description, serve to explain the principles of the disclosure and do not unduly limit the disclosure.
In order to make those skilled in the art well understand the technical solutions of the disclosure, the technical solutions according to embodiments of the disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms “first”, “second” and the like in the description and claims of the disclosure and the above drawings are used to distinguish similar objects, and are not used to describe a specific sequence. It is to be understood that the data used with the above terms are interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein can be implemented in sequences other than those illustrated or described herein. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of device and methods consistent with some aspects of the disclosure, as recited in the appended claims.
In an implementation, the server 01 may be configured to provide materials to be downloaded. For example, the server 01 may be an independent physical server, a server cluster including multiple physical servers, a distributed system, or a cloud server which may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
In an implementation, the terminal 02 may be configured for displaying material processing. For example, the terminal 02 may include, but is not limited to, smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR)/virtual reality (VR) devices, smart wearable equipment and other types of electronic devices. The operating system running on the electronic device may include, but is not limited to, an Android system, an IOS system, linux, windows, and the like.
In addition, it is to be noted that what illustrated in
The above-mentioned server 01 and terminal 02 may be directly or indirectly connected through wired or wireless communication, which is not limited in the disclosure.
It is to be noted that, the accompanying drawings provide a possible sequence, but the disclosure is not actually limited to strictly follow this sequence. Some blocks can be executed in parallel without being dependent on each other. User information (including but not limited to user equipment information, user personal information, user behavior information, etc.) and data (including but not limited to data to be presented, training data, etc.) involved in this disclosure are all authorized by the user or all parties.
In block S201, an image to be edited, a target material, a material selecting frame, and at least one editing control are displayed in an image editing area (canvas). The at least one editing control is on the material selecting frame.
In an example, the target material may be within the material selecting frame. As illustrated in
As illustrated in
The at least one editing control may be configured to edit the target material. For example, the at least one editing control includes controls such as deleting, flipping, rotating, copying, and erasing the target material. In an example, as illustrated in
In some examples, before the block S201, the method may further include: in response to a material editing instruction, entering the material editing page. The material editing page may include an image editing area and a material selecting area. The image editing area is configured to display the image to be edited, and the material selecting area is configured to display multiple materials. The target material can be one of the multiple materials. The material selecting area 1 is illustrated in
Correspondingly, the block S201 may include in response to a material selecting instruction of the target material, displaying the target material, the material selecting frame, and the at least one editing control on the image to be edited, where the at least one editing control is on the material selecting frame. In other words, in an image editing application, when starting a material editing operation, the entered material editing page may include the image to be edited within the image editing area. Further, the image to be edited, the material selecting frame of the target material, the at least one editing control of the target material are displayed in the image editing area when the user selects the target material.
It is to be noted that the above block S201 is not only used to enter the material editing page of an image to be edited when starting the material editing operation, but also used to start incremental material editing of the image to be edited in an original material editing state. In this case, a rotation angle of the material selecting frame, a position of the target material, a position of the material selecting frame, and positions of the editing controls on the material editing page in the block S201 can be illustrated in any of the following figures, and are not limited to those illustrated in
In block S203, in response to a dragging operation of the target material, the target material and the material selecting frame are moved along a trajectory of the dragging operation.
In practical applications, when the user needs to edit the material, for example, dragging the material to a desired position, the target material can be dragged. Correspondingly, in response to the dragging operation of the target material, the target material and the material selecting frame can be moved along the trajectory of the dragging operation. During a process of moving the target material and the material selecting frame, the editing controls may also move along the trajectory of the dragging operation, or may not move along the trajectory of the dragging operation. The manner of the dragging operation is not limited in the disclosure. For example, the dragging operation may be implemented by touching the screen. In some examples, a part of the target material and a part of the material selecting frame outside the image editing area can be hidden, which is not limited in the disclosure.
In block S205, in a case where a part of the material selecting frame is within the image editing area in response to the dragging operation, the at least one editing control is displayed within the image editing area.
In some examples, in response to the dragging operation, that is, during the process of performing the dragging operation, a relative position of the material selecting frame with respect to the image editing area can be monitored. In the case where a part of the material selecting frame is within the image editing area (that is, a part of the material selecting frame is moved outside the image editing area or a side of the material selecting frame overlaps an edge of the image editing area), the at least one editing control can be displayed in the image editing area. In other words, in a case where a part of the material selecting frame is within the image editing area, all editing controls are displayed within the image editing area, thereby ensuring that all editing controls can be displayed within the image editing area all the time and in an effective editing state. The position where the at least one editing control is displayed in the image editing area is not limited in the disclosure, as long as the at least one editing control is in the image editing area.
In some examples, in the case where the material selecting frame is within the image editing area in response to the dragging operation, the at least one editing control is displayed on the material selecting frame. The relative position of the at least one editing control with respect to the material selecting frame remains unchanged. By keeping the relative positions of the material selecting frame, the at least one editing control, and the target material with respect to the image editing area unchanged, the editing operation of the material can be performed stably, the user's selection of the editing control is convenient, and the user operation experience is improved.
In an implementation, the block S205 may include in the case where a part of the material selecting frame is within the image editing area in response to a dragging operation stop instruction, displaying the at least one editing control within the image editing area. By setting the stop instruction, processing resources caused by the dragging operation can be reduced, and the processing efficiency can be improved.
In one example, the user can select the target material and move the target material by touching a screen area corresponding to the image editing area and dragging the finger on the screen area (i.e., touching the screen to realize the dragging operation). At each starting time of the dragging operation, the electronic device starts to monitor touches on the screen is started. When no touch is detected on the screen, it can be considered that the dragging operation is over, such that the dragging operation stop instruction can be triggered. Accordingly, in response to the dragging operation stop instruction, a stop position of the material selecting frame can be monitored. In an example, in the case where a part of the material selecting frame is within the image editing area (that is, a part of the material selecting frame is moved to the outside of the image editing area or a side of the material selecting frame overlaps an edge of the image editing area), the at least one editing control may be displayed within the image editing area. For example, the at least one editing control can be displayed at a preset display area of the image editing area, as illustrated in
In another example, in the case where the material selecting frame is within the image editing area in response to the dragging operation stop instruction, the at least one editing control may be displayed on the material selecting frame. The relative position of the at least one editing control on the material selection frame keeps unchanged. In other words, when the entirety of the material selecting frame is within the image editing area at the ending of the dragging operation, the relative positions of the material selecting frame, the at least one editing control, and the target material can be the same with those illustrated in
During a process of moving the material, in a case where a part of the material selecting frame is within the image editing area, all editing controls are displayed in the image editing area. It can realize that all editing controls are within the image editing area all the time, which can improve the convenience of operating the material, improve the display flexibility of the editing controls related to the material, and improve the interaction effect in the process of editing the material.
In an implementation, in a case where a part of the material selecting frame is within the image editing area, the at least one editing control may be displayed in the preset display area of the image editing area. The preset display area can be an edge area of the image editing area or an area illustrated in
In an example, the block S205 may include the following.
In block S401, in a case where a second selecting sub-frame has an associated editing control, the at least one editing control is displayed on the first selecting sub-frame. The second selecting sub-frame is a part of the material selecting frame outside the image editing area, and the associated editing control is displayed on the second selecting sub-frame in a case where the second selecting sub-frame is within the image editing area. In other words, when the second selecting sub-frame is within the image editing area, the editing control displayed on the second selecting sub-frame can be regarded as the associated editing control of the second selecting sub-frame.
A part of the material selecting frame other than the first selecting sub-frame is the second selecting sub-frame.
As illustrated in
In some examples, in a case where the second selecting sub-frame does not have the associated editing control, the relative position of the editing control with respect to the material selecting frame can be kept unchanged.
By displaying, on the first selecting sub-frame within the image editing area, the editing controls moved outside the image editing area in a case where the second selecting sub-frame has the associated editing control, it can be ensured that all editing controls are visible, which is easy to operate. By adding a limitation that the second selecting sub-frame has the associated editing control, unnecessary display control can be avoided and processing resources can be saved.
In an implementation, a limit value can be set for a distance between adjacent editing controls, such as a distance threshold. When the distance between each adjacent editing controls is the distance threshold, in response to the dragging operation of the target material to the outside of the image editing area, the target material, the material selecting frame, and the at least one editing control can be moved along the trajectory of the dragging operation in a preset direction. As illustrated in
As illustrated in
The first side DE is connected to the third vertex E, the second side CF is connected to the fourth vertex F, and the first side is parallel to the second side. The position where the first side overlaps the first selecting sub-frame may be any one position on the line segment AD illustrated in
In some examples, the distance between the third editing control and a target edge of the image editing area and the distance between the fourth editing control and the target edge of the image editing area may be the preset distance, which is not limited in the disclosure. The target edge may be an edge where a point A and a point B in the edge of the image editing area are located. The target edge divides the material selecting frame into two parts, i.e., the first selecting sub-frame and the second selecting sub-frame.
In moving the editing control outside the image editing area, the editing control outside the image editing area is displayed on an edge position of the image editing area, such that the relative position of the editing control is similar to that before it does not move outside the image editing area, which is convenient for the user to operate.
As illustrated in
When the material selecting frame is in the horizontal and vertical state and three vertices are outside the image editing area, the display flexibility of the editing controls can be improved through the differentiated display in a case where two vertices are outside the image editing area.
As illustrated in
The first target vertex is at least one vertex among the four vertices, the second target vertex is a vertex on the second selecting sub-frame, and the second selecting sub-frame is a part of the material selecting frame except the first selecting sub-frame. A direction from the second target vertex to the target position along the material selection frame is clockwise or counterclockwise, as illustrated in
By displaying the editing controls in a clockwise or counterclockwise manner, the display diversity of the editing controls can be improved.
In an implementation, the method may further include, in response to enlarging the target material and the sides of the material selecting frame being all outside the image editing area, displaying the at least one editing control at an edge position of the image editing area. As illustrated in
By flexibly displaying the editing controls when the target material is enlarged, convenient operation of the editing controls can be realized, and visual interference to the target material can be avoided.
The first displaying module 1001 is configured to display an image to be edited, a target material, a material selecting frame, and at least one editing control in an image editing area; in which the at least one editing control is on the material selecting frame and the target material is within the material selecting frame.
The first moving module 1003 is configured to move the target material and the material selecting frame along a trajectory of the dragging operation in response to a dragging operation of the target material.
The second displaying module 1005 is configured to display the at least one editing control in the image editing area, in a case where a part of the material selecting frame is within the image editing area in response to the dragging operation.
In a possible implementation, the second displaying module 1005 includes: a second editing control displaying unit, configured to display the at least one editing control on a first selecting sub-frame, in the case where the part of the material selecting frame is within the image editing area in response to the dragging operation. The first selecting sub-frame is the part of the material selecting frame within the image editing area.
In a possible implementation, the second editing control displaying unit includes a presentation subunit configured to display the at least one editing control on the first selecting sub-frame, in a case where a second selecting sub-frame has an associated editing control; in which the second selecting sub-frame is a part of the material selecting frame outside the image editing area, and the associated editing control is displayed on the second selecting sub-frame in a case where the second selecting sub-frame is within the image editing area.
In a possible implementation, the material selecting frame is rectangular, the material selecting frame includes four vertices, and the at least one editing control includes respective editing controls associated with the four vertices. The first displaying module 1001 includes a first editing control displaying unit configured to display the respective editing controls on the four vertices.
In a possible implementation, the image editing area is rectangular, the first selecting sub-frame includes a first vertex and a second vertex among the four vertices, and the second selecting sub-frame includes a third vertex and a fourth vertex among the four vertices, and a side of the material selecting frame is parallel to an edge of the image editing area. In this case, the second editing control displaying unit includes a first displaying subunit configured to display a first editing control associated with the first vertex at the first vertex, display a second editing control associated with the second vertex at the second vertex; display a third editing control at a position where the first side overlaps the first selecting sub-frame, and display a fourth editing control at a position where a second side overlaps the first selecting sub-frame.
The first side is connected to the third vertex, the second side is connected to the fourth vertex, the first side is parallel to the second side, and the third editing control is associated with the third vertex, and the fourth editing control is associated with the fourth vertex.
In a possible implementation, the image editing area is rectangular, the first selecting sub-frame includes a first vertex among the four vertices, the second selecting sub-frame includes a second vertex, a third vertex, and a fourth vertex among the four vertices, two sides connected with the third vertex are both outside the image editing image, and a side of the material selecting frame is parallel to an edge of the image editing area. In this case, the second editing control displaying unit includes a second displaying subunit configured to display a first editing control associated with the first vertex on the first vertex, display a second editing control at a position where a third side overlaps the first selecting sub-frame, and display a third editing control and a fourth editing control at positions where a fourth side overlaps the first selecting sub-frames.
The third side is between the first vertex and the second vertex; the fourth side is between the first vertex and the fourth vertex; the second editing control is associated with the second vertex, the third editing control is associated with the third vertex, and the fourth editing control is associated with the fourth vertex.
In a possible implementation, the image editing area is rectangular and four sides of the material selecting frame are not parallel to four edges of the image editing area.
In this case, the second editing control displaying unit includes a third displaying subunit configured to display an editing control associated with a first target vertex on the first target vertex of the first selecting sub-frame, and display an editing control associated with a second target vertex at a target position of the first selecting sub-frame other than the first target vertex.
The first target vertex is at least one vertex among four vertices, the second target vertex is a vertex on the second selecting sub-frame, and a direction from the second target vertex to the target position along the material selecting frame is clockwise or counterclockwise.
In a possible implementation, the device further includes: a second moving module, configured to move the target material, the material selecting frame, and the at least one editing control along the trajectory of the dragging operation to the outside of the image editing area, in response to the dragging operation of the target material to the outside of the image editing area in a case where a distance between each two adjacent editing controls is a distance threshold.
In a possible implementation, the device further includes: a third displaying module, configured to display the at least one editing control at an edge position within the image editing area, in response to enlarging the target material and sides of the material selecting frame being outside the image editing area.
In a possible implementation, the device further includes: a fourth displaying module, configured to display the at least one editing control on the material selecting frame, in a case where the material selecting frame is within the image editing area in response to the dragging operation. A relative position of the at least one editing control with respect to the material selecting frame remains unchanged.
In a possible implementation, the second displaying module 1005 includes: a displaying unit, configured to display the at least one editing control within the image editing area, in a case where a part of the material selecting frame is in the image editing area in response to a dragging operation stop instruction.
Regarding the device in the above-mentioned embodiments, the specific manner in which each module performs operations has been described in detail in the method embodiments, and will not be described in detail here.
Those skilled in the art can understand that the structure illustrated in
Those skilled in the art can understand that the structure illustrated in
In an embodiment, there is also provided an electronic device. The electronic device includes a processor; a memory for storing instructions executable by the processor. The processor is configured to execute the instructions to implement a method for displaying material as described above.
In an embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method for displaying material as describe above. The computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
In an embodiment, there is also provided a computer program product having instructions. When executed on a computer, the instructions cause the computer to perform the method for displaying material as described above.
Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above-mentioned method embodiments. Any reference to memory, storage, database or other medium used in the various embodiments of the disclosure may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Other embodiments of the disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure here. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or techniques in the technical field not disclosed by the disclosure. The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
202111152578.5 | Sep 2021 | CN | national |