A method, device, printing device and recording medium for generating images of a web page
Patent Information
- Application Number
- CN202010463632.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-27
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-05-27
Smart Images

Figure CN111597010B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet technology, and is particularly applicable to the field of image processing technology. More specifically, it relates to a method, device, printing device and recording medium for generating images based on a Web page. Background Art
[0002] The front end is the front part of the website, which runs on the browsers of PC and mobile terminals to display web pages for users to browse. The application of HTML5 and CSS3 front-end frameworks, cross-platform responsive web design can adapt to various screen resolutions, and perfect dynamic effect design can bring users a very high user experience.
[0003] Front-end technology is generally divided into front-end design and front-end development. Front-end design can generally be understood as the visual design of the website, while front-end development is the front-end code implementation of the website, including basic HTML and CSS and JavaScript / ajax, the highest advanced versions HTML5, CSS3 and SVG, etc.
[0004] However, with the growth of HTML, many display functions have been added to HTML to meet the requirements of page designers. With the addition of these functions, HTML has become more and more messy, and HTML pages have become more and more bloated. In the prior art, Cascading Style Sheets (CSS), as a computer markup language, is responsible for the presentation of web page content in standard web page design. CSS can accurately control the position and layout of each display object in a web page and supports almost all fonts, font sizes, and styles. In addition, HTML is generally used in combination with CSS code for editing when designing web pages, which effectively improves the efficiency of web page design.
[0005] In the prior art, native apps usually implement image processing functions (click to view, zoom, save, slide to browse, etc.). Furthermore, existing app functions also include text editing, note text, table editing, image editing, stickers, theme editing, plug-ins (including time plug-ins, QR code barcode plug-ins, voice input plug-ins), and graffiti editing. However, each small control is drawn little by little by Android and iOS developers using canvas technology, which is very slow and costly to implement. In addition, a large number of finger movements (dragging and dropping), zooming in and out, editing text, changing text, etc. have caused the App memory to be unstable and caused the App to crash. In addition, there are currently no double-click events in the App function. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] The present invention aims to solve the problems of slow speed, inconsistency, high cost, high crash rate, etc. of native drawing, editing, moving (dragging and dropping), rotation and scaling in Android and iOS, shorten the development cycle, avoid online accidents (especially App crash accidents), improve work efficiency, and further optimize the image generation method.
[0008] (II) Technical solution
[0009] In order to solve the above technical problems, one aspect of the present invention proposes a method for generating images based on a Web page, which is applied to a terminal and generates images according to user operations on the terminal. The method comprises the following steps: accepting user operations; generating Web page codes according to user operations, and parsing the Web page codes to generate a Web page; and converting the Web page into an image.
[0010] Optionally, according to a preferred embodiment of the present invention, the Web page is composed of page elements, the Web page code is composed of codes of the page elements, and generating the Web page code according to user operations includes: generating the page elements that constitute the Web page and the codes of the page elements respectively according to the user operations.
[0011] Optionally, the method further includes: receiving a user's operation on the page element, changing parameters in the code of the page element according to the operation on the page element, and redrawing the page element on the web page.
[0012] Optionally, the operation on the page element includes at least one of the following: moving, scaling, rotating, and flipping.
[0013] Optionally, the operation on the page element is rotation, and the parameters in the code of the page element include an arrangement angle; changing the parameters in the code of the page element according to the operation on the page element includes: recording an initial angle formed by two rotating contacts and a current angle formed by two rotating contacts in motion, calculating a rotation direction and a rotation angle based on a difference between the initial angle and the current angle, and calculating the arrangement angle based on the rotation direction and the rotation angle.
[0014] Optionally, the operation on the page element is zooming, and the parameters in the code of the page element include zoom ratio parameters; changing the parameters in the code of the page element according to the operation on the page element includes: recording an initial distance formed by two moving contacts and a current distance formed by two moving contacts in motion, and determining the zoom ratio parameter by dividing the current distance by the initial distance.
[0015] Optionally, generating the page elements constituting the Web page and the codes of the page elements respectively according to the user operation includes: generating the codes of the page elements by a page element code module according to the user operation.
[0016] Optionally, the page element code module includes at least one of the following: a text template, a picture module, a graphic template, and a background template.
[0017] Optionally, the page elements include pictures, and generating the page elements constituting the Web page and the codes of the page elements according to user operations respectively includes: generating the picture according to the user operation, saving the picture and generating the Web page code of the picture.
[0018] The second aspect of the present invention proposes a web page-based image generation device, comprising the following modules: an input module for accepting user operations; a page generation module for generating web page codes according to user operations and parsing the web page codes to generate web pages; a conversion module for converting the web page into an image.
[0019] The third aspect of the present invention proposes a printing device that generates and prints pictures according to the user's operations on a terminal, including a picture generating device and a printing device. The picture generating device is used to generate pictures according to the user's operations and send the generated pictures to the printing device. The printing device is used to print the pictures. The picture generating device can execute the picture generating method described in the present invention.
[0020] A fourth aspect of the present invention provides a computer-readable medium storing a computer-executable program, which, when executed, implements the image generation method of the present invention.
[0021] (III) Beneficial effects
[0022] Compared with the prior art, the present invention can quickly realize the functions of moving (dragging and dropping), rotating, flipping, scaling and the like of the page block-level operation area through the Web Html tag in a block structure, and can also simulate a double-click event to realize the terminal double-click operation, without the need for developers to use canvas technology to draw it bit by bit, thereby reducing the development cost; through the complementary advantages of Web page technology and App, the functions of drawing, editing, moving (dragging and dropping), rotating, flipping and scaling of the page module are realized, thereby ensuring the consistency of the App end and the web page front end, improving the work efficiency of developers, reducing the flash back rate, optimizing the image generation method, and ensuring the healthy operation of the App. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flowchart of an example of a method for generating a picture according to the present invention;
[0024] Figure 2 is a block diagram of an example of an application scenario of the image generation method of the present invention;
[0025] Figure 3 It is a schematic block diagram of data interaction between the App end and the Web end of the image generation method of the present invention;
[0026] Figure 4 It is a schematic diagram of the principle of a terminal double-click event according to the picture generation method of the present invention;
[0027] Figure 5 is a flowchart of another example of the picture generating method of the present invention;
[0028] Figure 6 is a schematic block diagram of an example of a picture generating device of the present invention;
[0029] Figure 7 is a schematic block diagram of another example of a picture generating device of the present invention;
[0030] Figure 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
[0031] Fig. 9 is a schematic diagram of a computer-readable recording medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In the process of introducing specific embodiments, the detailed description of the structure, performance, effect or other characteristics is to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can implement the present invention with a technical solution that does not contain the above-mentioned structure, performance, effect or other characteristics under certain circumstances.
[0033] The flowchart in the accompanying drawings is only an exemplary process demonstration, and does not mean that the solution of the present invention must include all the contents, operations and steps in the flowchart, nor does it mean that it must be executed in the order shown in the figure. For example, some operations / steps in the flowchart can be decomposed, some operations / steps can be combined or partially combined, etc. The execution order shown in the flowchart can be changed according to the actual situation without departing from the main purpose of the present invention.
[0034] Frames in the attached figure Figure 1 Generally, it refers to functional entities, which do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processing unit devices and / or microcontroller devices.
[0035] The same reference numerals in the drawings represent the same or similar elements, components or parts, and thus the repeated description of the same or similar elements, components or parts may be omitted below. It should also be understood that although the first, second, third and other attributives representing the numbers may be used herein to describe various devices, elements, components or parts, these devices, elements, components or parts should not be limited by these attributives. In other words, these attributives are only used to distinguish one from another. For example, the first device may also be called the second device, but it does not deviate from the essential technical solution of the present invention. In addition, the terms "and / or" and "and / or" refer to all combinations including any one or more of the listed items.
[0036] To solve the above technical problems, the present invention proposes a method for generating images based on a Web page, which is applied to a terminal and generates images according to user operations on the terminal. The method comprises the following steps: accepting user operations; generating Web page codes according to user operations, and parsing the Web page codes to generate a Web page; and converting the Web page into an image.
[0037] In the present invention, by using, for example, the CSS box model at the front end of the Web page to change the parameters in the page code, specifically, through the Web Html tag in a block structure, it is possible to quickly realize the functions of moving (dragging and dropping), rotating, flipping, scaling, etc. of the page block-level operation area, and realize the editing, moving (dragging and dropping), rotating, flipping, scaling, etc. of the mobile App, without the need for developers to use canvas technology to draw it bit by bit, thereby reducing the development cost; by combining web page technology with the functions of the App itself, the drawing, editing, moving (dragging and dropping), rotating, scaling, flipping, etc. of the page module can be realized, thereby realizing more optimized product functions.
[0038] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0039] In the process of introducing specific embodiments, the detailed description of the structure, performance, effect or other characteristics is to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can implement the present invention with a technical solution that does not contain the above-mentioned structure, performance, effect or other characteristics under certain circumstances.
[0040] The flowchart in the accompanying drawings is only an exemplary process demonstration, and does not mean that the solution of the present invention must include all the contents, operations and steps in the flowchart, nor does it mean that it must be executed in the order shown in the figure. For example, some operations / steps in the flowchart can be decomposed, some operations / steps can be combined or partially combined, etc. The execution order shown in the flowchart can be changed according to the actual situation without departing from the main purpose of the present invention.
[0041] Frames in the attached figure Figure 1 Generally, it refers to functional entities, which do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processing unit devices and / or microcontroller devices.
[0042] The same reference numerals in the drawings represent the same or similar elements, components or parts, and thus the repeated description of the same or similar elements, components or parts may be omitted below. It should also be understood that although the first, second, third and other attributives representing the numbers may be used herein to describe various devices, elements, components or parts, these devices, elements, components or parts should not be limited by these attributives. In other words, these attributives are only used to distinguish one from another. For example, the first device may also be called the second device, but it does not deviate from the essential technical solution of the present invention. In addition, the terms "and / or" and "and / or" refer to all combinations including any one or more of the listed items.
[0043] The terms used in the present invention and their explanations are as follows.
[0044] Android and iOS native refers to the way Android and iOS developers achieve it without the help of other technologies.
[0045] Canvas mainly refers to some controls that are not available in Android and IOS, which are implemented in the form of canvas.
[0046] Web refers to web page technology.
[0047] The crash rate refers to the rate at which an App crashes and crashes.
[0048] Text editing is similar to Word, which can edit text, change size, font, center and other functions.
[0049] Table editing means that editing functions similar to Word can be realized.
[0050] Image editing refers to the ability to implement functions such as image filters and cropping.
[0051] Theme editing is similar to photo frame background.
[0052] Graffiti editing means that the mobile app canvas has realized the painting function.
[0053] Touch refers to the touch event on the mobile phone, which is divided into start and move.
[0054] Action refers to the way a web page sends a data request to an App.
[0055] Example 1
[0056] Next, we will refer to Figures 1 to 5 A specific embodiment of the picture generating method of the present invention is described.
[0057] Figure 1 A flowchart showing an example of a method for generating a picture according to the present invention is shown.
[0058] like Figure 1 As shown, the image generation method includes the following steps.
[0059] Step S101, accepting user operation.
[0060] Step S102: Generate a Web page code according to the user operation, and parse the Web page code to generate a Web page.
[0061] Step S103: convert the Web page into a picture.
[0062] Figure 2 A block diagram showing an example of an application scenario of a page layout method according to an embodiment of the present invention.
[0063] Specifically, in Figure 2 In the visual interface shown, in the page module, the user moves and crops the inserted picture, for example. The server changes the corresponding parameters in the code of the picture according to the user's movement and cropping of the picture and redraws the page elements on the display page module to generate a new picture.
[0064] Furthermore, when the user uses the graffiti function of the APP itself, that is, clicks the graffiti function button of the App module, the server returns data corresponding to the graffiti to the user, so that the user can perform operations such as graffiti on the page module.
[0065] It should be noted that the above is only an example and cannot be understood as a limitation of the present invention. In addition, the image generation method of the present invention also includes data interaction between the App end and the Web end. For details, see Figure 3 .
[0066] In the data exchange between the App and Web, for example, when the Web calls the App, both parties need to communicate and agree on a protocol in advance. For example, if you want to click a Web page link to jump to the App homepage, you can set the protocol name as xr: / / home and the HTML content as <a href="xr: home”> View Home Page >> , clicking the link will change the URL, and the native WebView proxy method will be triggered. The agreed protocol is implemented by monitoring the URL changes in the proxy method.
[0067] On the other hand, App calls Web, for example, using the calling method of JSString (JavaScriptString), and pre-defines a global method on the Web side. Specifically, this method is implemented by using the Webview to execute the above calling method, which can directly return the value to the App side, but usually the Web side will perform some operations after receiving the message from the App.
[0068] It should be noted that the above data interaction process is only described as an example and should not be construed as a limitation to the present invention.
[0069] In this example, the image generation method of the present invention is applied to a terminal, and an image is generated according to an operation of a user on the terminal. The specific image generation process will be described in detail below.
[0070] Next, in step S101 , a user operation is accepted.
[0071] Specifically, an operation of a user on a page element is received, and according to the operation on the page element, a parameter in the code of the page element is changed and the page element is redrawn on the Web page.
[0072] In this example, the user operation includes text input and touch operation, etc. The touch operation includes mobile terminal clicking, moving (dragging), zooming, rotating, flipping, etc.
[0073] Optionally, the page layout can be implemented through the flex (flexible box, referred to as: elastic layout box model) flexible layout in CSS. Further, Web Html tags in a block structure can be used to implement functions such as clicking, moving (dragging), scaling, rotating, and flipping of page modules.
[0074] Next, in step S102, a Web page code is generated according to the user operation, and the Web page code is parsed to generate a Web page.
[0075] Specifically, a Web page is composed of page elements, a Web page code is composed of the codes of the page elements, and the Web page code is generated according to user operations. More specifically, the page elements constituting the Web page and the codes of the page elements are generated respectively according to user operations.
[0076] Furthermore, page elements include various elements such as text, pictures, audio, animation, video, etc.
[0077] Furthermore, the page element code module generates the code of the page element according to the user operation.
[0078] In this example, the page element code module includes at least one of the following: a text template, a picture module, a graphic template, and a background template.
[0079] In one example, a user rotates an inserted picture or other page element. In this case, the parameters in the page code include an arrangement angle. According to the rotation operation on the picture, the parameters in the page code that need to be changed include: recording an initial angle formed by two rotating contacts and a current angle formed by two moving rotating contacts, calculating a rotation direction and an angle based on a difference between the initial angle and the current angle, and calculating the arrangement angle based on the rotation direction and the rotation angle. Thus, the user in the page module can quickly rotate the picture, i.e., the rotation function of the page module is realized, and the consistency between the App and web front-end is ensured. Developers do not need to use canvas technology to draw it bit by bit, which improves the work efficiency of developers, reduces development costs, and reduces the crash rate.
[0080] In another example, the user performs a zoom operation on the inserted picture or other page elements. In this case, the parameters in the page code include a zoom ratio parameter. According to the zoom operation on the picture, changing the parameters in the page code includes: recording the initial distance formed by the two moving contacts and the current distance formed by the two moving contacts in motion, and determining the zoom ratio parameter by dividing the current distance by the initial distance. In this way, the user in the page module can quickly move the picture, that is, realize the moving function of the page module, and ensure the consistency of the App side and the web page front-end. There is no need for developers to use canvas technology to draw it bit by bit, which improves the work efficiency of developers, reduces development costs, and reduces the crash rate.
[0081] In another example, after the user scales, rotates, and crops the inserted pictures and other page elements, further, when the user completes text input, the App will call the global method of the Web to pass data, that is, pass the text data entered by the user. Specifically, the Web side obtains the text data entered by the user, and sends the data to the App side using methods such as Action. After the App side receives the corresponding text data returned from the server, it displays it accordingly in the input box.
[0082] The above example combines Web page technology with the functions of the App itself to implement drawing, text editing and other functions of the page module, ensuring the consistency between the App and the web front end and ensuring the healthy operation of the App.
[0083] It should be noted that the above is only used as an example and cannot be understood as a limitation of the present invention. In other examples, the App side can directly transmit the relevant data to the Web side.
[0084] Next, in step S103, the Web page is converted into a picture.
[0085] In this example, an image is generated according to a user operation. Specifically, for example, after a user performs operations such as cropping, rotating, and graffiti on a photo, a final image is generated, the image is saved, a web page code for the image is generated, the image is displayed in a page module, and the processed image is printed (S501). Figure 5 .
[0086] In order to further explain the principles of each operation in the image generation method, the process of setting or changing parameters in the page code will be explained.
[0087] In order to solve the problem that there is no double-click event on the external Web page, the present invention simulates the double-click event on the mobile terminal through the CSS box model at the front end of the Web page to realize the user's double-click operation in the user display page on the App side, thereby optimizing the image processing function on the App side.
[0088] Figure 4 A schematic diagram showing the principle of a terminal double-click event in the picture generation method according to the present invention is shown.
[0089] like Figure 4As shown, by recording the coordinate position (X, Y) of the touch start point touch start (t1 moment), when the next click is made, the coordinate position (X', Y') of the current click touch start (t2 moment) is recorded. If the distance between the start point and the current point is within a predetermined distance range and the interval between the two clicks is within a predetermined time period, it is identified as a double-click event, and based on the user's double-click operation, the corresponding data of the terminal is returned to realize related display or graphic processing.
[0090] It should be noted that the predetermined distance range r is preferably 0 to 10 pixel distances, and the predetermined time period (t2-t1) is preferably 0 milliseconds to 300 milliseconds. The above is only an example and should not be construed as limiting the present invention.
[0091] In addition, for the user's dragging and dropping operations on the page module, similarly, the user's touch start point and current position during movement are recorded, and the updated position is obtained to implement the dragging, pulling, and dropping functions on the page module.
[0092] It should be noted that the above-mentioned process of the image generation method is a necessary step to implement the present method and is only used to illustrate the present invention. There is no particular limitation on the order and number of the steps. In addition, the steps in the above-mentioned method can also be split into two or three steps (for example, step S103 can be split into steps S103 and S501, see Figure 5 ), or some steps can also be combined into one step, and adjusted according to the actual example. In addition, in other embodiments, the Web page can also be converted into a picture by other web page technologies.
[0093] Compared with the prior art, the present invention can quickly realize the functions of moving (dragging and dropping), rotating, flipping, scaling and the like of the page block-level operation area through the Web Html tag in a block structure, and can also simulate a double-click event to realize the terminal double-click operation, without the need for developers to use canvas technology to draw it bit by bit, thereby reducing the development cost; by combining Web page technology with the functions of the App itself, the drawing, editing, moving (dragging and dropping), rotating, flipping and scaling and the like of the page module are realized, thereby ensuring the consistency between the App end and the web page front end, improving the work efficiency of developers, reducing the flash back rate, optimizing the image generation method, and ensuring the healthy operation of the App.
[0094] The following describes an embodiment of the image generation device of the present invention, which can be used to execute the method embodiment of the present invention. The details described in the device embodiment of the present invention should be regarded as supplementary to the above method embodiment; details not disclosed in the device embodiment of the present invention can be implemented with reference to the above method embodiment.
[0095] Example 2
[0096] Refer to the figure Figure 6 and Figure 7 The present invention also provides a web page-based image generation device 600, which includes the following modules: an input module 601, used to accept user operations; a page generation module 602, used to generate web page codes according to user operations, and parse the web page codes to generate web pages; a conversion module 603, used to convert the web page into an image.
[0097] like Figure 7 As shown, the image generating device 600 also includes a receiving module 701, and the receiving module 702 is used to receive the user's operation on the page element, and according to the operation on the page element, change the parameters in the code of the page element and redraw the page element on the web page.
[0098] Optionally, the operation on the page element includes at least one of the following: moving, scaling, rotating, and flipping.
[0099] Optionally, the operation on the page element is rotation, and the parameters in the code of the page element include an arrangement angle; changing the parameters in the code of the page element according to the operation on the page element includes: recording an initial angle formed by two rotating contacts and a current angle formed by two rotating contacts in motion, calculating a rotation direction and a rotation angle based on a difference between the initial angle and the current angle, and calculating the arrangement angle based on the rotation direction and the rotation angle.
[0100] Optionally, the operation on the page element is zooming, and the parameters in the code of the page element include zoom ratio parameters; changing the parameters in the code of the page element according to the operation on the page element includes: recording an initial distance formed by two moving contacts and a current distance formed by two moving contacts in motion, and determining the zoom ratio parameter by dividing the current distance by the initial distance.
[0101] Optionally, generating the page elements constituting the Web page and the codes of the page elements respectively according to the user operation includes: generating the codes of the page elements by a page element code module according to the user operation.
[0102] Optionally, the page element code module includes at least one of the following: a text template, a picture module, a graphic template, and a background template.
[0103] Optionally, the page elements include pictures, and generating the page elements constituting the Web page and the codes of the page elements according to user operations respectively includes: generating the picture according to the user operation, saving the picture and generating the Web page code of the picture.
[0104] Example 3
[0105] The electronic device embodiment of the present invention is described below, and the electronic device can be regarded as a specific physical implementation of the method and device embodiments of the present invention described above. The details described in the electronic device embodiment of the present invention should be regarded as a supplement to the method or device embodiments described above.
[0106] Figure 8 It is a structural diagram of an electronic device of an embodiment of the present invention, the electronic device includes a processor and a memory, the memory is used to store a computer executable program, when the computer program is executed by the processor, the processor executes a method for generating an image based on a Web page.
[0107] Optionally, the present invention also provides a printing device that generates and prints pictures according to user operations on a terminal, including a printing device and a picture generating device of the present invention, wherein the picture generating device is used to generate pictures according to user operations and send the generated pictures to the printing device, wherein the printing device is used to print the pictures, and the picture generating device can execute the picture generating method described in the present invention.
[0108] like Figure 8 As shown, the electronic device is presented in the form of a general computing device. The processor may be one or more and work in coordination. The present invention does not exclude distributed processing, that is, the processor may be dispersed in different physical devices. The electronic device of the present invention is not limited to a single entity, but may also be the sum of multiple physical devices.
[0109] The memory stores a computer executable program, which is usually a machine-readable code. The computer-readable program can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least part of the steps in the method.
[0110] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).
[0111] Optionally, in this embodiment, the electronic device further includes an I / O interface, which is used for the electronic device to exchange data with an external device. The I / O interface can represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.
[0112] It should be understood that Figure 8The electronic device shown is only an example of the present invention, and the electronic device of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as display screens, and some electronic devices also include human-computer interaction elements such as buttons, keyboards, etc. As long as the electronic device can execute the computer-readable program in the memory to implement the method of the present invention or at least part of the steps of the method, it can be considered as an electronic device covered by the present invention.
[0113] Fig. 9 Schematic diagram of a computer readable recording medium according to an embodiment of the present invention. Fig. 9 As shown, a computer executable program is stored in a computer-readable recording medium, and when the computer executable program is executed, the above-mentioned method for generating pictures based on Web pages of the present invention is implemented. The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0114] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0115] Through the above description of the implementation mode, it is easy for those skilled in the art to understand that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and the electronic processing unit, server, client, mobile phone, control unit, processor, etc. contained in the system. The present invention can also be implemented by a vehicle comprising at least a part of the above system or components. The present invention can also be implemented by computer software that executes the method of the present invention, such as control software executed by a microprocessor, an electronic control unit, a client, a server, etc. on the locomotive side. However, it should be noted that the computer software that executes the method of the present invention is not limited to being executed by one or a specific hardware entity, and it can also be implemented in a distributed manner by unspecified specific hardware, such as some method steps executed by the computer program can be executed on the locomotive side, and another part can be executed in a mobile terminal or a smart helmet, etc. For computer software, the software product can be stored in a computer-readable storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.), or it can be distributed and stored on the network, as long as it enables the electronic device to execute the method according to the present invention.
[0116] Through the above description of the implementation mode, it is easy for those skilled in the art to understand that the present invention can also be applied to other products including the interaction between computer applications and HTML pages, which are not fully described in the above description of the embodiment. For example, the mobile terminal drawing, editing, moving (drag and drop), rotating or zooming functions are realized on the browser page.
[0117] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating an image based on a Web page, applied to a terminal, generating an image according to an operation of a user on the terminal, characterized in that: include: Accept user operations; Generate page elements constituting a web page and web page codes of the page elements respectively according to user operations, and parse the web page codes to generate a web page; wherein receiving a user's operation on a page element, changing a parameter in a code of the page element according to the operation on the page element, and redrawing the page element on the Web page; The operation on the page elements includes text input and touch operation, wherein the touch operation includes at least one of the following: click, move, zoom, rotate, flip, wherein the page layout is realized by elastic layout of the elastic layout box model in CSS, and the click, move, zoom, rotate, flip of the page module is realized by using the Web Html tag in a block structure; Wherein, the page element code module generates the web page code according to the user operation and parses the web page code to generate the web page; When the user operates the page element after scaling, rotating and cropping the page element and completing the text input, the Web side obtains the text data by calling the Web global method or directly passing the text data input by the user through the App side, and the Web side sends the data to the App side through the Action method. After the App side receives the corresponding text data sent back from the server, it displays it in the input box. The consistency between the App side and the Web page front end is ensured by combining the functions of the Web side and the App side; and, on the Web page front end, the mobile double-click event is simulated through the elastic layout box model in CSS to realize the user double-click operation in the user display page of the App side; The web page is converted into a picture, the picture is saved and displayed in the page module.
2. The image generation method according to claim 1, characterized in that: Also includes: The operation on the page element is rotation, and the parameters in the code of the page element include an arrangement angle; The changing of the parameters in the code of the page element according to the operation on the page element comprises: recording an initial angle formed by two rotating contacts and a current angle formed by two rotating contacts in motion, calculating a rotation direction and a rotation angle based on a difference between the initial angle and the current angle, and calculating the arrangement angle according to the rotation direction and the rotation angle; and / or, The operation on the page element is scaling, and the parameters in the code of the page element include scaling ratio parameters; Changing the parameters in the code of the page element according to the operation on the page element includes: recording an initial distance formed by two moving contacts and a current distance formed by two moving contacts, and determining a scaling parameter by dividing the current distance by the initial distance.
3. The image generation method according to any one of claims 1 to 2, characterized in that: Also includes: When the user performs a drag and drop operation on the page module, the user's touch start point and the current position during the movement are recorded, and the updated position is obtained to realize the drag, drop, and drop functions on the page module.
4. The image generation method according to claim 3, characterized in that: The page element code module includes at least one of the following: a text template, a picture module, a graphic template, and a background template.
5. The image generation method according to claim 1, characterized in that: The page elements include pictures.
6. A web page-based image generation device, characterized in that: include: Input module, used to accept user operations; A page generation module, used to generate page elements constituting the web page and web page codes of the page elements according to user operations, and parse the web page codes to generate a web page; A conversion module, used to convert the web page into an image, save the image and display it in the page module; A receiving module, used for receiving a user's operation on a page element, changing parameters in the code of the page element according to the operation on the page element, and redrawing the page element on the Web page; The operation on the page element includes text input and touch operation, wherein the touch operation includes at least one of the following: click, move, zoom, rotate, flip, wherein the page layout is realized by the elastic layout of the elastic layout box model in CSS, and the click, move, zoom, rotate, flip of the page module is realized by using the Web Html tag in a block structure; wherein the Web page code is generated by the page element code module according to the user operation and the Web page code is parsed to generate the Web page; when the user operates the page element after the page element is zoomed, rotated and cropped and the text input is completed, the text data is obtained by the Web end by calling the Web global mode or directly transmitting the text data input by the user on the APP end, the Web end sends data to the App end through the Action mode, and the App end displays the corresponding text data returned from the server in the input box, and the consistency of the APP end and the Web page front end is ensured by combining the functions of the Web end and the APP end; and, at the front end of the Web page, the mobile double-click event is simulated by the elastic layout box model in CSS to realize the user double-click operation in the user display page of the APP end.
7. A printing device, which generates and prints pictures according to user operations on a terminal, comprises a picture generating device and a printing device, wherein the picture generating device is used to generate pictures according to user operations and send the generated pictures to the printing device, and the printing device is used to print the pictures, characterized in that: The image generation device is capable of executing the image generation method according to any one of claims 1 to 5.
8. A computer-readable medium storing a computer-executable program, characterized in that: When the computer executable program is executed, the image generation method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method of Printing a Selected Element within a Web Page
AU2004201773A1
Touch response accelerating method based on mobile web
CN103176659A
System and method for dynamically converting webpage, and computer-readable recording medium
CN104380280A
Web page generation method and apparatus
CN105447096A
Method, device, apparatus and medium for moving display of page element
CN109062471A
