CN112379817A - Primitive transformation method and device, terminal equipment and computer readable storage medium - Google Patents

Primitive transformation method and device, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN112379817A
CN112379817A CN202110039588.1A CN202110039588A CN112379817A CN 112379817 A CN112379817 A CN 112379817A CN 202110039588 A CN202110039588 A CN 202110039588A CN 112379817 A CN112379817 A CN 112379817A
Authority
CN
China
Prior art keywords
primitive
target
boundary
display area
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110039588.1A
Other languages
Chinese (zh)
Inventor
李政军
陈娅芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan New Cloudnet Technology Co ltd
Original Assignee
Hunan New Cloudnet Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan New Cloudnet Technology Co ltd filed Critical Hunan New Cloudnet Technology Co ltd
Priority to CN202110039588.1A priority Critical patent/CN112379817A/en
Publication of CN112379817A publication Critical patent/CN112379817A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/048Indexing scheme relating to G06F3/048
    • G06F2203/04806Zoom, i.e. interaction techniques or interactors for controlling the zooming operation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application is applicable to the technical field of primitive processing, and provides a primitive transformation method, a device, terminal equipment and a computer readable storage medium, wherein the method comprises the following steps: displaying a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries; acquiring a first input aiming at a primitive, transforming the primitive according to input parameters included by the first input, determining a first target boundary from a plurality of first initial boundaries, and determining a second target boundary from a plurality of second initial boundaries; and under the condition that the first target boundary and the second target boundary are overlapped, finishing the transformation of the primitive. The application also provides a primitive transformation device, terminal equipment and a computer readable storage medium. According to the method and the device, the boundary of the primitive and the display area is limited, so that the primitive can be displayed in the target display area to the maximum extent when being changed, the waste of the display area is avoided, and the effect of primitive change is better.

Description

Primitive transformation method and device, terminal equipment and computer readable storage medium
Technical Field
The present application belongs to the technical field of primitive processing, and in particular, to a primitive transformation method, apparatus, terminal device, and computer-readable storage medium.
Background
As is well known, when a user opens a primitive in a display area, dragging, rotating, zooming, etc. may be required to be performed on the primitive in order to obtain various types of information in a picture. In the prior art, when a user drags, rotates, zooms, or the like a primitive, there may be a plurality of situations, for example, when the size of the primitive is significantly larger than a display area, a boundary of the primitive is outside the display area, and when dragging or otherwise operating the primitive, the primitive is dragged into the display area, which causes waste of the display area. For another example, when the primitive is entirely located within the display area, when the primitive is dragged or otherwise operated, the primitive may be moved out of the display area, which may also cause a waste of the display area.
Disclosure of Invention
The application provides a primitive transformation method, a primitive transformation device, terminal equipment and a computer readable storage medium, which are used for solving the technical problems of waste of a display area and poor primitive transformation effect in the prior art.
In a first aspect, the present application provides a primitive transformation method, including:
displaying a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries;
acquiring a first input aiming at the graphic primitive, transforming the graphic primitive according to input parameters included by the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries;
under the condition that the first target boundary and the second target boundary are overlapped, finishing the transformation of the graphic primitive;
in the case where the primitive portion is displayed within the target display area, and the input parameter comprises a direction of movement,
the transforming the primitive according to the input parameters included in the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries, includes:
moving the primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, and determining a second initial boundary of the primitive opposite to the moving direction as a second target boundary, wherein the second target boundary is positioned outside the target display area;
or, in the case that the primitive is entirely located in the target display area and the input parameter includes a moving direction,
the transforming the primitive according to the input parameters included in the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries, includes:
and moving the primitive according to the moving direction, determining a first initial boundary of the target display area, which is consistent with the moving direction, as a first target boundary, and determining a second initial boundary of the primitive, which is consistent with the moving direction, as a second target boundary, wherein the second target boundary is located in the target display area.
Further, said ending the transformation of the primitive in the case of coincidence between the first object boundary and the second object boundary comprises:
ending the movement of the primitive in the movement direction.
Further, in case the input parameters further comprise a zoom factor,
after finishing the movement of the primitive in the moving direction, the method further includes:
zooming the graphic primitive according to the zooming times, determining all first initial boundaries of the target display area as first target boundaries, and determining all second initial boundaries of the graphic primitive as second target boundaries;
and under the condition that any mutually opposite first target boundary and second target boundary are overlapped, finishing the scaling of the primitive.
Further, in case the input parameters also include a direction of rotation,
after finishing the movement of the primitive in the moving direction, the method further includes:
rotating the primitive according to the rotation direction, zooming according to a preset zoom multiple after the primitive is rotated, determining all first initial boundaries of the target display area as first target boundaries, and determining all second initial boundaries of the primitive as second target boundaries;
and under the condition that any mutually opposite first target boundary and second target boundary are overlapped, finishing the scaling of the primitive.
Further, the target display area is all or part of the display area of the display screen.
In a second aspect, the present application further provides a primitive transforming apparatus, including:
a display module for displaying a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries;
a transformation determining module, configured to obtain a first input for the primitive, transform the primitive according to input parameters included in the first input, determine a first target boundary from the first initial boundaries, and determine a second target boundary from the second initial boundaries;
a transformation ending module, configured to end transformation of the primitive when there is coincidence between the first target boundary and the second target boundary;
in the case where the primitive portion is displayed within the target display area, and the input parameter comprises a direction of movement,
a transformation determining module specifically configured to:
moving the primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, and determining a second initial boundary of the primitive opposite to the moving direction as a second target boundary, wherein the second target boundary is positioned outside the target display area;
or, in the case that the primitive is entirely located in the target display area and the input parameter includes a moving direction,
a transformation determining module specifically configured to:
and moving the primitive according to the moving direction, determining a first initial boundary of the target display area, which is consistent with the moving direction, as a first target boundary, and determining a second initial boundary of the primitive, which is consistent with the moving direction, as a second target boundary, wherein the second target boundary is located in the target display area.
In a third aspect, the present application further provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the above-mentioned primitive transformation method when executing the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium comprising: a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method of primitive transformation.
It is understood that the beneficial effects of the second to fourth aspects can be seen from the description of the first aspect, and are not described herein again.
Compared with the prior art, the application has the beneficial effects that:
displaying the graphic primitive in the target display area, and transforming the graphic primitive according to the first input parameter; determining a first target boundary from a plurality of first initial boundaries of a target display area, and determining a second target boundary from a plurality of second initial boundaries of a display primitive; and under the condition that the first target boundary and the second target boundary are overlapped, finishing the transformation of the primitive. The graphics primitives can be displayed in the target display area to the maximum extent when being changed, waste of the display area is avoided, and the graphics primitive changing effect is better.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a primitive transformation method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a primitive transformation method according to a second embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a primitive transformation method according to a third embodiment of the present application;
fig. 4 is a schematic flowchart of a primitive transformation method according to a fourth embodiment of the present application;
fig. 5 is a schematic flowchart of a primitive transformation method according to a fifth embodiment of the present application;
fig. 6 is a schematic flowchart of a primitive transformation method according to a sixth embodiment of the present application;
fig. 7 is a schematic flowchart of a primitive transformation method according to a seventh embodiment of the present application;
FIG. 8 is a diagram of a primitive transformation apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Referring to fig. 1, a schematic flow chart of a primitive transformation method provided in an embodiment of the present application is shown, where the method includes:
step S11, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
in the embodiment of the application, the primitive is firstly opened in the target display area, so that the content of the primitive is displayed in the target display area. The target display area includes a plurality of first initial boundaries and the graphical element includes a plurality of second initial boundaries.
In a possible implementation manner of the embodiment of the application, after the primitive is opened, the size of the primitive exceeds the target display area, and at least one second initial boundary is outside the target display area. In another possible implementation manner, the primitive size is smaller than the target display area, and the whole primitive is located in the target display area, and the plurality of second initial boundaries are all located in the target display area.
In the embodiments of the present application, the shapes of the target display area and the primitive are used as rectangles for example, and it should be understood that the shapes of the target display area and the primitive are rectangles only for convenience of description and understanding, and are not limited, and the target display area and the primitive may be any shapes.
Step S12, acquiring a first input aiming at the graphic primitive, transforming the graphic primitive according to the input parameters included in the first input, determining a first target boundary from a plurality of first initial boundaries, and determining a second target boundary from a plurality of second initial boundaries;
in the embodiment of the present application, for a dragging input of a primitive, or click data of a control for controlling a primitive to be scaled or selected, a primitive is shifted, scaled, or rotated according to an input parameter including, but not limited to, a moving direction, a scaling multiple, or a rotating direction. At this time, a first target boundary is determined from the plurality of first initial boundaries according to the actual situation, and a second target boundary is determined from the plurality of second initial boundaries.
For example, the primitive receives the move command, and moves according to the move direction, and if the second initial boundaries are all located within the target display area at this time, the move direction is moving upward. A first initial boundary above the target display area is determined as a first target boundary and a second initial boundary above the graphical element is determined as a second target boundary. And when the moving direction is downward, determining a first initial boundary below the target display area as a first target boundary, and determining a second initial boundary below the graphic element as a second target boundary. And in the process of converting the moving graphic element, the second target boundary can be overlapped with or separated from the first target boundary.
In step S13, when there is coincidence between the first object boundary and the second object boundary, the conversion of the primitive is terminated.
In this embodiment of the present application, or in a case where the second target boundary collides with the first target boundary, that is, the first target boundary and the second target boundary coincide with each other, the transformation of the primitive is ended. For example, when the primitive is entirely located in the target display area and moves upward, the movement of the primitive is ended when the second initial boundary above the primitive coincides with the first initial boundary of the target display area. The graphics primitives can not move upwards continuously, so that part of the graphics primitive contents move out of the target display area, and the waste of the display area is avoided.
The primitive transformation method provided by the embodiment of the application displays the primitive in the target display area, and transforms the primitive according to the first input parameter; determining a first target boundary from a plurality of first initial boundaries of a target display area, and determining a second target boundary from a plurality of second initial boundaries of a display primitive; and under the condition that the first target boundary and the second target boundary are overlapped, finishing the transformation of the primitive. The graphics primitives can be displayed in the target display area to the maximum extent when being changed, waste of the display area is avoided, and the graphics primitive changing effect is better.
When intersection coordinate information exists between the second target coordinate set and the first target coordinate set, the situation that the first target boundary and the second target boundary are overlapped is described.
In an example, the target display area may be a display area of the entire display screen, or a part of the display area may be selected as the target display area in the display screen.
Referring to fig. 2, a flowchart of a primitive transformation method provided in a second embodiment of the present disclosure is shown, in which a primitive portion is displayed in a target display area and an input parameter includes a moving direction, and the primitive transformation method includes:
step S21, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S22, moving the graphics primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, determining a second initial boundary of the graphics primitive opposite to the moving direction as a second target boundary, and the second target boundary is located outside the target display area;
in step S23, when there is coincidence between the first object boundary and the second object boundary, the conversion of the primitive is terminated.
Step S21 is the same as step S11, and step S23 is the same as step S13, which are not repeated herein. The difference from the first embodiment is that step S22 is detailed as follows:
and opening the graphics primitives in the target display area, and when the size of the graphics primitives is larger than the target display area, namely part of the graphics primitives is displayed in the target display area, and the other part of the graphics primitives is positioned outside the target display area. At this time, only partial primitive information can be displayed, and the primitive can be dragged to move in order to obtain the primitive information outside the target display area.
For example, when the right side of the primitive is outside the target display region, the primitive needs to be moved to the left to display the content of the primitive on the right side. At this time, a first initial boundary of the target display area opposite to the moving direction is determined as a first target boundary, a second initial boundary of the graphics primitive opposite to the moving direction is determined as a second target boundary, and the second target boundary is located outside the target display area. The direction of movement is to the left, i.e. the boundary to the right of the target display area is determined as the first target boundary and the rightmost boundary where the icon is outside the target display area is determined as the second target boundary.
And moving the primitive leftwards, and stopping moving the primitive leftwards continuously under the condition that the second target boundary of the primitive is overlapped with the first target boundary. At this time, if the upper and lower sides or the left side of the primitive is outside the target display area, the primitive may be moved downward, upward or rightward according to the same operation.
The size of the primitive exceeds the target display area, the content exceeding the display part can be dragged and checked, the boundary of the primitive is limited to be dragged into the target display area, the primitive is prevented from exceeding the display part by dragging, the part needing to be displayed is displayed as far as possible to the maximum, and the primitive is displayed in the target display area to the maximum.
Referring to fig. 3, which is a schematic flow chart of a primitive transformation method provided in a third embodiment of the present application, in this embodiment, a whole primitive is located in a target display area, and an input parameter includes a moving direction, and the primitive transformation method includes:
step S31, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S32, moving the graphics primitive according to the moving direction, determining a first initial boundary of the target display area consistent with the moving direction as a first target boundary, determining a second initial boundary of the graphics primitive consistent with the moving direction as a second target boundary, and the second target boundary is located in the target display area;
in step S33, when there is coincidence between the first object boundary and the second object boundary, the conversion of the primitive is terminated.
Step S31 is the same as step S11, and step S33 is the same as step S13, which are not repeated herein. The difference from the first embodiment is that step S32 is detailed as follows:
and opening the graphics primitives in the target display area, and when the size of the graphics primitives is smaller than that of the target display area, the graphics primitives are wholly positioned in the target display area, and the graphics primitives can be dragged randomly in the target display area to move.
For example, when moving the primitive to the left, a first initial boundary of the target display area coinciding with the moving direction is determined as a first target boundary, a second initial boundary of the primitive coinciding with the moving direction is determined as a second target boundary, and the second target boundary is located within the target display area. The direction of movement is to the left, i.e. the boundary to the left of the target display area is determined as the first target boundary and the boundary to the leftmost of the primitive is determined as the second target boundary.
And moving the primitive leftwards, and stopping moving the primitive leftwards continuously under the condition that the second target boundary of the primitive is overlapped with the first target boundary. At this time, if the upper and lower sides or the right side of the primitive are located within the target display area and do not coincide with the boundary corresponding to the target display area, the primitive may be moved upward, downward, or rightward according to the same operation.
And adding a primitive in the target display area, detecting whether boundary collision occurs when the upper, lower, left and right boundaries of the primitive are close to the boundary of the target display area when the primitive is moved, and if the boundary of the primitive is overlapped with the boundary of the target display area, the primitive cannot be moved continuously. The problem of display area waste caused by the fact that the moving graphics primitives exceed the boundary of the target display area is solved, and the graphics primitives are guaranteed to be displayed in the target display area to the maximum extent.
Referring to fig. 4, which is a schematic flow chart of a primitive transformation method provided in a fourth embodiment of the present disclosure, in the present embodiment, a primitive portion is displayed in a target display area, and an input parameter includes a moving direction, and the primitive transformation method includes:
step S41, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S42, moving the graphics primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, determining a second initial boundary of the graphics primitive opposite to the moving direction as a second target boundary, and the second target boundary is located outside the target display area;
in step S43, when there is coincidence between the first object boundary and the second object boundary, the movement of the primitive in the movement direction is terminated.
Step S41 is the same as step S21, and step S42 is the same as step S22, which are not repeated herein. The difference from the second embodiment is that step S43 is detailed as follows:
for example, when the right side of the primitive is outside the target display area, the primitive needs to be moved to the left to display the content of the primitive on the right side, and when the second target boundary of the primitive coincides with the first target boundary, the primitive is stopped from being moved to the left. At this time, if the upper side or the lower side or the left side of the primitive is located outside the target display area, the primitive can be continuously moved downwards, upwards or rightwards until the first target boundary corresponding to the moving direction is overlapped with the second target boundary, and then the moving in the moving direction is stopped. The flexibility of primitive transformation is increased, and the primitive transformation effect is better.
Referring to fig. 5, which is a schematic flow chart of a primitive transformation method provided in a fifth embodiment of the present application, in this embodiment, a whole primitive is located in a target display area, and an input parameter includes a moving direction, where the primitive transformation method includes:
step S51, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S52, moving the graphics primitive according to the moving direction, determining a first initial boundary of the target display area consistent with the moving direction as a first target boundary, determining a second initial boundary of the graphics primitive consistent with the moving direction as a second target boundary, and the second target boundary is located in the target display area;
in step S53, when there is coincidence between the first object boundary and the second object boundary, the movement of the primitive in the movement direction is terminated.
Step S51 is the same as step S31, and step S52 is the same as step S32, which are not repeated herein. The difference from the third embodiment is that step S53 is detailed as follows:
for example, moving the primitive to the left, and stopping moving the primitive to the left when the second target boundary of the primitive coincides with the first target boundary. At this time, if the upper side and the lower side or the right side of the primitive are positioned in the target display area and do not coincide with the boundary corresponding to the target display area, the primitive can be continuously moved upwards, downwards or rightwards until the first target boundary corresponding to the moving direction coincides with the second target boundary, and the moving in the moving direction is stopped. The flexibility of primitive transformation is increased, and the primitive transformation effect is better.
Referring to fig. 6, which is a schematic flow chart of a primitive transformation method provided in a sixth embodiment of the present application, in this embodiment, the input parameter further includes a scaling multiple, and the primitive transformation method includes:
step S61, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S62, zooming the graphics primitive according to the zooming times, determining all the first initial boundaries of the target display area as first target boundaries, and determining all the second initial boundaries of the graphics primitive as second target boundaries;
in step S63, when there is an overlap between any mutually opposite first object boundary and second object boundary, the scaling of the primitive is ended.
Step S61 is the same as step S11, and is not described herein. The difference from the first embodiment is that steps S62 and S63 are detailed as follows:
in addition to moving the primitives, the primitives may be scaled according to a scaling factor. In this embodiment of the present application, when the input parameter includes the moving direction, and the primitive is transformed according to the moving direction as described in the above embodiment, and after the movement of the primitive in the moving direction is completed, the primitive may be further scaled according to the scaling factor.
After the primitive is moved, when the size of the primitive exceeds the target display area, the primitive can be reduced, at the moment, four edges of the primitive are all used as second target boundaries, and four edges of the target display area are used as corresponding first target boundaries. And when the upper and lower two opposite second target boundaries of the primitive coincide with the upper and lower two first target boundaries of the target display area respectively, or when the left and right two opposite second target boundaries of the primitive coincide with the left and right two first target boundaries of the target display area respectively, ending the reduction operation on the primitive. So as to ensure that the graphic element is maximally displayed in the target display area.
After the primitive is moved, the size of the primitive is smaller than that of the target display area, when the whole primitive is located in the target display area, the primitive can be amplified, at the moment, four edges of the primitive are all used as second target boundaries, and four edges of the target display area are used as corresponding first target boundaries. And finishing the enlarging operation of the primitive when the upper and lower two opposite second target boundaries of the primitive coincide with the upper and lower two first target boundaries of the target display area respectively, or when the left and right two opposite second target boundaries of the primitive coincide with the left and right two first target boundaries of the target display area respectively. The waste of a display area is avoided, and the graphics primitives are guaranteed to be displayed in the target display area to the maximum extent.
Referring to fig. 7, which is a schematic flow chart of a primitive transformation method provided in a seventh embodiment of the present application, in this embodiment, the input parameter includes a rotation direction, and the primitive transformation method includes:
step S71, displaying a graphic element in a target display area, wherein the target display area comprises a plurality of first initial boundaries, and the graphic element comprises a plurality of second initial boundaries;
step S72, the primitive is rotated according to the rotation direction, and after the rotation, the primitive is zoomed according to the preset zoom multiple, all the first initial boundaries of the target display area are determined as first target boundaries, and all the second initial boundaries of the primitive are determined as second target boundaries;
in step S73, when there is an overlap between any mutually opposite first object boundary and second object boundary, the scaling of the primitive is ended.
Step S71 is the same as step S11, and is not described herein. The difference from the first embodiment is that steps S72 and S73 are detailed as follows:
besides moving and scaling the primitive, the primitive can be rotated according to the rotation direction. In this embodiment of the application, when the input parameter includes the moving direction, and the primitive is transformed according to the moving direction as described in the above embodiment, and after the movement of the primitive in the moving direction is completed, the primitive may be further continuously rotated according to the rotating direction.
After moving the primitive, when the size of the primitive exceeds the target display area, the primitive can be reduced after being rotated, four edges of the rotated primitive are all used as second target boundaries, and four edges of the target display area are used as corresponding first target boundaries. And when the upper and lower two opposite second target boundaries of the primitive coincide with the upper and lower two first target boundaries of the target display area respectively, or when the left and right two opposite second target boundaries of the primitive coincide with the left and right two first target boundaries of the target display area respectively, ending the reduction operation on the primitive. So as to ensure that the graphic element is maximally displayed in the target display area.
After the primitive is moved, the size of the primitive is smaller than that of the target display area, when the whole primitive is located in the target display area, the primitive can be amplified after being rotated, four edges of the primitive are all used as second target boundaries, and four edges of the target display area are used as corresponding first target boundaries. And finishing the enlarging operation of the primitive when the upper and lower two opposite second target boundaries of the primitive coincide with the upper and lower two first target boundaries of the target display area respectively, or when the left and right two opposite second target boundaries of the primitive coincide with the left and right two first target boundaries of the target display area respectively. The waste of a display area is avoided, and the graphics primitives are guaranteed to be displayed in the target display area to the maximum extent.
In another possible implementation manner of the embodiment of the present application, the primitive may be enlarged or reduced according to a preset ratio, the primitive is rotated after the scaling operation is performed, the primitive is rotated with the center of the scaled primitive as a reference, the scaling ratio is kept unchanged after the rotation, and the primitive is continuously moved, scaled, or rotated according to the method described in each of the embodiments.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the method of primitive transformation in the foregoing embodiments, fig. 8 shows a structural block diagram of a primitive transformation device 8 provided in the embodiments of the present application, and for convenience of explanation, only the parts related to the embodiments of the present application are shown.
Referring to fig. 8, the primitive translation device 8 includes:
a display module 81 configured to display a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries;
a transformation determining module 82, configured to obtain a first input for a primitive, transform the primitive according to input parameters included in the first input, determine a first target boundary from a plurality of first initial boundaries, and determine a second target boundary from a plurality of second initial boundaries;
and an ending transformation module 83, configured to end the transformation of the primitive when there is coincidence between the first target boundary and the second target boundary.
Optionally, in a case that the primitive portion is displayed in the target display area and the input parameter includes a moving direction:
the transformation determining module 82 is specifically configured to move the primitive according to the moving direction, determine a first initial boundary of the target display area opposite to the moving direction as a first target boundary, determine a second initial boundary of the primitive opposite to the moving direction as a second target boundary, and position the second target boundary outside the target display area;
the ending transformation module 83 is specifically configured to end the movement of the primitive in the moving direction when there is coincidence between the first object boundary and the second object boundary.
Optionally, when the whole primitive is located in the target display area and the input parameter includes the moving direction:
the transformation determining module 82 is specifically configured to move the primitive according to the moving direction, determine a first initial boundary where the target display area is consistent with the moving direction as a first target boundary, determine a second initial boundary where the primitive is consistent with the moving direction as a second target boundary, where the second target boundary is located within the target display area;
the ending transformation module 83 is specifically configured to end the movement of the primitive in the moving direction when there is coincidence between the first object boundary and the second object boundary.
Optionally, in the case that the input parameter includes a zoom factor:
the transformation determining module 82 may be further configured to scale the primitive according to the scaling factor, determine all first initial boundaries of the target display area as first target boundaries, and determine all second initial boundaries of the primitive as second target boundaries;
the end transform module 83 may also be configured to end scaling of the primitive in the presence of coincidence between any mutually opposing first object boundary and second object boundary.
Optionally, in the case that the input parameter includes a rotation direction:
the transformation determining module 82 may be further configured to rotate the primitive according to the rotation direction, and perform scaling according to a preset scaling multiple after the rotation, determine all first initial boundaries of the target display area as first target boundaries, and determine all second initial boundaries of the primitive as second target boundaries;
the end transform module 83 may also be configured to end scaling of the primitive in the presence of coincidence between any mutually opposing first object boundary and second object boundary.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Referring to fig. 9, an embodiment of the present application further provides a terminal device 9, including: at least one processor 90, a memory 91 and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, such as a first object boundary or a second object boundary determining program, an end transformation program, etc. The steps in any of the various method embodiments described above are implemented when the computer program 92 is executed by the processor 90. Such as S11, S12, and S13 shown in fig. 1.
Illustratively, the computer program 92 may be partitioned into one or more modules/units, which are stored in the memory 91 and executed by the processor 90 to accomplish the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 92 in the terminal device 9.
The processor 90 may include one or more of a central processing unit (cpu), an Application Processor (AP), a baseband processor, and the like. The processor 90 may be a neural hub and a command center of a wireless router. The processor 90 may generate operation control signals according to the instruction operation code and the timing signals, so as to complete the control of instruction fetching and instruction execution. The memory 91 may be used to store computer executable program code, which includes instructions. The processor 90 executes various functional applications of the network device and data processing by executing instructions stored in the memory 91. The memory 91 may include a program storage area and a data storage area, such as data storing a sound signal to be played, and the like. The memory 91 may be, for example, a double data rate synchronous dynamic random access memory DDR or a Flash memory Flash.
The present application further provides a computer-readable storage medium, in which a computer program is stored, and when being executed by the processor 90, the computer program 92 implements the steps in the above-mentioned method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the method of the embodiments described above can be implemented by a computer program 92 to instruct related hardware to implement the steps of the methods described above, and the computer program 92 can be stored in a computer readable storage medium, and when being executed by the processor 90, the computer program 92 can implement the steps of the methods of the embodiments described above. Where the computer program 92 includes computer program 92 code, the computer program 92 code may be in source code form, object code form, an executable file or some intermediate form, and the like. The computer readable medium may include at least: any entity or device capable of carrying the computer program 92 code to a photographing apparatus/terminal apparatus, a recording medium, a computer Memory, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A method for primitive transformation, comprising:
displaying a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries;
acquiring a first input aiming at the graphic primitive, transforming the graphic primitive according to input parameters included by the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries;
under the condition that the first target boundary and the second target boundary are overlapped, finishing the transformation of the graphic primitive;
in the case where the primitive portion is displayed within the target display area, and the input parameter comprises a direction of movement,
the transforming the primitive according to the input parameters included in the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries, includes:
moving the primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, and determining a second initial boundary of the primitive opposite to the moving direction as a second target boundary, wherein the second target boundary is positioned outside the target display area;
or, in the case that the primitive is entirely located in the target display area and the input parameter includes a moving direction,
the transforming the primitive according to the input parameters included in the first input, determining a first target boundary from the plurality of first initial boundaries, and determining a second target boundary from the plurality of second initial boundaries, includes:
and moving the primitive according to the moving direction, determining a first initial boundary of the target display area, which is consistent with the moving direction, as a first target boundary, and determining a second initial boundary of the primitive, which is consistent with the moving direction, as a second target boundary, wherein the second target boundary is located in the target display area.
2. The method for primitive translation according to claim 1, wherein said terminating the translation of the primitive in the case of coincidence between the first object boundary and the second object boundary comprises:
ending the movement of the primitive in the movement direction.
3. The method for primitive transformation according to claim 2, wherein in case that the input parameter further includes a scaling factor,
after finishing the movement of the primitive in the moving direction, the method further includes:
zooming the graphic primitive according to the zooming times, determining all first initial boundaries of the target display area as first target boundaries, and determining all second initial boundaries of the graphic primitive as second target boundaries;
and under the condition that any mutually opposite first target boundary and second target boundary are overlapped, finishing the scaling of the primitive.
4. A method of primitive transformation according to claim 2, characterized in that in case the input parameters further include a rotation direction,
after finishing the movement of the primitive in the moving direction, the method further includes:
rotating the primitive according to the rotation direction, zooming according to a preset zoom multiple after the primitive is rotated, determining all first initial boundaries of the target display area as first target boundaries, and determining all second initial boundaries of the primitive as second target boundaries;
and under the condition that any mutually opposite first target boundary and second target boundary are overlapped, finishing the scaling of the primitive.
5. A method for primitive translation according to claim 1 wherein the target display area is all or part of the display area of the display screen.
6. A primitive translation apparatus, comprising:
a display module for displaying a primitive in a target display area, the target display area including a plurality of first initial boundaries, the primitive including a plurality of second initial boundaries;
a transformation determining module, configured to obtain a first input for the primitive, transform the primitive according to input parameters included in the first input, determine a first target boundary from the first initial boundaries, and determine a second target boundary from the second initial boundaries;
a transformation ending module, configured to end transformation of the primitive when there is coincidence between the first target boundary and the second target boundary;
in the case where the primitive portion is displayed within the target display area, and the input parameter comprises a direction of movement,
a transformation determining module specifically configured to:
moving the primitive according to the moving direction, determining a first initial boundary of the target display area opposite to the moving direction as a first target boundary, and determining a second initial boundary of the primitive opposite to the moving direction as a second target boundary, wherein the second target boundary is positioned outside the target display area;
or, in the case that the primitive is entirely located in the target display area and the input parameter includes a moving direction,
a transformation determining module specifically configured to:
and moving the primitive according to the moving direction, determining a first initial boundary of the target display area, which is consistent with the moving direction, as a first target boundary, and determining a second initial boundary of the primitive, which is consistent with the moving direction, as a second target boundary, wherein the second target boundary is located in the target display area.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN202110039588.1A 2021-01-13 2021-01-13 Primitive transformation method and device, terminal equipment and computer readable storage medium Pending CN112379817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110039588.1A CN112379817A (en) 2021-01-13 2021-01-13 Primitive transformation method and device, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110039588.1A CN112379817A (en) 2021-01-13 2021-01-13 Primitive transformation method and device, terminal equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112379817A true CN112379817A (en) 2021-02-19

Family

ID=74591077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110039588.1A Pending CN112379817A (en) 2021-01-13 2021-01-13 Primitive transformation method and device, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112379817A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988540A (en) * 2021-03-19 2021-06-18 深圳市安冠科技有限公司 Primitive replacement method, system, computer readable storage medium and terminal equipment
CN113805773A (en) * 2021-08-24 2021-12-17 上海联影医疗科技股份有限公司 Image display method, image display device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122108A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 A kind of picture editing method and device
CN109741397A (en) * 2019-01-04 2019-05-10 京东方科技集团股份有限公司 Picture indicia method, apparatus, computer equipment and readable storage medium storing program for executing
CN109901902A (en) * 2019-02-19 2019-06-18 广州视源电子科技股份有限公司 Interface display method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122108A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 A kind of picture editing method and device
CN109741397A (en) * 2019-01-04 2019-05-10 京东方科技集团股份有限公司 Picture indicia method, apparatus, computer equipment and readable storage medium storing program for executing
CN109901902A (en) * 2019-02-19 2019-06-18 广州视源电子科技股份有限公司 Interface display method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蜗牛1T: "使用jquery.easydrag拖拽插件的拖拽出界问题", 《HTTP://WWW.VOIDCN.COM/ARTICLE/P-KQFBVJTN-SR.HTML》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988540A (en) * 2021-03-19 2021-06-18 深圳市安冠科技有限公司 Primitive replacement method, system, computer readable storage medium and terminal equipment
CN112988540B (en) * 2021-03-19 2023-07-04 深圳市安冠科技有限公司 Primitive replacement method, system, computer readable storage medium and terminal device
CN113805773A (en) * 2021-08-24 2021-12-17 上海联影医疗科技股份有限公司 Image display method, image display device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US9529440B2 (en) Disambiguation of multitouch gesture recognition for 3D interaction
US8780134B2 (en) Access to control of multiple editing effects
JP4642868B2 (en) How to provide an area zoom function for a camera
US7395515B2 (en) Method and apparatus for screen object manipulation
US8368699B2 (en) Displaying bar charts with a fish-eye distortion effect
US20210294463A1 (en) Techniques to Modify Content and View Content on Mobile Devices
CN109298909B (en) Window adjusting method, mobile terminal and computer readable storage medium
CN112379817A (en) Primitive transformation method and device, terminal equipment and computer readable storage medium
US9395910B2 (en) Invoking zoom on touch-screen devices
JP2013044802A (en) Image display unit, image display method, image display program and computer readable recording medium for recording program
CN106897321B (en) Method and device for displaying map data
WO2021243788A1 (en) Screenshot method and apparatus
US20210216196A1 (en) Automatic zoom-loupe creation, selection, layout, and rendering based on interaction with crop rectangle
CN114115643A (en) Component display method and device, electronic equipment and readable medium
CN112221128A (en) Map adjusting method and related device
CN113934350B (en) Virtual object selection method, device, electronic equipment and storage medium
JP2010521859A (en) Method and apparatus for editing images
CN116521039B (en) Method and device for moving covered view, electronic equipment and readable storage medium
CN114612584B (en) Image processing method, device, equipment and storage medium
JP6287498B2 (en) Electronic whiteboard device, electronic whiteboard input support method, and program
US20220083208A1 (en) Non-proportionally transforming and interacting with objects in a zoomable user interface
CN115033226A (en) Page display method and device, terminal equipment and computer readable storage medium
CN111199512B (en) SVG vector graphic adjustment method, SVG vector graphic adjustment device, storage medium and SVG vector graphic adjustment terminal
CN109739403B (en) Method and apparatus for processing information
JP2020507174A (en) How to navigate the panel of displayed content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210219