A method and device for editing pictures

By layering the display and calculating the actual display positions of multiple picture groups on the terminal device, and binding gesture recognition methods for them, the interaction requirements of multiple sets of pictures and screen editing in the prior art are solved, and multiple sets of pictures are realized Full screen drag and drop function and interactive response.

CN113253899BActive Publication Date: 2024-11-19BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202010082895.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-07
Publication Date
2024-11-19
Estimated Expiration
2040-02-07

AI Technical Summary

Technical Problem

In the prior art, only the full-screen drag function of up to one set of pictures can be realized on the screen of the terminal device, and the interaction requirement of multiple sets of pictures and screen editing cannot be supported.

Method used

By layering multiple picture groups on the entire screen, dynamically calculate the actual display position of each picture group in the screen, and bind the gesture recognition method for the target picture group, users can drag and drop each group of pictures in full screen . The specific implementation includes partitioning the current page, nesting collection view controls, calculating the actual display position for each picture group, monitoring gesture operations, determining the ownership of the picture group based on the actual screen coordinates and display positions, and calling the corresponding gesture recognition method to respond to the operation .

Benefits of technology

Implement the full-screen drag and drop editing function of multiple groups of pictures under the same screen, ensuring that the gesture operations of each group are responsive, and page rendering is optimized through partition attributes, reducing the number of bound pictures, and improving interactive complexity processing. ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113253899B_ABST
    Figure CN113253899B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for editing pictures, and relates to the field of computer technology. A specific implementation of the method includes: partitioning the current page, and nesting collection view controls for the obtained multiple partitions respectively; filling multiple pictures into the collection view controls of the multiple partitions respectively, and obtaining corresponding multiple picture groups, so as to respectively calculate the actual display positions of the multiple picture groups on the screen; when monitoring the start of the gesture operation on the current picture, determining the picture group to which the current picture belongs according to the actual screen coordinates and actual display position corresponding to the gesture operation; using the gesture recognition method of at least one gesture bound to the picture of the target picture group, calling the corresponding operation method to respond to the multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends. The method can realize full-screen dragging of each group of pictures in the same screen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a picture editing method and device. Background Art

[0002] The drag-and-drop editing function of the terminal device means that the user can call the system's camera or select photos from the album, and then the thumbnails of the selected photos are presented in sequence in the software interface, and the user is supported to implement complex interactive functions such as sorting and deleting photos by dragging the thumbnails on the screen. Typical examples of using the drag-and-drop editing function of pictures include uploading and editing pictures in WeChat Moments.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] By performing gesture operations on the controls on the screen of the terminal device, only the full-screen dragging function of a maximum of one group of pictures can be realized, and the interactive requirements of editing multiple groups of pictures on the same screen cannot be supported. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a picture editing method and device, which displays multiple picture groups in layers on the entire screen, dynamically calculates the actual display position of each picture group on the screen, and binds a gesture recognition method to the target picture group. When the user performs a gesture operation on the current picture, the gesture recognition method can be used to call the corresponding operation method to achieve full-screen dragging of each group of pictures on the same screen.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for editing a picture is provided.

[0007] A picture editing method according to an embodiment of the present invention comprises: partitioning a current page, and respectively nesting collection view controls for the obtained multiple partitions, wherein the view areas of the multiple collection view controls are all set to the full screen; filling multiple pictures into the collection view controls of the multiple partitions respectively to obtain multiple corresponding picture groups, so as to respectively calculate the actual display positions of the multiple picture groups on the screen; when monitoring the start of a gesture operation on the current picture, determining the picture group to which the current picture belongs according to the actual screen coordinates and the actual display position corresponding to the gesture operation; using a gesture recognition method for setting at least one gesture bound to a picture of the target picture group, calling an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends; wherein the operation method for processing multiple states of the gesture operation is implemented in the gesture recognition method.

[0008] Optionally, the states of the gesture operation include start, moving and end; using a gesture recognition method of at least one gesture bound to a picture of a set target picture group, calling an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, including: determining whether the picture group to which the current picture belongs is the target picture group; if the current picture belongs to the target picture group, using the gesture recognition method bound to the picture of the target picture group, calling its own operation method to respond to the start, moving and end states of the gesture operation in sequence; if the current picture does not belong to the target picture group, using the gesture recognition method bound to the picture of the target picture group, calling an operation method in a gesture recognition method of the picture group to which it belongs to respond to the start, moving and end states of the gesture operation in sequence; wherein the operation method for the start state includes changing the current picture to a draggable state, the operation method for the moving state includes moving the current picture following the position passed by the finger sliding, and the operation method for the end state includes stopping moving the current picture.

[0009] Optionally, the actual display position includes a starting vertical coordinate and an occupied row height; calculating the actual display position of the current picture group on the screen includes: summing the starting vertical coordinate of the previous picture group and the row height occupied by the previous group of pictures to obtain the starting vertical coordinate of the current picture group on the screen; calculating the row height occupied by the current picture group based on the total number of pictures and the number of horizontal pictures in the current picture group.

[0010] Optionally, the actual screen coordinates include an actual screen vertical coordinate; determining the picture group to which the current picture belongs based on the actual screen coordinates corresponding to the gesture operation and the actual display position, including: judging the coordinate interval to which the actual screen vertical coordinate corresponding to the gesture operation belongs; wherein the coordinate interval includes two adjacent starting vertical coordinates, or a starting vertical coordinate and a set initial value of the vertical coordinate; and taking the picture group corresponding to the coordinate interval as the picture group to which the current picture belongs.

[0011] Optionally, partitioning the current page includes: partitioning the current page using a partition property of a table view control.

[0012] Optionally, the method further includes: respectively encapsulating at least one gesture recognition method for the plurality of picture groups.

[0013] Optionally, the target picture group is the topmost picture group among the multiple picture groups.

[0014] To achieve the above objective, according to another aspect of an embodiment of the present invention, a picture editing device is provided.

[0015] A picture editing device according to an embodiment of the present invention comprises: a partition nesting module, used to partition a current page, and respectively nest collection view controls for the obtained multiple partitions, wherein the view areas of the multiple collection view controls are all set to the full screen; a filling calculation module, used to fill multiple pictures into the collection view controls of the multiple partitions respectively, to obtain the corresponding multiple picture groups, so as to respectively calculate the actual display positions of the multiple picture groups on the screen; a monitoring determination module, used to determine the picture group to which the current picture belongs according to the actual screen coordinates and the actual display position corresponding to the gesture operation when monitoring the start of a gesture operation on the current picture; a gesture response module, used to use a gesture recognition method of at least one gesture bound to a picture of a set target picture group, and call an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends; wherein the operation method for processing multiple states of the gesture operation is implemented in the gesture recognition method.

[0016] Optionally, the states of the gesture operation include start, moving and end; the gesture response module is further used to: determine whether the picture group to which the current picture belongs is the target picture group; if the current picture belongs to the target picture group, use the gesture recognition method bound to the picture of the target picture group, and call its own operation method to respond to the start, moving and end states of the gesture operation in sequence; if the current picture does not belong to the target picture group, use the gesture recognition method bound to the picture of the target picture group, and call the operation method in the gesture recognition method of the picture group to which it belongs to respond to the start, moving and end states of the gesture operation in sequence; wherein the operation method for the start state includes changing the current picture to a draggable state, the operation method for the moving state includes moving the current picture following the position passed by the finger sliding, and the operation method for the end state includes stopping moving the current picture.

[0017] Optionally, the actual display position includes a starting vertical coordinate and an occupied row height; the filling calculation module is further used to: sum the starting vertical coordinate of the previous picture group and the row height occupied by the previous group of pictures to obtain the starting vertical coordinate of the current picture group on the screen; calculate the row height occupied by the current picture group based on the total number of pictures and the number of horizontal pictures in the current picture group.

[0018] Optionally, the actual screen coordinates include the actual screen vertical coordinates; the monitoring and determination module is also used to: determine the coordinate interval to which the actual screen vertical coordinate corresponding to the gesture operation belongs; wherein the coordinate interval includes two adjacent starting vertical coordinates, or a starting vertical coordinate and a set initial value of the vertical coordinate; and use the picture group corresponding to the coordinate interval as the picture group to which the current picture belongs.

[0019] Optionally, the partition nesting module is also used to partition the current page using the partition properties of the table view control.

[0020] Optionally, the device further includes: an encapsulation module, configured to encapsulate at least one gesture recognition method for each of the plurality of picture groups.

[0021] Optionally, the target picture group is the topmost picture group among the multiple picture groups.

[0022] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0023] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a picture editing method according to an embodiment of the present invention.

[0024] To achieve the above objective, according to another aspect of the embodiments of the present invention, a computer readable medium is provided.

[0025] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a picture editing method according to an embodiment of the present invention is implemented.

[0026] An embodiment of the above invention has the following advantages or beneficial effects: by displaying multiple picture groups in layers on the entire screen, dynamically calculating the actual display position of each picture group on the screen, binding a gesture recognition method to the target picture group, when the user performs a gesture operation on the current picture, the gesture recognition method can be used to call the corresponding operation method to achieve full-screen dragging of each group of pictures on the same screen; binding the gesture recognition method to the pictures of the target picture group, and then performing different processing based on the judgment result of whether the current picture belongs to the target picture group to ensure that the gesture operation of each picture group can be responded to; determining the starting vertical coordinate of the current picture group by the starting vertical coordinate and row height of the previous picture group, and realizing the arrangement and layout of multiple picture groups on the screen; partitioning the page by partition attributes, and then realizing page rendering of multiple picture groups; by encapsulating the gesture recognition method for each picture group, each partition is realized to respond to the user's gesture operation; taking the top picture group as the target picture group, both ensuring the gesture response to any picture on the screen and reducing the number of bound pictures.

[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0029] Figure 1 is a schematic diagram of the main steps of the picture editing method according to an embodiment of the present invention;

[0030] Figure 2 is a schematic diagram of the main flow of a picture editing method according to an embodiment of the present invention;

[0031] Figure 3 is a diagram illustrating a view structure according to an embodiment of the present invention;

[0032] Figure 4 is a schematic diagram of the principle of calculating the actual display position of each picture group on the screen in an embodiment of the present invention;

[0033] Figure 5 is a schematic diagram of the hierarchical relationship of gesture transmission in an embodiment of the present invention;

[0034] Figure 6 is a schematic diagram of main modules of a picture editing device according to an embodiment of the present invention;

[0035] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0036] Figure 8 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0038] The technical terms used in the embodiments of the present invention are explained below.

[0039] iOS: A mobile operating system developed by Apple Inc. of the United States.

[0040] UICollectionView: A new UI control introduced after iOS6.

[0041] UICollectionCell: It is a sub-control based on UICollectionView and is often used to display pictures.

[0042] Layout, SectionInset: Properties of the UICollectionView control, used to set its position.

[0043] UILongPressGestureRecognizer: iOS system finger long press gesture.

[0044] UIGestureRecognizerState: iOS gesture state.

[0045] Taking iOS system as an example, when editing pictures, the existing technology can only realize the full-screen drag function of at most one group of pictures through gesture operation of UICollectionView control in iOS system. There may be complex controls such as titles and descriptions between each group of pictures. It is not possible to simply add intervals to a group of pictures to achieve visual grouping. In this case, it is necessary to use Section attribute to achieve it.

[0046] The reason why dragging pictures in iOS system controls is limited is that the UICollectionCell control can only be moved within the Frame set by its parent UICollectionView control. Restricted by the operation mode of this iPhone system control, the corresponding UICollectionCell represents a picture, and its moving area, that is, the Frame of UICollectionView, can only fill one visible screen at most. It cannot support today's more complex interactive needs of editing multiple groups of pictures on the same screen. For example, in a shopping cart or order, due to a certain grouping method, such as different delivery addresses or different discount methods, multiple groups of item pictures need to be displayed and edited on the same screen for interactive needs.

[0047] In order to solve the above problems in the prior art, the present invention provides a new picture editing method, which realizes the function of full-screen drag and drop editing of multiple groups of pictures on the same screen of a terminal device (such as an iPhone), and the specific implementation is as follows.

[0048] Figure 1 Schematic diagram of the main steps of the picture editing method according to an embodiment of the present invention. Figure 1 As shown, the picture editing method of the embodiment of the present invention mainly includes the following steps:

[0049] Step S101: partition the current page, and nest collection view controls for each of the obtained multiple partitions. Use the partition property of the table view control to partition the current page. Then nest a collection view control for each partition, that is, add a collection view control to each partition, and set the view area of ​​each collection view control to full screen, so that each collection view control fills the entire screen.

[0050] Step S102: Fill multiple pictures into the collection view controls of the multiple partitions of the current page respectively, and obtain corresponding multiple picture groups, so as to calculate the actual display positions of the multiple picture groups in the screen respectively. Fill multiple pictures into the multiple partitions of the current page respectively, and obtain multiple picture groups, each picture group corresponds to a collection view control. Then dynamically calculate the actual display positions of the multiple picture groups in the screen. The calculation principle is: save the starting vertical coordinate of the previous picture group and the occupied row height to calculate the starting vertical coordinate of the current picture group, and so on, to realize the arrangement and layout of multiple picture groups on the same screen.

[0051] Step S103: When the start of a gesture operation on the current picture is detected, the picture group to which the current picture belongs is determined according to the actual screen coordinates corresponding to the gesture operation and the actual display position. When the user starts performing a gesture operation on the current picture on the screen, such as clicking or long pressing, the actual screen coordinates corresponding to the gesture operation are calculated, and then the picture group to which the current picture belongs is determined according to the actual screen coordinates and the actual display positions of multiple picture groups on the screen.

[0052] Step S104: Use a gesture recognition method for at least one gesture bound to a picture of a set target picture group, and call an operation method implemented for the picture group to which it belongs to respond to the various states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends. Among them, the target picture group must include the top picture group of multiple picture groups. A gesture recognition method for at least one gesture bound to a picture of the target picture group is preliminarily implemented in the gesture recognition method. The states of the gesture operation include start, moving and end. Other picture groups are picture groups other than the picture group to which the current picture belongs.

[0053] Determine whether the picture group to which the current picture belongs is the top picture group. If so, directly use the gesture recognition method bound to the picture of the target picture group, call its own operation method to respond to the start, moving and end states of the user's gesture operation in sequence, so as to drag the current picture to other positions on the screen with the user's gesture operation. If not, use the gesture recognition method bound to the picture of the target picture group, call the operation method in the gesture recognition method corresponding to the picture group to which it belongs, to respond to the start, moving and end states of the user's gesture operation in sequence, so as to drag the current picture to other positions on the screen with the user's gesture operation.

[0054] Figure 2 FIG. 1 is a schematic diagram of the main flow of the picture editing method according to an embodiment of the present invention. Figure 2As shown, the picture editing method of the embodiment of the present invention mainly includes the following steps:

[0055] Step S201: partition the current page and fill multiple pictures into multiple partitions. The table view control (UITableView) provides rendering support at the bottom layer of the terminal device view, and the current page is partitioned using the Section property of UITableView. When implementing it specifically, the specific logic can be implemented in the proxy method of the UITableView control. In the embodiment, the proxy method of UITableView for Section partitioning can be:

[0056] -(NSInteger)tableView:(UITableView*)tableView numberOfRowsI nSection:(NSInteger)section;

[0057] After partitioning the current page, you can divide multiple groups of pictures based on the partitions. In an embodiment, pictures can be grouped according to the attributes, types, and business differences of the pictures. For example, pictures are grouped according to the delivery address or different discount methods. Each group of editable pictures corresponds to a set of collection view controls (UICollectionView) and is filled in each Section. At the same time, in order to enable each group of pictures to move full screen, the view area of ​​each UICollectionView needs to be set to full screen.

[0058] Figure 3 1 is a diagram illustrating a view structure according to an embodiment of the present invention. Figure 3 As shown, the view structure of the embodiment of the present invention includes: window (UIWindow), UITableView, Sectio n, UICollectionView1-3, and long press gesture (UILongPressGestureRecognizer). Among them, 3 Sections are set under a UITableView, each Section corresponds to a group of UI CollectionView, and various gestures can be used to operate each group of UICollectionView, such as UILongPressGestureRecognizer. The view area of ​​each UICollectionView is set to full screen, and the background is transparent, so that the 3 UICollectionViews are layered and superimposed and displayed on the screen. The monitoring function of step S205 is implemented by UILongPressGestureRecognizer.

[0059] Step S202: respectively calculating the actual display positions of multiple picture groups on the screen, wherein a picture group includes pictures belonging to the same partition, and dynamically calculating the actual display position of each picture group on the screen.

[0060] Figure 4 Schematic diagram of the principle of calculating the actual display position of each picture group on the screen in an embodiment of the present invention. Figure 4 As shown in the figure, there are three groups of pictures that can be dragged and edited by users: square pictures, long pictures, and transparent pictures. The three picture groups are layered and displayed on the screen, with the square pictures on the top layer, the long pictures in the middle layer, and the transparent pictures at the bottom layer. Taking the square picture group as an example, the starting vertical coordinate is the coordinate value of the top end of the square picture control (i.e. Figure 4 The row height is the distance from the top of the square control to the top of the rectangle control (i.e. Figure 4 The starting ordinate of the current picture group is calculated as follows:

[0061] The starting ordinate of the current picture group = the starting ordinate of the previous picture group + the row height

[0062] Formula 1

[0063] In the formula, since the number of horizontal pictures in each picture group is fixed, such as Figure 4 As shown in the figure, the row height can be dynamically calculated based on the total number of pictures in the current picture group, the number of horizontal pictures, the picture height, the interval between two rows of pictures, and the distance between the top / bottom of the picture and the section header. The row height includes the section header height (i.e., the height of the three controls: square picture, long picture, and transparent picture). The section header height is known and can be set through the sectionHeaderHeight property.

[0064] Step S203: Encapsulate at least one gesture recognition method for multiple image groups respectively, and implement at least one operation method for different states of gestures in the gesture recognition method. After completing page rendering through steps S201 and S202, the gesture response events of each partition must be processed separately. The processing here can be to calculate the image group to which the image belongs. The gesture response event is completed through gesture operations, including click, double-click, translation, long press, etc. The embodiment of the present invention is mainly for the UILongPressGestureRecognizer long press gesture.

[0065] Encapsulate each gesture recognition method into the current class for subsequent calls. In the gesture recognition method, the logical processing of several states of the gesture (i.e., the operation method) must be implemented. These states include the state management of the life cycle of several common gesture operations such as when the finger presses and holds the image to select it (i.e., start), when the finger drags the image to slide on the screen (i.e., move / change), and when the finger is released (i.e., end). The gesture state management class is UIGestureRecognizerSt ate, which is an enumeration type that defines all states related to gesture recognition. These states include: not started, started, changed, ended, and cannot be recognized.

[0066] The corresponding operation method of long pressing the image with a finger to select it can be to enlarge the image and make it draggable. The corresponding operation method of dragging the image with a finger to slide on the screen can be to move the image along the position where the finger slides. The corresponding operation method of releasing the finger can be to stop moving the image.

[0067] Step S204: Bind the gesture recognition method of the target picture group to the pictures of the target picture group. In the embodiment, the target picture group is the topmost picture group among the picture groups (e.g. Figure 4 The top square picture group in the image view (the top square picture group) will not respond to user gestures if bound to other views. That is to say, even if the square picture, long picture, and transparent picture are bound to their own gesture recognition methods, the lower views (i.e., long pictures and transparent pictures) will not respond to their own gesture recognition methods. This is due to the limitations of the iOS system. The event of a finger touching the screen will be intercepted first by the method that the top layer can respond to, and cannot be passed on all the time. Therefore, this embodiment only binds the gesture recognition method to the top picture group, and the other two layers use the internal logic of this method to determine which picture group's gesture recognition method should be actively called. In the embodiment, a gesture and a view can be bound through the -(CGPoint)locationInView:(nullable UIView*)view method of the gesture class.

[0068] After completing the encapsulation of the gesture recognition methods corresponding to the gesture response events of each picture group, it is not necessary to bind all of them to their respective pictures. Due to the hierarchical relationship of iOS view rendering and gesture transmission, it is only necessary to bind the gesture recognition method to the picture of the target picture group. For other gesture responses, after the finger touches the screen, according to the actual screen coordinates of the finger touch, calculate which picture group the gesture response event belongs to, and the gesture recognition method of the target picture group can actively trigger the call of the corresponding operation method.

[0069] Figure 5 Schematic diagram of the gesture transmission hierarchy in an embodiment of the present invention. Figure 5As shown, the transmission method is from bottom to top, and the event processing flow is: generate a touch event → add the event to the UIApplication queue → pass the event to the main window → find the most suitable View → the most suitable View calls its own touch method to handle the event → touches The default approach is to pass the event up the response chain.

[0070] Step S205: When the gesture operation on the current picture is detected, the picture group to which the current picture belongs is determined according to the actual screen coordinates and actual display position corresponding to the gesture operation. When the user is detected to start performing a gesture operation on the current picture on the screen, such as clicking, long pressing, etc., it is necessary to determine the picture group to which the current picture belongs. The specific calculation process is: determine the coordinate interval to which the actual screen vertical coordinate corresponding to the gesture operation belongs; wherein the coordinate interval includes two adjacent starting vertical coordinates, or a starting vertical coordinate and a set initial value of the vertical coordinate; and use the picture group corresponding to the coordinate interval as the picture group to which the current picture belongs.

[0071] For example, assuming that the initial ordinate of the square picture group is 20, the initial ordinate of the long picture group is 10, the initial ordinate of the transparent picture group is 5, the initial ordinate value is 0, and the actual screen ordinate corresponding to the gesture operation is 15. The above initial ordinates and the initial ordinate values ​​constitute three coordinate intervals: (0, 5], (5, 10], (10, 20]. 15∈(10, 20], so the current picture belongs to the square picture group.

[0072] Step S206: Determine whether the picture group to which the current picture belongs is the target picture group, if yes, execute step S207; if no, execute step S208.

[0073] Step S207: Use the gesture recognition method bound to the image of the target image group to call its own operation method to respond to the various states of the gesture operation, so that when the gesture operation ends, the current image is dragged to any target position on the screen to end this process. In this embodiment, the arbitrary target position can be other image groups, other screen positions of the image group to which it belongs (corresponding to the image sorting function of this image group), the area where the delete function is located, etc.

[0074] If the current image belongs to the target image group, the gesture recognition method bound to the image in the target image group is used to call the operation method implemented by it to respond to the different states of the gesture operation. Specifically, when the gesture operation is detected as the start state, the operation method called can enlarge the current image and change it to a draggable state; when the gesture operation is detected as the moving state, the operation method called can move the current image following the position where the finger slides; when the gesture operation is detected as the end state, the operation method called can stop moving the current image, and the current image can be moved to the target position.

[0075] Step S208: Using the gesture recognition method bound to the image of the target image group, call the operation method in the gesture recognition method of the image group to which it belongs to respond to various states of gesture operation, so that when the gesture operation ends, the current image is dragged to any target position on the screen to end this process. Using the gesture recognition method bound to the image of the target image group, call the operation method in the gesture recognition method of the image group to which the current image belongs to respond to different states of gesture operation.

[0076] For example, if you need to drag the first picture of the long picture group to the square picture group, you can use the gesture recognition method bound to the picture of the square picture group, and call the operation method in the gesture recognition method of the long picture group to respond to the start state, moving state, and end state of the user's gesture operation in sequence. Specifically, when the gesture operation starts, the first picture is enlarged and changed to a draggable state; when the gesture operation is detected to be in a moving state, the first picture is moved following the position where the finger slides; when the gesture operation ends, the first picture is stopped from moving, and the first picture can be dragged to the square picture group to realize the picture dragging.

[0077] It can be seen from the picture editing method of the embodiment of the present invention that by displaying multiple picture groups in layers on the entire screen, the actual display position of each picture group on the screen is dynamically calculated, and a gesture recognition method is bound to the target picture group. When the user performs a gesture operation on the current picture, the gesture recognition method can be used to call the corresponding operation method to realize full-screen dragging of each group of pictures on the same screen; the gesture recognition method is bound to the picture of the target picture group, and then different processing is performed based on the judgment result of whether the current picture belongs to the target picture group to ensure that the gesture operation of each picture group can be responded to; the starting vertical coordinate of the current picture group is determined by the starting vertical coordinate and the row height of the previous picture group, so as to realize the arrangement and layout of multiple picture groups on the screen; the page is partitioned by the partition attribute, so as to realize the page rendering of multiple picture groups; by encapsulating the gesture recognition method for each picture group, the response of each partition to the user's gesture operation is realized; the top picture group is used as the target picture group, which not only ensures the gesture response to any picture on the screen, but also reduces the number of bound pictures.

[0078] Figure 6 Schematic diagram of the main modules of the picture editing device according to an embodiment of the present invention. Figure 6 As shown, the picture editing device 600 of the embodiment of the present invention mainly includes:

[0079] The partition nesting module 601 is used to partition the current page and nest collection view controls for the obtained multiple partitions. The partition property of the table view control is used to partition the current page. Then, a collection view control is nested for each partition, that is, a collection view control is added to each partition, and the view area of ​​each collection view control is set to full screen, so that each collection view control fills the entire screen.

[0080] Fill calculation module 602 is used to fill multiple pictures into the collection view controls of the multiple partitions of the current page respectively, and obtain the corresponding multiple picture groups, so as to calculate the actual display positions of the multiple picture groups in the screen respectively. Fill multiple pictures into the multiple partitions of the current page respectively to obtain multiple picture groups, each picture group corresponds to a collection view control. Then the actual display positions of the multiple picture groups in the screen are dynamically calculated. The calculation principle is: save the starting vertical coordinate of the previous picture group and the occupied row height to calculate the starting vertical coordinate of the current picture group, and so on, to realize the arrangement and layout of multiple picture groups on the same screen.

[0081] The monitoring determination module 603 is used to determine the picture group to which the current picture belongs according to the actual screen coordinates and the actual display position corresponding to the gesture operation when the gesture operation starts to be monitored on the current picture. When it is monitored that the user starts to perform a gesture operation on the current picture on the screen, such as clicking, long pressing, etc., the actual screen coordinates corresponding to the gesture operation are calculated, and then the picture group to which the current picture belongs is determined according to the actual screen coordinates and the actual display positions of multiple picture groups on the screen.

[0082] The gesture response module 604 is used to use the gesture recognition method of at least one gesture bound to the picture of the set target picture group, call the operation method implemented for the picture group to which it belongs to respond to the multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends. The target picture group needs to include the top picture group among the multiple picture groups.

[0083] A gesture recognition method for pre-binding at least one gesture to pictures in a target picture group, wherein the gesture recognition method implements an operation method for processing multiple states of gesture operations, wherein the states of gesture operations include start, moving, and end, and other picture groups are picture groups other than the picture group to which the current picture belongs.

[0084] Determine whether the picture group to which the current picture belongs is the top picture group. If so, directly use the gesture recognition method bound to the picture of the target picture group, call its own operation method to respond to the start, moving and end states of the user's gesture operation in sequence, so as to drag the current picture to other positions on the screen with the user's gesture operation. If not, use the gesture recognition method bound to the picture of the target picture group, call the operation method in the gesture recognition method corresponding to the picture group to which it belongs, to respond to the start, moving and end states of the user's gesture operation in sequence, so as to drag the current picture to other positions on the screen with the user's gesture operation.

[0085] In addition, the picture editing device 600 of the embodiment of the present invention may further include: a packaging module ( Figure 6 The encapsulation module is used to encapsulate at least one gesture recognition method for each of the plurality of picture groups.

[0086] From the above description, it can be seen that by overlaying multiple picture groups on the entire screen, the actual display position of each picture group on the screen is dynamically calculated, and a gesture recognition method is bound to the target picture group. When the user performs a gesture operation on the current picture, the gesture recognition method can be used to call the corresponding operation method to achieve full-screen dragging of each group of pictures on the same screen.

[0087] Figure 7An exemplary system architecture 700 is shown to which the picture editing method or the picture editing device according to the embodiment of the present invention can be applied.

[0088] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0089] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0090] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0091] The server 705 may be a server that provides various services, such as a background management server that an administrator processes gesture operations sent by the terminal devices 701, 702, and 703. The background management server may determine the picture group to which the current picture belongs, perform corresponding response processing using the gesture recognition method bound to the picture of the target picture group, and feed back the processing result (such as the result after picture editing) to the terminal device.

[0092] It should be noted that the picture editing method provided in the embodiment of the present application is generally executed by the server 705, and accordingly, the picture editing device is generally set in the server 705.

[0093] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0094] According to an embodiment of the present invention, the present invention also provides an electronic device and a computer-readable medium.

[0095] The electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a picture editing method of an embodiment of the present invention.

[0096] The computer-readable medium of the present invention stores a computer program thereon, and when the program is executed by a processor, a picture editing method of an embodiment of the present invention is implemented.

[0097] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 suitable for implementing an electronic device of an embodiment of the present invention. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0098] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the computer system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0099] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0100] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0101] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0103] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor, for example, may be described as: a processor including a partition nesting module, a filling calculation module, a monitoring determination module, and a gesture response module. Among them, the names of these modules do not constitute a limitation on the modules themselves in certain cases. For example, the filling calculation module may also be described as "a module for filling a plurality of pictures into the collection view controls of the plurality of partitions respectively, obtaining a corresponding plurality of picture groups, and respectively calculating the actual display positions of the plurality of picture groups on the screen".

[0104] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: partitioning the current page, nesting collection view controls for the obtained multiple partitions, wherein the view areas of the multiple collection view controls are all set to full screen; filling multiple pictures into the collection view controls of the multiple partitions respectively, obtaining corresponding multiple picture groups, and respectively calculating the actual display positions of the multiple picture groups on the screen; when monitoring the start of a gesture operation on the current picture, determining the picture group to which the current picture belongs according to the actual screen coordinates and the actual display position corresponding to the gesture operation; using a gesture recognition method of at least one gesture bound to the picture of the set target picture group, calling an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, so that when the gesture operation ends, the current picture is dragged to any position on the screen; wherein the gesture recognition method implements an operation method for processing multiple states of the gesture operation.

[0105] From the above description, it can be seen that by overlaying multiple picture groups on the entire screen, the actual display position of each picture group on the screen is dynamically calculated, and a gesture recognition method is bound to the target picture group. When the user performs a gesture operation on the current picture, the gesture recognition method can be used to call the corresponding operation method to achieve full-screen dragging of each group of pictures on the same screen.

[0106] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.

[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for editing a picture, characterized in that: include: Partitioning the current page, and nesting collection view controls for the obtained multiple partitions, wherein the view areas of the multiple collection view controls are all set to be full screen; Filling the plurality of pictures into the collection view controls of the plurality of partitions respectively, to obtain the corresponding plurality of picture groups, and respectively calculating the actual display positions of the plurality of picture groups on the screen; When a gesture operation on the current picture starts being monitored, determining the picture group to which the current picture belongs according to the actual screen coordinates corresponding to the gesture operation and the actual display position; A gesture recognition method for at least one gesture bound to a picture of a set target picture group is used, and an operation method implemented for the picture group to which it belongs is called to respond to multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends; wherein an operation method for processing multiple states of the gesture operation is implemented in the gesture recognition method.

2. The method according to claim 1, characterized in that The states of the gesture operation include start, moving and end; Using a gesture recognition method of at least one gesture bound to a picture of a set target picture group, calling an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, including: Determine whether the picture group to which the current picture belongs is the target picture group; If the current picture belongs to the target picture group, the gesture recognition method bound to the picture of the target picture group is used to call its own operation method to respond to the start, moving and end states of the gesture operation in sequence; If the current picture does not belong to the target picture group, the gesture recognition method bound to the picture of the target picture group is used to call the operation method in the gesture recognition method of the picture group to which it belongs to respond to the start, moving and end states of the gesture operation in sequence; Among them, the operation method of the starting state includes changing the current picture to a draggable state, the operation method of the moving state includes moving the current picture following the position passed by the finger sliding, and the operation method of the ending state includes stopping moving the current picture.

3. The method according to claim 1, characterized in that The actual display position includes the starting ordinate and the occupied row height; Calculate the actual display position of the current picture group on the screen, including: Sum the starting vertical coordinate of the previous picture group and the row height occupied by the previous picture group to obtain the starting vertical coordinate of the current picture group on the screen; The row height occupied by the current picture group is calculated according to the total number of pictures and the number of horizontal pictures in the current picture group.

4. The method according to claim 3, characterized in that The actual screen coordinates include the actual screen ordinate; Determining the picture group to which the current picture belongs according to the actual screen coordinates corresponding to the gesture operation and the actual display position, includes: Determine the coordinate interval to which the actual screen vertical coordinate corresponding to the gesture operation belongs; wherein the coordinate interval includes two adjacent starting vertical coordinates, or a starting vertical coordinate and a set initial value of the vertical coordinate; The picture group corresponding to the coordinate interval is used as the picture group to which the current picture belongs.

5. The method according to claim 1, characterized in that Partitioning the current page includes: Use the partition property of the table view control to partition the current page.

6. The method according to claim 1, characterized in that The method further comprises: A gesture recognition method for encapsulating at least one gesture is provided for each of the plurality of picture groups.

7. The method according to any one of claims 1 to 6, characterized in that: The target picture group is the topmost picture group among the multiple picture groups.

8. A picture editing device, characterized in that: include: A partition nesting module, used to partition the current page, and respectively nest collection view controls for the obtained multiple partitions, wherein the view areas of the multiple collection view controls are all set to full screen; A filling calculation module, used to fill multiple pictures into the collection view controls of the multiple partitions respectively, to obtain multiple corresponding picture groups, so as to respectively calculate the actual display positions of the multiple picture groups on the screen; A monitoring and determining module, configured to determine the picture group to which the current picture belongs according to the actual screen coordinates corresponding to the gesture operation and the actual display position when monitoring the start of the gesture operation on the current picture; A gesture response module, which is used to use a gesture recognition method of at least one gesture bound to a picture of a set target picture group, and call an operation method implemented for the picture group to which it belongs to respond to multiple states of the gesture operation, so as to drag the current picture to any position on the screen when the gesture operation ends; wherein the operation method for processing multiple states of the gesture operation is implemented in the gesture recognition method.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and graphical interface for withdrawing by dragging-and-zooming graphics on automatic teller machine (ATM)

    CN103021083A

  • Hybrid mobile interactions for native apps and web apps

    CN104115106A

  • Operation method for split-screen display and electronic device

    CN105389111A

  • Method and apparatus for adjusting sequence of calendar pictures, and computer readable storage medium

    CN106998391A

  • Page sliding method and device, electronic equipment and storage medium

    CN110658974A