CN112825020A - Picture generation method and device, computer equipment and storage medium - Google Patents
Picture generation method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112825020A CN112825020A CN201911140849.8A CN201911140849A CN112825020A CN 112825020 A CN112825020 A CN 112825020A CN 201911140849 A CN201911140849 A CN 201911140849A CN 112825020 A CN112825020 A CN 112825020A
- Authority
- CN
- China
- Prior art keywords
- page
- initial
- picture
- updated
- interception
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000009877 rendering Methods 0.000 claims abstract description 22
- 230000006870 function Effects 0.000 claims description 28
- 230000000007 visual effect Effects 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 239000003973 paint Substances 0.000 description 2
- 238000010422 painting Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003997 social interaction Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction 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/04845—Interaction 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 for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Processing Or Creating Images (AREA)
Abstract
The application relates to a picture generation method and device, computer equipment and a storage medium. The method comprises the following steps: displaying an initial page through a terminal; when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation; re-rendering the initial page according to the page editing information to obtain an updated page; when the interception operation of the updated page occurs, acquiring a corresponding page interception parameter according to the interception operation; and intercepting the updated page according to the page interception parameter to generate a target picture. By adopting the method, the picture generation efficiency can be improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a picture, a computer device, and a storage medium.
Background
With the development of computer technology, poster images generated according to background images and basic data structures are widely used. The poster picture completely combines elements such as pictures, characters, colors, spaces and the like, and shows propaganda information to people in a proper form. At present, the generation of poster pictures is mainly carried out at a server, the server generates the poster pictures according to the background pictures and basic data structures of poster templates, and then the generated poster pictures are returned to a front-end application.
However, the traditional poster picture generation method is too dependent on a server, so that the poster picture generation efficiency is low.
Disclosure of Invention
In view of the above, it is necessary to provide a picture generation method, an apparatus, a computer device, and a storage medium capable of improving poster picture generation efficiency in view of the above technical problems.
A picture generation method, performed by a terminal, the method comprising:
displaying an initial page through a terminal;
when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation;
re-rendering the initial page according to the page editing information to obtain an updated page;
when the interception operation of the updated page occurs, acquiring a corresponding page interception parameter according to the interception operation;
and intercepting the updated page according to the page interception parameter to generate a target picture.
A picture generation apparatus, the apparatus comprising:
the display module is used for displaying the initial page through the terminal;
the information acquisition module is used for acquiring page editing information for editing the initial page according to the editing operation when the editing operation on the initial page occurs;
the rendering module is used for re-rendering the initial page according to the page editing information to obtain an updated page;
the parameter acquisition module is used for acquiring corresponding page interception parameters according to the interception operation when the interception operation of the updated page occurs;
and the interception module is used for intercepting the updated page according to the page interception parameter so as to generate a target picture.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
displaying an initial page through a terminal;
when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation;
re-rendering the initial page according to the page editing information to obtain an updated page;
when the interception operation of the updated page occurs, acquiring a corresponding page interception parameter according to the interception operation;
and intercepting the updated page according to the page interception parameter to generate a target picture.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
displaying an initial page through a terminal;
when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation;
re-rendering the initial page according to the page editing information to obtain an updated page;
when the interception operation of the updated page occurs, acquiring a corresponding page interception parameter according to the interception operation;
and intercepting the updated page according to the page interception parameter to generate a target picture.
According to the picture generation method and device, the computer equipment and the storage medium, the initial page is displayed through the terminal, so that a user can directly edit the initial page at the terminal under the visual condition. And the terminal re-renders the initial page according to the page editing information edited by the user to obtain an updated page. And then, the updated page can be intercepted according to the page interception parameter to generate a target picture. Therefore, the user can directly edit the initial page on the terminal, the terminal can directly generate the picture from the display content of the updated page directly seen by the user, communication with the server is not needed, and the picture generation efficiency is greatly improved.
Drawings
FIG. 1 is a diagram of an application scenario of a picture generation method in one embodiment;
FIG. 2 is a flow chart illustrating a method for generating a picture according to an embodiment;
FIG. 3 is a flow chart illustrating a method for generating a picture according to another embodiment;
FIG. 4 is a block diagram showing the structure of a picture generation apparatus according to an embodiment;
FIG. 5 is a block diagram showing the construction of a picture generation apparatus according to another embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The webpage generation method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a terminal 102 and a server 104. The terminal 102 and the server 104 communicate via a network. The terminal 102 may obtain information corresponding to the initial page from the server 104 and display the initial page. When an editing operation for an initial page occurs, the terminal 102 acquires page editing information for editing the initial page according to the editing operation. And the terminal 102 re-renders the initial page according to the page editing information to obtain an updated page. When the interception operation of the updated page occurs, the terminal 102 acquires the corresponding page interception parameter according to the interception operation. And the terminal 102 intercepts the updated page according to the page interception parameter to generate a target picture. The terminal 102 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers. Those skilled in the art will understand that the application environment shown in fig. 1 is only a part of the scenario related to the present application, and does not constitute a limitation to the application environment of the present application.
In one embodiment, as shown in fig. 2, a method for generating a picture is provided, which is described by taking the method as an example applied to the terminal 102 in fig. 1, and includes the following steps:
and S202, displaying the initial page through the terminal.
The initial page is a page displayed by default when the terminal is started. Specifically, the terminal can obtain an initial background picture and page initial configuration information corresponding to the initial page from the server, and then the terminal can render the initial background picture and page initial configuration information corresponding to the initial page locally to generate the initial page, and the initial page is displayed through the terminal. The initial background picture is a picture corresponding to the background of the initial page. The page initial configuration information is configuration information corresponding to each element in the initial page, for example, a type, position information, size, and style of each element in the initial page.
In an embodiment, the initial background picture may specifically be a network picture, or may be a picture stored locally in the terminal. The initial background picture is not editable, and various page elements such as pictures and characters can be added on the initial background picture.
In an embodiment, the step S202, that is, the step of displaying the initial page through the terminal specifically includes: acquiring an initial background picture and corresponding page initial configuration information; rendering the initial background picture and the page initial configuration information through a WebView (web view control) to generate an initial page; and displaying the initial page through the terminal.
The WebView is a very important control on the terminal and is used for displaying a web page. Specifically, the server stores an initial background picture corresponding to the initial page and corresponding page initial configuration information, and the terminal can acquire the initial background picture and the corresponding page initial configuration information from the server. The terminal is provided with a network view control which has the function of rendering pages. The terminal can perform rendering operation on the initial background picture and the initial page configuration information through the network view control to generate an initial page, and the rendered page is displayed through the terminal.
Therefore, the initial background picture and the corresponding page initial configuration information are rendered and displayed on the terminal, so that the user can visually see the content of the initial page, the initial page can be directly edited on the terminal according to the displayed content of the initial page, and the editing efficiency of the user is improved.
S204, when the editing operation of the initial page occurs, page editing information for editing the initial page is obtained according to the editing operation.
The editing operation is an operation performed on the initial background picture and the page initial configuration information in the initial page. The page editing information is information generated by operating the initial background picture and the page initial configuration information in the initial page.
Specifically, the terminal is provided with an editing button capable of editing the initial page, and the editing button can be triggered through triggering operation, so that the corresponding editing operation can be performed on the initial page. And the terminal can acquire page editing information for editing the initial page according to the editing operation. The trigger operation may specifically be a touch operation, a cursor operation, a key operation, or a voice operation. The touch operation can be touch click operation, touch press operation or touch slide operation, and the touch operation can be single-point touch operation or multi-point touch operation; the cursor operation can be an operation of controlling a cursor to click or an operation of controlling the cursor to press; the key operation may be a virtual key operation or a physical key operation, etc.
In one embodiment, the page editing information may specifically include updating background pictures and page update configuration information. Through editing operation, the initial background picture of the initial page can be replaced by the updated background picture, and the initial configuration information of the initial page can be modified into page update configuration information. For example, the type, position information, size and style of each element in the initial page are modified. The type of the element may be a picture or a text, the position information of the element may specifically be coordinates of the element in a page, the size of the element may specifically be a length and a width corresponding to the element, and the style of the element may specifically be a color, a transparency, a rotatable angle, and the like of the element. The present embodiment is not limited herein.
And S206, re-rendering the initial page according to the page editing information to obtain an updated page.
And re-rendering is that the terminal reloads and displays the page according to the page editing information. Specifically, the terminal may obtain page editing information generated by the editing operation, and the terminal may re-render the initial page according to the page editing information, so as to obtain an updated page.
In an embodiment, the step S206, that is, the step of re-rendering the initial page according to the page editing information to obtain the updated page specifically includes: replacing the initial background picture in the initial page by the updated background picture; according to the page updating configuration information, modifying the page initial configuration information of the initial page; the page initial configuration information comprises at least one of the type, the position information, the size and the style of each element in the initial page; and loading the updated background picture and the page update configuration information through the network view control to generate an updated page, and replacing the initial page for displaying.
Specifically, the page editing information includes an update background picture and page update configuration information. The terminal can obtain the updated background picture from the server or the local memory of the terminal. The terminal can replace the initial background picture in the initial page with the acquired updated background picture. The user can operate each element in the initial page, and based on the user operation, the terminal can obtain corresponding page updating configuration information. And the terminal can correspondingly modify the page initial configuration information of the initial page according to the acquired page updating configuration information. The terminal can load the updated background picture and the page updating configuration information through the network view control, re-render the initial page, generate an updated page and display the updated page through the terminal.
Therefore, the updated background picture is used for replacing the initial background picture, the page initial configuration information is modified according to the page updated configuration information, so that the user can edit the initial page in a personalized manner according to own preference, and the personalized requirements of the user on the picture are met.
And S208, when the interception operation of the updated page occurs, acquiring the corresponding page interception parameter according to the interception operation.
The page interception parameter is parameter information corresponding to an intercepted area when the updated page is intercepted. Such as the position coordinates, length and width of the truncated region. Specifically, when the terminal detects an interception operation on the updated page, the terminal may obtain a page interception parameter corresponding to the interception operation according to the interception operation.
In an embodiment, when the terminal detects an interception operation on an updated page, the terminal may call an API (Application Programming Interface) function corresponding to the WebView, read a page interception parameter pointed by the interception operation, and store the read page interception parameter in a memory of the terminal.
And S210, intercepting the updated page according to the page interception parameter to generate a target picture.
Specifically, the terminal can read page interception parameters from a local memory, intercept an updated page according to the read page interception parameters, use an intercepted picture as a target picture, and cache the target picture in a cache region of the terminal.
In one embodiment, an interception button is arranged on the page, and an interception operation can be performed on the updated page through the interception button. When the terminal detects that the interception operation occurs, the terminal can call an API function corresponding to the WebView, read the page interception parameter corresponding to the interception operation, and store the read page interception parameter into a memory of the terminal. The terminal can draw the updated page as a corresponding updated picture, and the terminal can read corresponding page interception parameters from the local memory to intercept the updated picture so as to obtain the target picture.
In one embodiment, the generated target picture may specifically be a poster picture. And when the updated page is intercepted after being loaded by the WebView, the terminal can call the API function corresponding to the WebView, read the page interception parameter pointed by the interception operation, and store the read page interception parameter into the memory of the terminal. The terminal can create a View (visual area) and set the visual size of the View to be the actual size of the page displayed by the WebView, so that the visual size of the View is consistent with the actual size of the page displayed by the WebView. The terminal can add the pixel points corresponding to the page displayed by the WebView to the View. The terminal can create a canvas with the size consistent with that of the View, and draw the content of the corresponding update page in the View into an update picture by calling Core Graphics (built-in function) by using the canvas. And the terminal reads page interception parameters in the memory of the terminal to intercept the updated picture by calling Core Graphics (built-in function) so as to obtain the poster picture, and stores the poster picture in the memory of the terminal.
In the picture generation method, the initial page is displayed through the terminal, so that a user can directly edit the initial page at the terminal under the visual condition. And the terminal re-renders the initial page according to the page editing information edited by the user to obtain an updated page. And then, the updated page can be intercepted according to the page interception parameter to generate a target picture. Therefore, the user can directly edit the initial page on the terminal, the terminal can directly generate the picture from the display content of the updated page directly seen by the user, communication with the server is not needed, and the picture generation efficiency is greatly improved.
In an embodiment, step S208, that is, when an interception operation on an updated page occurs, the step of obtaining a corresponding page interception parameter according to the interception operation specifically includes: when the interception operation of the updated page is detected to occur, calling an application program interface function corresponding to the network view control; and reading a page interception parameter pointed by the interception operation according to an application program interface function corresponding to the network view control.
Specifically, an interception button is arranged in an updated page displayed by the terminal, a user can realize interception operation on the updated page by triggering the interception button, and based on the interception operation, the terminal can generate a page interception parameter corresponding to the interception operation. When the terminal detects that the interception operation of the updated page occurs, the terminal can call an application program interface function corresponding to the network view control and read a page interception parameter pointed by the interception operation of the user on the updated page.
In the above embodiment, when the interception operation of the updated page is detected, the application program interface function corresponding to the web view control is called, and the page interception parameter pointed by the interception operation is read, so that the terminal can quickly and accurately acquire the page interception parameter.
In an embodiment, the step S210, namely, the step of intercepting the updated page according to the page interception parameter to generate the target picture, specifically includes: creating a visual area consistent with the actual size of the page of the updated page; adding page elements of the updated page to the visible area; generating an updating picture corresponding to the updating page according to the visual area; and intercepting the updated picture according to the page interception parameter to generate a target picture.
Specifically, the terminal may obtain a page size parameter corresponding to the actual size of the page of the updated page, and the terminal may create a visible area consistent with the actual size of the page of the updated page according to the page size parameter. The terminal can add the page elements of the updated page to the visual area, and then the terminal can generate the updated picture corresponding to the updated page according to the page elements in the visual area. The terminal can acquire the page interception parameter from the local memory and intercept the updated picture according to the page interception parameter to generate the target picture.
In the embodiment, the visual area consistent with the actual size of the page of the updated page is created, so that the updated page can be completely displayed in the visual area, the generated updated picture corresponding to the updated page can be completely displayed in the visual area, and the user experience is improved.
In one embodiment, the step of generating an update picture corresponding to an update page according to the visible area specifically includes: creating a canvas that conforms to the area size of the viewable area; and generating an updating picture corresponding to the updating page by calling a drawing function and according to the canvas and the page elements added in the visible area.
The canvas is a rectangular area with control pixel function for drawing and managing images on the web page. The drawing function is a function having a function of drawing an image on a canvas, and commonly used drawing functions include drawcolor (int color) (drawing color covering canvas, parameter is color value), drawcext (String text, float x, float y, Paint point) (drawing text character, parameter is text content, horizontal and vertical coordinates of text and painting brush example), drawcpoint (float x, float y, Paint point) (drawing pixel point, parameter is horizontal and vertical coordinates of pixel and painting brush example), and the like.
Specifically, the terminal may obtain an area size parameter corresponding to the area size of the visible area, and the terminal may create a canvas having the same area size as the visible area according to the area size parameter. The terminal can call a drawing function, and an updating picture corresponding to the updating page is generated according to the canvas and the page elements added in the visual area by using the drawing function.
In the embodiment, the canvas with the same size as the area of the visible area is created, so that the size of the drawn update picture corresponding to the update page is consistent with that of the visible area, and further, the user can visually see the complete update picture, and the user experience is further improved.
In one embodiment, the picture generation method further includes: when picture sharing operation occurs, acquiring a target picture according to the picture sharing operation; determining a target path corresponding to the sharing operation; and sharing the target picture according to the target path.
Specifically, a sharing button is arranged on the terminal, and a user can share the target picture by triggering the sharing button. When the terminal detects that the sharing operation occurs, the terminal can acquire a target picture path of a target picture in the local memory according to the sharing operation. The terminal can share the target picture according to the target sharing path by the target picture path of the target picture after determining the target path corresponding to the sharing operation.
In an embodiment, the sharing target picture may be shared by using third-party software, where the third-party software may be WeChat, QQ, microblog, or the like, and the third-party software is not limited herein.
In one embodiment, the sharing target picture may specifically be shared by using the WeChat, the sharing target picture may specifically be a poster picture, and the sharing may specifically be shared to WeChat friends or a WeChat friend circle. The sharing using the WeChat may specifically be sharing using a WXImageObject (WeChat Picture object) in the WeChat. The WXImageObject is an object with a picture sharing function in the WeChat and is used for realizing picture sharing of a WeChat third party.
In the embodiment, the target picture is shared through the third-party software, so that the target picture is shared more conveniently, and the user can perform social interaction according to own favor through the sharing of the target picture, so that the user experience is further improved.
As shown in fig. 3, in a specific embodiment, the picture generation method includes the following steps:
s302, acquiring an initial background picture and corresponding page initial configuration information.
S304, rendering operation is carried out on the initial background picture and the page initial configuration information through the network view control, so that an initial page is generated.
S306, displaying the initial page through the terminal.
S308, when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation.
And S310, replacing the initial background picture in the initial page by the updated background picture.
S312, modifying the page initial configuration information of the initial page according to the page updating configuration information; the page initial configuration information includes at least one of a type, position information, size, and style of each element in the initial page.
And S314, loading the updated background picture and the page updating configuration information through the network view control to generate an updated page, and replacing the initial page for displaying.
And S316, when the interception operation of the updated page is detected to occur, calling an application program interface function corresponding to the network view control.
And S318, reading the page interception parameter pointed by the interception operation according to the application program interface function corresponding to the network view control.
S320, a visual area consistent with the actual size of the page of the updated page is created.
S322, adding the page element of the updated page to the visible area.
S324, a canvas which is consistent with the area size of the visual area is created.
And S326, intercepting the updated picture according to the page interception parameter to generate a target picture.
And S328, generating an updating picture corresponding to the updating page according to the canvas and the added page elements in the visible area by calling the drawing function.
And S330, intercepting the updated picture according to the page interception parameter to generate a target picture.
And S332, when the picture sharing operation occurs, acquiring a target picture according to the picture sharing operation.
And S334, determining a target path corresponding to the sharing operation.
And S336, sharing the target picture according to the target path.
According to the picture generation method, the initial page is displayed through the terminal, so that a user can directly edit the initial page at the terminal under the visual condition. And the terminal re-renders the initial page according to the page editing information edited by the user to obtain an updated page. And then, the updated page can be intercepted according to the page interception parameter to generate a target picture. Therefore, the user can directly edit the initial page on the terminal, the terminal can directly generate the picture from the display content of the updated page directly seen by the user, communication with the server is not needed, and the picture generation efficiency is greatly improved.
It should be understood that, although the steps in the flowchart of fig. 3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a picture generation apparatus including: a display module 401, an information acquisition module 402, a rendering module 403, a parameter acquisition module 404, and an interception module 405, wherein:
and the display module 401 is configured to display the initial page through the terminal.
An information obtaining module 402, configured to, when an editing operation on an initial page occurs, obtain page editing information for editing the initial page according to the editing operation.
And a rendering module 403, configured to re-render the initial page according to the page editing information to obtain an updated page.
The parameter obtaining module 404 is configured to, when an interception operation on the updated page occurs, obtain a corresponding page interception parameter according to the interception operation.
And the intercepting module 405 is configured to intercept the updated page according to the page intercepting parameter to generate a target picture.
In one embodiment, the presentation module 401 is further configured to obtain an initial background picture and corresponding page initial configuration information; rendering the initial background picture and the page initial configuration information through the network view control to generate an initial page; and displaying the initial page through the terminal.
In one embodiment, the rendering module 403 is further configured to replace the initial background picture in the initial page by the updated background picture; according to the page updating configuration information, modifying the page initial configuration information of the initial page; the page initial configuration information comprises at least one of the type, the position information, the size and the style of each element in the initial page; and loading the updated background picture and the page update configuration information through the network view control to generate an updated page, and replacing the initial page for displaying.
In one embodiment, the parameter obtaining module 404 is further configured to, when it is detected that an interception operation on the updated page occurs, invoke an application program interface function corresponding to the web view control; and reading a page interception parameter pointed by the interception operation according to an application program interface function corresponding to the network view control.
In one embodiment, the truncation module 405 is further operable to create a visible region that is consistent with the actual size of the page of the updated page; adding page elements of the updated page to the visible area; generating an updating picture corresponding to the updating page according to the visual area; and intercepting the updated picture according to the page interception parameter to generate a target picture.
In one embodiment, the intercept module 405 is also used to create a canvas that conforms to the area size of the viewable area; and generating an updating picture corresponding to the updating page by calling a drawing function and according to the canvas and the page elements added in the visible area.
Referring to fig. 5, in one embodiment, the picture generation apparatus further includes: a picture obtaining module 406, a determining module 407, and a sharing module 408, wherein:
the picture obtaining module 406 is configured to, when a picture sharing operation occurs, obtain a target picture according to the picture sharing operation.
A determining module 407, configured to determine a target path corresponding to the sharing operation.
The sharing module 408 is configured to share the target picture according to the target path.
According to the picture generation device, the initial page is displayed through the terminal, so that a user can directly edit the initial page at the terminal under the visual condition. And the terminal re-renders the initial page according to the page editing information edited by the user to obtain an updated page. And then, the updated page can be intercepted according to the page interception parameter to generate a target picture. Therefore, the user can directly edit the initial page on the terminal, the terminal can directly generate the picture from the display content of the updated page directly seen by the user, communication with the server is not needed, and the picture generation efficiency is greatly improved.
For specific limitations of the picture generation apparatus, reference may be made to the above limitations of the picture generation method, which are not described herein again. The modules in the picture generation device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be the terminal 102 in fig. 1, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a picture generation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above-described picture generation method. Here, the steps of the picture generation method may be steps in the picture generation methods of the above-described respective embodiments.
In one embodiment, a computer-readable storage medium is provided, in which a computer program is stored, which, when executed by a processor, causes the processor to perform the steps of the above-described picture generation method. Here, the steps of the picture generation method may be steps in the picture generation methods of the above-described respective embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A picture generation method, performed by a terminal, the method comprising:
displaying an initial page through a terminal;
when the editing operation on the initial page occurs, acquiring page editing information for editing the initial page according to the editing operation;
re-rendering the initial page according to the page editing information to obtain an updated page;
when the interception operation of the updated page occurs, acquiring a corresponding page interception parameter according to the interception operation;
and intercepting the updated page according to the page interception parameter to generate a target picture.
2. The method of claim 1, wherein the page editing information comprises updating background pictures and page update configuration information; the re-rendering the initial page according to the page editing information to obtain an updated page includes:
replacing the initial background picture in the initial page by the updated background picture;
modifying the page initial configuration information of the initial page according to the page updating configuration information; the page initial configuration information comprises at least one of the type, the position information, the size and the style of each element in the initial page;
and loading the updated background picture and the page update configuration information through a network view control to generate an updated page, and replacing the initial page for displaying.
3. The method according to claim 1 or 2, wherein when the interception operation on the updated page occurs, acquiring the corresponding page interception parameter according to the interception operation includes:
when the interception operation of the updated page is detected to occur, calling an application program interface function corresponding to the network view control;
and reading a page interception parameter pointed by the interception operation according to the application program interface function corresponding to the network view control.
4. The method according to claim 3, wherein the intercepting the updated page according to the page interception parameter to generate a target picture comprises:
creating a visual area consistent with the actual size of the page of the updated page;
adding a page element of the updated page to the visible area;
generating an updating picture corresponding to the updating page according to the visual area;
and intercepting the updated picture according to the page interception parameter to generate a target picture.
5. The method according to claim 4, wherein the generating an update picture corresponding to the update page according to the visual area comprises:
creating a canvas that conforms to an area size of the viewable area;
and generating an updating picture corresponding to the updating page by calling a drawing function and according to the canvas and the page elements added in the visible area.
6. The method according to claim 1 or 5, wherein the presenting the initial page through the terminal comprises:
acquiring an initial background picture and corresponding page initial configuration information;
rendering the initial background picture and the page initial configuration information through a network view control to generate an initial page;
and displaying the initial page through a terminal.
7. The method of claim 6, further comprising:
when picture sharing operation occurs, acquiring the target picture according to the picture sharing operation;
determining a target path corresponding to the sharing operation;
and sharing the target picture according to the target path.
8. A picture generation apparatus, characterized in that the apparatus comprises:
the display module is used for displaying the initial page through the terminal;
the information acquisition module is used for acquiring page editing information for editing the initial page according to the editing operation when the editing operation on the initial page occurs;
the rendering module is used for re-rendering the initial page according to the page editing information to obtain an updated page;
the parameter acquisition module is used for acquiring corresponding page interception parameters according to the interception operation when the interception operation of the updated page occurs;
and the interception module is used for intercepting the updated page according to the page interception parameter so as to generate a target picture.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911140849.8A CN112825020A (en) | 2019-11-20 | 2019-11-20 | Picture generation method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911140849.8A CN112825020A (en) | 2019-11-20 | 2019-11-20 | Picture generation method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112825020A true CN112825020A (en) | 2021-05-21 |
Family
ID=75906939
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911140849.8A Pending CN112825020A (en) | 2019-11-20 | 2019-11-20 | Picture generation method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112825020A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327736A (en) * | 2022-01-19 | 2022-04-12 | 福建中科多特健康科技有限公司 | Poster generation method and system |
CN114880611A (en) * | 2022-04-12 | 2022-08-09 | 上海哔哩哔哩科技有限公司 | Screenshot processing method and system |
CN116578376A (en) * | 2023-07-12 | 2023-08-11 | 福昕鲲鹏(北京)信息科技有限公司 | Open format document OFD page display method, device and equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105681827A (en) * | 2016-03-04 | 2016-06-15 | 华为技术有限公司 | Poster generation method and system of live channels and relevant devices |
CN109144628A (en) * | 2018-07-05 | 2019-01-04 | 厦门微芽互娱科技有限公司 | Poster generation method, medium, terminal device and device |
CN109727298A (en) * | 2018-02-12 | 2019-05-07 | 平安好房(上海)电子商务有限公司 | Poster generation method, device, equipment and computer storage medium |
US20190318521A1 (en) * | 2018-04-17 | 2019-10-17 | Rakuten, Inc. | Page generation system, page generation method and information storage medium |
-
2019
- 2019-11-20 CN CN201911140849.8A patent/CN112825020A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105681827A (en) * | 2016-03-04 | 2016-06-15 | 华为技术有限公司 | Poster generation method and system of live channels and relevant devices |
CN109727298A (en) * | 2018-02-12 | 2019-05-07 | 平安好房(上海)电子商务有限公司 | Poster generation method, device, equipment and computer storage medium |
US20190318521A1 (en) * | 2018-04-17 | 2019-10-17 | Rakuten, Inc. | Page generation system, page generation method and information storage medium |
CN109144628A (en) * | 2018-07-05 | 2019-01-04 | 厦门微芽互娱科技有限公司 | Poster generation method, medium, terminal device and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327736A (en) * | 2022-01-19 | 2022-04-12 | 福建中科多特健康科技有限公司 | Poster generation method and system |
CN114880611A (en) * | 2022-04-12 | 2022-08-09 | 上海哔哩哔哩科技有限公司 | Screenshot processing method and system |
CN116578376A (en) * | 2023-07-12 | 2023-08-11 | 福昕鲲鹏(北京)信息科技有限公司 | Open format document OFD page display method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108279966B (en) | Webpage screenshot method, device, terminal and storage medium | |
KR102307163B1 (en) | Cross-platform rendering engine | |
CN112825020A (en) | Picture generation method and device, computer equipment and storage medium | |
US20200294307A1 (en) | Displaying rich text on 3d models | |
US7688317B2 (en) | Texture mapping 2-D text properties to 3-D text | |
CN110456956A (en) | Screenshot method, device, computer equipment and storage medium | |
CN111930442B (en) | Page view loading method and device, storage medium and electronic equipment | |
CN111192352B (en) | Map rendering method, map rendering device, computer equipment and storage medium | |
CN110750664B (en) | Picture display method and device | |
CN113411664B (en) | Video processing method and device based on sub-application and computer equipment | |
CN111596919B (en) | Display method and device of graphic drawing result, computer equipment and storage medium | |
CN110955477A (en) | Image self-defining method, device, equipment and storage medium | |
KR20190047142A (en) | Method and apparatus for setting background of ui control, and terminal | |
CN107025100A (en) | Play method, interface rendering intent and device, the equipment of multi-medium data | |
CN112073794A (en) | Animation processing method, animation processing device, computer readable storage medium and computer equipment | |
CN111596911A (en) | Method and device for generating control, computer equipment and storage medium | |
CN111694493B (en) | Webpage screenshot method, computer equipment and readable storage medium | |
CN113705156A (en) | Character processing method and device | |
CN113553127B (en) | Reading content processing method and device, computer equipment and storage medium | |
CN113672829B (en) | Page display method and device, electronic equipment and storage medium | |
US20220398995A1 (en) | Method and apparatus for displaying target object, electronic device and computer-readable storage medium | |
CN115729544A (en) | Desktop component generation method and device, electronic equipment and readable storage medium | |
CN117557677A (en) | Chart drawing method, device and computer equipment | |
CN113419806B (en) | Image processing method, device, computer equipment and storage medium | |
CN115562539A (en) | Control display method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210521 |
|
RJ01 | Rejection of invention patent application after publication |