CN114995738A - Transformation method, device, electronic equipment, storage medium and program product - Google Patents

Transformation method, device, electronic equipment, storage medium and program product Download PDF

Info

Publication number
CN114995738A
CN114995738A CN202210612981.XA CN202210612981A CN114995738A CN 114995738 A CN114995738 A CN 114995738A CN 202210612981 A CN202210612981 A CN 202210612981A CN 114995738 A CN114995738 A CN 114995738A
Authority
CN
China
Prior art keywords
state
transformation
transforming
acquiring
touch
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.)
Granted
Application number
CN202210612981.XA
Other languages
Chinese (zh)
Other versions
CN114995738B (en
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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202210612981.XA priority Critical patent/CN114995738B/en
Publication of CN114995738A publication Critical patent/CN114995738A/en
Application granted granted Critical
Publication of CN114995738B publication Critical patent/CN114995738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • 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
    • 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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
    • 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/04808Several contacts: gestures triggering a specific function, e.g. scrolling, zooming, right-click, when the user establishes several contacts with the surface simultaneously; e.g. using several fingers or a combination of fingers and pen

Abstract

The invention provides a transformation method, which comprises the following steps: detecting a touch event of a user on a touch screen; after the touch event is detected, detecting the state of an element displayed on a touch screen, and acquiring a first state and a second state of the element; acquiring at least one object generated in the process of transforming the element from the first state to the second state; matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object; and transforming the element by using the associated object to obtain a target element. The invention can improve the reusability of the object, reduce the memory jitter (MemoryChurn) generated when a new graphic object is repeatedly created, reduce the condition that the memory exceeds the use in a short time due to the continuous creation of the new object, reduce the performance loss of the vehicle machine, improve the stability and the expression effect of the conversion, provide a better visual effect for a user, and be more smooth and fluent when being zoomed.

Description

Transformation method, transformation device, electronic equipment, storage medium and program product
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a transformation method, an apparatus, an electronic device, a storage medium, and a program product.
Background
Currently, in touchable devices, it has become a necessity to zoom in on the elements displayed in the touchscreen. When browsing elements, a user operates the elements in a mode of attempting double-click, dragging, sliding and the like by using fingers, so that the displayed elements reach the expression form which is desired by the user. Developers with different implementation modes of the gesture scaling elements have different standards in the development process, so that problems such as memory jitter and abnormal transformation are caused in transformation.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention provides a transformation method, device, electronic device, storage medium and program product to solve the above technical problems.
The invention provides a conversion method, which comprises the following steps:
detecting a touch event of a user on a touch screen;
after the touch event is detected, detecting the state of an element displayed on a touch screen, and acquiring a first state and a second state of the element;
acquiring at least one object generated in the process of transforming the element from the first state to the second state;
matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object;
and transforming the element by using the associated object to obtain a target element.
In an embodiment of the present invention, if there is an object not matching with the pre-stored object in the at least one object, the step of matching the at least one object with the pre-stored object in the object pool further includes:
establishing an associated object of the object which is not matched with the pre-stored object;
and transforming the element by using the newly-established associated object.
In an embodiment of the present invention, the process of transforming the first state into the second state includes a plurality of sub-states, each sub-state corresponds to an object, and the establishing the associated object of the object that does not match with the pre-stored object includes:
acquiring a transformation parameter for transforming the previous substate into the next substate;
and transforming the object corresponding to the previous state according to the transformation parameters to obtain a transformed object, wherein the transformed object is used as a newly-built associated object.
In an embodiment of the present invention, during the process of transforming the element by using the associated object, the method further includes:
acquiring a first transformation parameter for transforming the element from the first state to the second state;
comparing the first transformation parameter to a transformation parameter threshold;
stopping the transformation of the element when the first transformation parameter equals the transformation parameter threshold.
In an embodiment of the present invention, the transformation parameters include translational displacement and/or scaling, and the step of obtaining the transformation parameters includes:
acquiring the number of touch points according to the touch event;
when the number of the touch points is one, taking the displacement of the touch points as the translation displacement;
when the number of the touch points is more than one, acquiring a central point of each touch point; and determining the scaling according to the distance between each touch point and the central point.
In an embodiment of the present invention, after the creating the associated object of the object not matching the pre-stored object, the method further includes:
and storing the newly-built associated object into the object pool.
The invention provides a conversion device, comprising:
the touch detection module is used for detecting a touch event of a user on the touch screen;
the state detection module is used for detecting the state of an element displayed on the touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
an object obtaining module, configured to obtain at least one object generated during a process in which the element is transformed from the first state to the second state;
the object matching module is used for matching the at least one object with pre-stored objects in an object pool and acquiring associated objects of the pre-stored objects which are successfully matched with the at least one object;
and the element transformation module is used for transforming the element by using the associated object to obtain a target element.
The invention provides an electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to implement the transformation method.
The present invention provides a computer-readable storage medium having stored thereon computer-readable instructions which, when executed by a processor of a computer, cause the computer to perform the transformation method.
The invention provides a computer program product, characterized in that it comprises a computer program carried on a computer-readable medium, the computer program comprising a computer program for executing said transformation method.
The invention has the beneficial effects that: the invention relates to a transformation method, which comprises the following steps: detecting a touch event of a user on a touch screen; after the touch event is detected, detecting the state of an element displayed on a touch screen, and acquiring a first state and a second state of the element; acquiring at least one object generated in the process of transforming the element from the first state to the second state; matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object; and transforming the element by using the associated object to obtain a target element. The invention pre-stores a plurality of objects in a pre-established object pool, searches whether the related objects same as the objects exist in the object pool in the element conversion process, and directly converts the elements by the related objects if the related objects exist. Therefore, the reusability of the object can be improved, Memory jitter (Memory Churn) generated when a new graphic object is repeatedly created is reduced, the condition that the Memory exceeds the use time within a short time due to the fact that the new object is continuously created is reduced, the performance loss of the vehicle machine is reduced, the stability and the performance effect of conversion are improved, a better visual effect is provided for a user, and the zooming is smoother and smoother.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a schematic diagram of an implementation environment of a transformation method shown in an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a transformation method shown in an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of an external matrix shown in an exemplary embodiment of the present application;
FIG. 4 is a flow chart illustrating obtaining transformation parameters in an exemplary embodiment of the present application;
FIG. 5 is a flow diagram illustrating the establishment of an association object in accordance with an illustrative embodiment of the present application;
FIG. 6 is a block diagram of a transformation device shown in an exemplary embodiment of the present application;
FIG. 7 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the disclosure herein, wherein the embodiments of the present invention are described in detail with reference to the accompanying drawings and preferred embodiments. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be understood that the preferred embodiments are illustrative of the invention only and are not limiting upon the scope of the invention.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring embodiments of the present invention.
FIG. 1 is a schematic diagram of an exemplary transformation method implementation environment of the present application. Referring to fig. 1, the implementation environment includes a terminal device 101 and a server 102, and the terminal device 101 and the server 102 communicate with each other through a wired or wireless network.
It should be understood that the number of terminal devices 101 and servers 102 in fig. 1 is merely illustrative. There may be any number of terminal devices 101 and servers 102, as desired.
The terminal device 101 corresponds to a client, which may be any electronic device having a user input interface, including but not limited to a smart phone, a tablet, a notebook computer, a vehicle-mounted computer, and the like, wherein the user input interface includes but not limited to a touch screen, a keyboard, a physical key, an audio pickup device, and the like.
The server 102 corresponds to a server, may be a server providing various services, may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content delivery network), a big data and an artificial intelligence platform, which is not limited herein.
The terminal 101 may communicate with the server 102 through a wireless network such as 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), 5G (fifth generation mobile information technology), and the like, which is not limited herein.
Referring to fig. 2, fig. 2 is a flowchart illustrating a transformation method according to an exemplary embodiment of the present application. The method may be applied to the implementation environment shown in fig. 1 and specifically executed by the terminal device 101 in the implementation environment. It should be understood that the method may be applied to other exemplary implementation environments and is specifically executed by devices in other implementation environments, and the embodiment does not limit the implementation environment to which the method is applied.
Referring to fig. 2, fig. 2 is a flowchart illustrating an exemplary transformation method according to the present application, where the transformation method at least includes steps S201 to S205, and includes:
s201, detecting a touch event of a user on a touch screen;
s202, after the touch event is detected, detecting the state of an element displayed on the touch screen, and acquiring a first state and a second state of the element;
s203, acquiring at least one object generated in the process of transforming the element from the first state to the second state;
s204, matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object;
s205, transforming the element by the associated object to obtain a target element.
The invention pre-stores a plurality of objects in a pre-established object pool, searches whether the related objects same as the objects exist in the object pool in the element conversion process, and directly converts the elements by the related objects if the related objects exist. Therefore, the reusability of the object can be improved, Memory jitter (Memory Churn) generated when a new graphic object is repeatedly created is reduced, the performance loss of the car machine is reduced, the stability and the performance effect of element transformation are improved, a better visual effect is provided for a user, and the car machine is more smooth and fluent to zoom.
First, it should be noted that, in an exemplary embodiment of the present application, the transformation method shown in fig. 2 may be applied to a vehicle-mounted computer, where an Android system runs in the vehicle-mounted computer, and a target element, such as a picture, is displayed in a display screen of the vehicle-mounted computer, and the picture may be zoomed or/and panned by the method shown in fig. 2 to transform the picture to a state desired by a user.
A picture is essentially a collection of points that form a matrix, and thus, the transformation of a picture is essentially a transformation of a matrix. In the Android system, the method comprises the following steps:
when the external matrix changes, the total matrix also changes, and the display position of the picture and the like still change as the external matrix changes.
An object Pool (Objects Pool) in which several Objects are pre-stored, which can be understood as an overall matrix.
Matrix pools and rectangular pools (Matrix & Rectf Pool) are the specific implementation of object pools, controlling the number of Matrix objects generated during the actual operation.
The scaled image computation tool (Math Utilities) provides various computations required in the graphic scaling process, such as common computations of intermediate points, scaling, matrix point inversion, etc.
Zooming an image view (ImageView), intercepting a touch event, judging a gesture of the touch event, and issuing the touch event to finish zooming or/and translation of the view (picture). In the Android system, several gestures are defined by which the transformation of the picture can be done. The plurality of gestures may include, for example:
ACTION _ UP, ACTION _ CANCEL — stopping a possible previous image change operation due to the lifting or cancellation of the finger, and returning to a default non-touched state;
ACTION _ POINTER _ UP-lifting of a certain finger or certain fingers generated in the gesture operation process, wherein the zoom control point needs to be judged again at this time so as to keep the fluency of the zoom operation;
ACTION _ DOWN-state of finger press, normal case is scroll translation, if there is zoom change before, then not allow the current scroll translation operation;
ACTION _ POINTER _ DOWN-touch points are added in the zooming process, and at the moment, the zooming needs to be forcibly switched to perform the current zooming operation;
ACTION MOVE-there are two possibilities at this time, panning or zooming, and then a decision whether to exceed the maximum ratio needs to be added at this stage to reduce the possibility of display anomalies in extreme cases.
And a Gesture Detector (Gesture Detector) for assisting the zoomed image view to judge the Gesture of the touch event. The following gestures are also defined on the basis of zooming the image view in a self-defining way: such as jerk, long press, double click, etc.
The following describes the detailed steps of the transformation method for transforming a picture according to the present invention with specific embodiments.
In an exemplary embodiment of the present application, in step S201, a touch event of a user on a touch screen is detected.
As described above, the touch screen enables a user to operate the electronic terminal by lightly touching the icons or characters on the display screen with a finger or a stylus, so that human-computer interaction is more direct. The touch event is generated when a user touches the touch screen with a finger. The touch event is divided into a single-point touch event and a multi-point touch event, and the touch event can be judged to be a single-point touch event generated by a single finger or a multi-point touch event generated by more than two fingers according to the number of touch points. When the number of the detected touch points is one, judging that the touch event is a single-point touch event; and when more than one touch point is detected, determining that the touch event is a multi-point touch event. If the touch event is a single-point touch event, the operation on the touch screen is a translation operation, and the translation operation includes translation operations in different directions, such as up-sliding translation, down-sliding translation, left-sliding translation, right-sliding translation, and the like; when the touch event is a multi-point touch event, the operation on the touch screen is a zoom operation.
It should be noted that the position of the touched point can be identified by the coordinate value in the touch coordinate system of the touch screen.
In an exemplary embodiment of the present application, in step S202, after the touch event is detected, a state of a picture displayed on the touch screen is detected, and a first state and a second state of the picture are obtained.
After the touch event is detected, the picture can be considered to be changed, so that the state of the picture can be detected; the state of the picture comprises the size and the position of the picture, wherein A represents processing the picture in the first state, and B represents processing the picture in the second state. The first state comprises the initial (unchanged) position and size of the picture, and the second state comprises the transformed size and position of the picture.
In an exemplary embodiment of the present application, in step S203, at least one object generated during the process of transforming the picture from the first state to the second state is obtained.
In this embodiment, the change of the external matrix is monitored by the external matrix change monitor, and when the external matrix (a matrix formed by the MSCALE and the MSKEW in fig. 3) changes, the total matrix (the matrix shown in fig. 3) also changes, and the picture transformation can be obtained by calculating the parameters of the total matrix, so as to implement the picture transformation. Wherein the transformation parameters include at least one of: translation displacement and scaling; the transforming of the picture comprises at least one of: and (5) translating and zooming.
During the process of changing the picture from the first state to the second state, the external matrix of the picture is changed for a plurality of times, namely, a plurality of new external matrices are generated. In this embodiment, the external matrix is defined as an object, that is, a plurality of objects are generated during the process of converting the picture from the first state to the second state. If the first state is transformed to the second state and is defined to include a plurality of sub-states, each sub-state corresponds to an object, and the latter sub-state is transformed based on the former sub-state. The calculation of the middle point, the scaling ratio, the matrix point inversion and the like of the picture scaling is realized by a scaled image calculation tool (Math Utilities).
In an exemplary embodiment of the present application, in step S204, the at least one object is matched with a pre-stored object in an object pool, and an associated object of the pre-stored object successfully matched with the at least one object is obtained.
During the transformation of the picture, the external matrix changes, which results in a change of the total matrix. In the present embodiment, the total matrix is defined as the correlation matrix. When a plurality of external matrices are generated during the process of converting a picture from a first state to a second state, a plurality of total matrices are obtained through a plurality of computations, so that the time for converting the picture state is increased due to the plurality of computations during the process of converting the picture. In the case of one picture shift, hundreds of external matrices may be generated in the whole process, and thus hundreds of calculations are performed, and then hundreds of picture displays are performed, and a pause occurs in the picture conversion process.
In the application, the generated object is matched with the pre-stored object in the object pool, and if the matching is successful, the generated object exists in the pre-stored object. Because the associated object having the association relation with the pre-stored object exists in the object pool, the associated object is used for subsequent calculation, the associated object does not need to be calculated based on the generated object, namely, the total matrix is obtained through external matrix calculation, so that the intermediate calculation process is omitted, and the time for picture transformation is saved. Wherein, the association relation refers to that the pre-stored object is transformed to obtain the associated object. Taking a calculation as an example, if the total matrix obtained by the external matrix calculation may take 100ms, and the correlation matrix obtained by matching, the time required is generally less than 50ms, so that one time can be saved.
In an exemplary embodiment of the present application, please refer to fig. 4, where fig. 4 is a flowchart for obtaining transformation parameters, which includes steps S401 to S403:
step S401, acquiring the number of touch points according to the touch event;
step S402, when the number of the touch points is one, taking the displacement of the touch points as the translational displacement;
step S403, when the number of the touch points is more than one, acquiring the central point of each touch point; and determining the scaling according to the distance between each touch point and the central point.
In an exemplary embodiment of the present application, if there is an object that does not match the pre-stored object in the at least one object, the step of matching the at least one object with the pre-stored object in the object pool further includes: establishing an associated object of the object which is not matched with the pre-stored object; and transforming the element by using the newly-established associated object.
Specifically, referring to fig. 5, fig. 5 is a flowchart of establishing an association object. In fig. 5, the establishing of the associated object of the object not matching with the pre-stored object includes steps S501 to S502:
s501, acquiring a conversion parameter for converting a previous substate into a next substate;
s502, according to the transformation parameters, transforming the object corresponding to the previous state to obtain a transformed object, wherein the transformed object is used as a newly-established associated object.
Many methods are provided in Android for processing pictures, and the Matrix (Matrix) as a component closer to the bottom layer is more flexible to operate than other tools (such as canvas). In Android, the matrix is a 3x3 matrix, and unlike the matrix in mathematics, the content represented by each bit has a special meaning, and the expression is as follows:
Figure BDA0003672530450000101
specifically, please refer to fig. 3, wherein the proportional rotation part comprises two sets of parameters, MSCALE and MSKEW, respectively. The MSCALE group parameters control the X, Y direction scaling, while the MSKEW group parameters control the X, Y direction miscut. The translation component alone has a set of parameters, MTRANS, that control X, Y the direction of translation. While the lowest isometric transformation is used less often MPERSP _2 is assigned a value to distinguish between vectors and points.
In particular, assume a scaling of k in the x-axis 1 Y-axis scaling of k 2 The width and height of the original image are x 0 、y 0 Then there is now a calculated scaled formula:
x=k 1 ×x 0
y=k 2 ×y 0
at this time, the expression is expressed by matrix calculation, and then:
Figure BDA0003672530450000102
as can be seen from the above equation, for a scaling process, the parameter to be recorded is k 1 、k 2 、x 0 、y 0 . Similarly, during the translation, if the translation variables are Δ x and Δ y, respectively, then it is determined thatThe translation formula and the formula after conversion into a matrix are:
x=x 0 +Δx
y=y 0 +Δy
Figure BDA0003672530450000103
the parameters are transmitted into the partial matrix according to the correct sequence, so that the changed total matrix, namely the associated object, can be correctly obtained.
In an exemplary embodiment of the present application, after the creating of the associated object of the object that does not match the pre-stored object, the method further includes: and storing the newly-built associated object into the object pool. It should be noted that, after there is no corresponding associated object in the object pool, a new associated object is established and stored in the object pool, so that the associated object is called in the subsequent picture conversion process, thereby improving the multiplexing rate of the associated object and saving the picture conversion time.
In an exemplary embodiment of the present application, in transforming the element with the associated object, the method further includes: acquiring a first transformation parameter for transforming the element from the first state to the second state; comparing the first transformation parameter to a transformation parameter threshold; stopping the transformation of the element when the first transformation parameter equals the transformation parameter threshold. Wherein the transformation parameter threshold comprises a translational displacement threshold or/and a scaling threshold.
It should be noted that, when the first transformation parameter is equal to the transformation parameter threshold, it is stated that at this time, the picture is transformed to the maximum position, and thus the transformation operation on the picture is stopped. In the embodiment, the maximum magnification of zooming is restricted, the maximum magnification is set as a boundary value, and when the boundary value is triggered, the operation of continuing zooming or the translation operation is cancelled, so that the restriction on extreme conditions is realized.
Fig. 6 is a block diagram of a transformation device shown in an exemplary embodiment of the present application. The device can be applied to the implementation environment shown in fig. 1 and is specifically configured in an intelligent terminal. The apparatus may also be applied to other exemplary implementation environments, and is specifically configured in other devices, and the embodiment does not limit the implementation environment to which the apparatus is applied.
As shown in fig. 6, the exemplary transformation device includes:
a touch detection module 601, configured to detect a touch event on a touch screen by a user;
a state detection module 602, configured to detect a state of an element displayed on a touch screen after the touch event is detected, and obtain a first state and a second state of the element;
an object obtaining module 603, configured to obtain at least one object generated during a process of transforming the element from the first state to the second state;
an object matching module 604, configured to match the at least one object with a pre-stored object in an object pool, and obtain an associated object of the pre-stored object that is successfully matched with the at least one object;
an element transformation module 605, configured to transform the element by using the associated object, so as to obtain a target element.
It should be noted that the transformation apparatus provided in the foregoing embodiment and the transformation method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute operations has been described in detail in the method embodiment, and is not described herein again. In practical applications, the transformation apparatus provided in the above embodiments may distribute the above functions by different functional modules according to needs, that is, divide the internal structure of the apparatus into different functional modules to complete all or part of the above described functions, which is not limited herein.
An embodiment of the present application further provides an electronic device, including: one or more processors; a storage device for storing one or more programs, which when executed by the one or more processors, cause the electronic device to implement the transformation method provided in the above-described embodiments.
FIG. 7 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application. It should be noted that the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for system operation are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An Input/Output (I/O) interface 705 is also connected to the bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 708 including a hard disk and the like; and a communication section 709 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may comprise a propagated data signal with a computer-readable computer program embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the transformation method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist alone without being assembled into the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the transformation method provided in the above embodiments.
The foregoing embodiments are merely illustrative of the principles of the present invention and its efficacy, and are not to be construed as limiting the invention. Those skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention are covered by the claims of the present invention.

Claims (10)

1. A method of transformation, comprising:
detecting a touch event of a user on a touch screen;
after the touch event is detected, detecting the state of an element displayed on a touch screen, and acquiring a first state and a second state of the element;
acquiring at least one object generated in the process of transforming the element from the first state to the second state;
matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object;
and transforming the element by using the associated object to obtain a target element.
2. The transformation method according to claim 1, wherein if there is an object that does not match the pre-stored object in the at least one object, further comprising, after the step of matching the at least one object with the pre-stored object in the object pool:
establishing an associated object of the object which is not matched with the pre-stored object;
and transforming the element by using the newly-established associated object.
3. The transformation method according to claim 2, wherein the process of transforming the first state into the second state comprises a plurality of sub-states, each sub-state corresponding to an object, and the establishing the associated object of the objects that do not match the pre-stored objects comprises:
acquiring a transformation parameter for transforming the previous sub-state into the next sub-state;
and transforming the object corresponding to the previous state according to the transformation parameters to obtain a transformed object, wherein the transformed object is used as a newly-established associated object.
4. The method of transforming according to claim 1, wherein in transforming the element with the associated object, the method further comprises:
acquiring a first transformation parameter for transforming the element from the first state to the second state;
comparing the first transformation parameter to a transformation parameter threshold;
stopping the transformation of the element when the first transformation parameter equals the transformation parameter threshold.
5. The transformation method according to claim 3, wherein the transformation parameters comprise translational displacement or/and scaling, and the step of obtaining the transformation parameters comprises:
acquiring the number of touch points according to the touch event;
when the number of the touch points is one, taking the displacement of the touch points as the translation displacement;
when the number of the touch points is more than one, acquiring a central point of each touch point; and determining the scaling according to the distance between each touch point and the central point.
6. The transformation method according to claim 2 or 3, wherein after establishing the associated object of the object that does not match the pre-stored object, further comprising:
and storing the newly-built associated object into the object pool.
7. A transformation device, characterized in that said device comprises:
the touch detection module is used for detecting a touch event of a user on the touch screen;
the state detection module is used for detecting the state of an element displayed on the touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
an object obtaining module, configured to obtain at least one object generated during a process in which the element is transformed from the first state to the second state;
the object matching module is used for matching the at least one object with pre-stored objects in an object pool and acquiring associated objects of the pre-stored objects which are successfully matched with the at least one object;
and the element transformation module is used for transforming the element by using the associated object to obtain a target element.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the transformation method of any one of claims 1 to 6.
9. A computer-readable storage medium having computer-readable instructions stored thereon which, when executed by a processor of a computer, cause the computer to perform the transformation method of any one of claims 1 to 6.
10. A computer program product, characterized in that it comprises a computer program carried on a computer-readable medium, the computer program comprising a computer program for executing the transformation method according to any one of claims 1 to 6.
CN202210612981.XA 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product Active CN114995738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210612981.XA CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210612981.XA CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Publications (2)

Publication Number Publication Date
CN114995738A true CN114995738A (en) 2022-09-02
CN114995738B CN114995738B (en) 2023-06-16

Family

ID=83031190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210612981.XA Active CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114995738B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722332A (en) * 2012-05-31 2012-10-10 华为终端有限公司 Touch screen equipment and processing operation trigger method thereof
CN103415835A (en) * 2012-10-08 2013-11-27 华为终端有限公司 User interface process method of touch screen device and touch screen device thereof
US20170115794A1 (en) * 2015-10-21 2017-04-27 International Business Machines Corporation Automated modification of graphical user interfaces
CN108389155A (en) * 2018-03-20 2018-08-10 北京奇虎科技有限公司 Image processing method, device and electronic equipment
CN110286827A (en) * 2019-06-27 2019-09-27 广州视源电子科技股份有限公司 A kind of element zoom control method, device, equipment and storage medium
US20190324621A1 (en) * 2018-04-23 2019-10-24 Qualcomm Incorporated System and Methods for Utilizing Multi-Finger Touch Capability to Efficiently Perform Content Editing on a Computing Device
CN110471610A (en) * 2019-08-16 2019-11-19 上海闻泰信息技术有限公司 Terminal control method, device, terminal and storage medium
CN110647286A (en) * 2019-10-09 2020-01-03 北京字节跳动网络技术有限公司 Screen element control method, device, equipment and storage medium
CN111258455A (en) * 2020-01-17 2020-06-09 Oppo广东移动通信有限公司 Event stream processing method, event stream processing device and mobile terminal
US20210035362A1 (en) * 2018-07-04 2021-02-04 Beijing Sensetime Technology Development Co., Ltd. Image processing method and apparatus, electronic device, and computer-readable storage medium
CN112819889A (en) * 2020-12-30 2021-05-18 浙江大华技术股份有限公司 Method and device for determining position information, storage medium and electronic device
US20210240135A1 (en) * 2018-04-23 2021-08-05 Fondation B-Com Method for processing a hologram, and associated device, holographic display system and computer program
CN113986438A (en) * 2021-10-30 2022-01-28 深圳市快易典教育科技有限公司 Animation loading method, system, device and computer readable storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722332A (en) * 2012-05-31 2012-10-10 华为终端有限公司 Touch screen equipment and processing operation trigger method thereof
CN103415835A (en) * 2012-10-08 2013-11-27 华为终端有限公司 User interface process method of touch screen device and touch screen device thereof
US20170115794A1 (en) * 2015-10-21 2017-04-27 International Business Machines Corporation Automated modification of graphical user interfaces
CN108389155A (en) * 2018-03-20 2018-08-10 北京奇虎科技有限公司 Image processing method, device and electronic equipment
US20210240135A1 (en) * 2018-04-23 2021-08-05 Fondation B-Com Method for processing a hologram, and associated device, holographic display system and computer program
US20190324621A1 (en) * 2018-04-23 2019-10-24 Qualcomm Incorporated System and Methods for Utilizing Multi-Finger Touch Capability to Efficiently Perform Content Editing on a Computing Device
US20210035362A1 (en) * 2018-07-04 2021-02-04 Beijing Sensetime Technology Development Co., Ltd. Image processing method and apparatus, electronic device, and computer-readable storage medium
CN110286827A (en) * 2019-06-27 2019-09-27 广州视源电子科技股份有限公司 A kind of element zoom control method, device, equipment and storage medium
CN110471610A (en) * 2019-08-16 2019-11-19 上海闻泰信息技术有限公司 Terminal control method, device, terminal and storage medium
CN110647286A (en) * 2019-10-09 2020-01-03 北京字节跳动网络技术有限公司 Screen element control method, device, equipment and storage medium
CN111258455A (en) * 2020-01-17 2020-06-09 Oppo广东移动通信有限公司 Event stream processing method, event stream processing device and mobile terminal
CN112819889A (en) * 2020-12-30 2021-05-18 浙江大华技术股份有限公司 Method and device for determining position information, storage medium and electronic device
CN113986438A (en) * 2021-10-30 2022-01-28 深圳市快易典教育科技有限公司 Animation loading method, system, device and computer readable storage medium

Also Published As

Publication number Publication date
CN114995738B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
US8176438B2 (en) Multi-modal interaction for a screen magnifier
US10324613B2 (en) Method and electronic device for moving icon to page
US9250780B2 (en) Information processing method and electronic device
US9323436B2 (en) Utilizing drawing guides in determining the display of smart guides in a drawing program
CN103955339A (en) Terminal operation method and terminal equipment
US20220324327A1 (en) Method for controlling terminal, electronic device and storage medium
CN105892877A (en) Multi-finger closing/opening gesture recognition method and device as well as terminal equipment
US11853543B2 (en) Method and apparatus for controlling display of video call interface, storage medium and device
CN103412720A (en) Method and device for processing touch-control input signals
WO2023284442A1 (en) Page processing method and apparatus, electronic device, and readable storage medium
CN113918260A (en) Application program display method and device and electronic equipment
CN110417984B (en) Method, device and storage medium for realizing operation in special-shaped area of screen
EP3769184A1 (en) Setting up multiple displays via user input
CN110209462B (en) Window arrangement method, device and equipment
CN112269501A (en) Icon moving method and device and electronic equipment
CN114995738B (en) Transformation method, transformation device, electronic equipment, storage medium and program product
CN110989880A (en) Interface element processing method and device and readable storage medium
CN113126867B (en) Browser control method and device, browser, terminal and storage medium
CN114629800A (en) Visual generation method, device, terminal and storage medium for industrial control network target range
CN110618776B (en) Picture scaling method, device, equipment and storage medium
CN113902841A (en) Image drawing method and device, electronic equipment and readable storage medium
CN114416264A (en) Message display method and device
CN114610201A (en) Interface display method and device, terminal equipment and storage medium
CN110070479A (en) Anamorphose pulls independent positioning method and device
CN111766986B (en) Method and device for performing touch operation on terminal

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
GR01 Patent grant
GR01 Patent grant