CN109918175A - Picture Generation Method, device, storage medium and electronic equipment - Google Patents
Picture Generation Method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN109918175A CN109918175A CN201910215535.3A CN201910215535A CN109918175A CN 109918175 A CN109918175 A CN 109918175A CN 201910215535 A CN201910215535 A CN 201910215535A CN 109918175 A CN109918175 A CN 109918175A
- Authority
- CN
- China
- Prior art keywords
- picture
- image data
- canvas
- generation method
- downloaded
- 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
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The present invention provides a kind of Picture Generation Method, device, storage medium and electronic equipment, the Picture Generation Method include: with JavaScript sentence on canvas painting canvas graphing;The figure drawn is converted to the image data of base64 format;An a label link to be downloaded is generated by JavaScript sentence, the image data is directed toward in a label link;The a label link is triggered to download the image data;And the picture of specified format is generated based on the image data downloaded.Compared with the prior art needed in it is manual and every time can only individual production picture for, the present invention can significantly improve the formation efficiency of picture.While can reduce a large amount of human cost, human operational error can also be effectively avoided.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of Picture Generation Method, device, storage medium and electronics
Equipment.
Background technique
With the development of multimedia technology, photo handling software is usually can be used in people, at existing picture
Reason, obtains a new picture.For example, photo handling software may include PS (Adobe Photoshop).
Currently, Picture Generation Method is usually to open photo handling software according to picture making demand by picture making person,
Project is created in photo handling software, the picture or text that will be synthesized import under the project, and use photo handling software
The processing function of offer operates picture or text, to realize the processing to picture or text, makes up to picture making
Demand, picture making person's after treatment, can by under the project all pictures or text generate a new picture.
Picture is made every time by manually photo handling software being used to make picture completely in above-mentioned Picture Generation Method
Be required to one project of creation, and need to carry out a variety of operations in manufacturing process, operation it is professional very strong, need stronger figure
Piece makes technical ability, and cost of labor is very high, and the requirement to picture making person is very high, and error probability is big.If there is a large amount of pictures are raw
At demand, completely by manual operation, formation efficiency is lower, and the picture generated does not have consistency.
Summary of the invention
For the problems of the prior art, the purpose of the present invention is to provide a kind of Picture Generation Method, device, storages to be situated between
Matter and electronic equipment, picture can be automatically generated according to JavaScript sentence, without manually handling, reduce manpower at
This.
According to an aspect of the present invention, a kind of Picture Generation Method is provided, the Picture Generation Method includes:
With JavaScript sentence on canvas painting canvas graphing;
The figure drawn is converted to the image data of base64 format;
An a label link to be downloaded is generated by JavaScript sentence, the picture number is directed toward in a label link
According to;
The a label link is triggered to download the image data;And
The picture of specified format is generated based on the image data downloaded.
In one embodiment of the present invention, it is described with JavaScript sentence on the canvas painting canvas graphing
The step of include:
Obtain the corresponding DOM object of Canvas painting canvas;
According to the corresponding context environmental object of the DOM object acquisition, context environmental object instruction for
The method and attribute drawn on canvas painting canvas;
The context environmental object is called to draw by JavaScript sentence.
In one embodiment of the present invention, the figure that will have been drawn is converted to the image data of base64 format
Step includes:
The figure drawn is converted to the image data of base64 format with toDataURL method.
In one embodiment of the present invention, the step of triggering a label link is to download the image data
Include:
The image data is downloaded to the download directory of browser.
In one embodiment of the present invention, the step of the picture that specified format is generated based on the image data downloaded
Suddenly include:
The image data downloaded is subjected to base64 decoding, to generate the picture of JPG or PNG format.
In one embodiment of the present invention, the canvas painting canvas is configured with predefined layout, the predefined layout
With multiple regions to be filled out,
It is described with JavaScript sentence on canvas painting canvas graphing further include:
Obtain the multi-medium data wait insert the region to be filled out;
Determine the corresponding relationship of the multi-medium data Yu the region to be filled out;
The multi-medium data is inserted into the region to be filled out to draw by the corresponding relationship with JavaScript sentence
At least one set of figure, every block graphics respectively correspond a picture.
In one embodiment of the present invention, after the picture that specified format is generated based on the image data downloaded
Further include:
The multi-medium data in the region to be filled out is updated to draw at least one set of figure of next batch.
According to another aspect of the present invention, a kind of photograph creation device is provided, comprising:
Graphic plotting module, for JavaScript sentence on canvas painting canvas graphing;
First conversion module, the figure drawn to be converted to the image data of base64 format;
Generation module is linked, to generate an a label link to be downloaded, a label by JavaScript sentence
The image data is directed toward in link;
Trigger module is linked, to trigger a label link to download the image data;And picture generates mould
Block, to generate the picture of specified format based on the image data downloaded.
According to another aspect of the invention, a kind of storage medium is provided, is stored with computer program on the storage medium,
The computer program executes the step in Picture Generation Method as described above when being run by processor.
According to another aspect of the invention, a kind of electronic equipment is provided, the electronic equipment includes:
Processor;
Storage medium is stored thereon with computer program, executes such as when the computer program is run by the processor
Step in the upper Picture Generation Method.
The present invention can automatically generate picture according to JavaScript sentence, without manually handling, reduce manpower at
This.Further, the present invention can generate a large amount of similar arrangements and the picture by specifying data assembled in a short time.Phase
Need more in the prior art it is manual and every time can only individual production picture for, the present invention can significantly improve picture generation effect
Rate.While can reduce a large amount of human cost, human operational error can also be effectively avoided.
Detailed description of the invention
Upon reading the detailed description of non-limiting embodiments with reference to the following drawings, other feature of the invention,
Objects and advantages will become more apparent upon.
Fig. 1 is the flow chart of Picture Generation Method in one embodiment of the invention.
Fig. 2 is the part specific flow chart of Picture Generation Method shown in Fig. 1.
Fig. 3 is the local flow chart of Picture Generation Method in another embodiment of the present invention.
Fig. 4 is the structural schematic diagram of photograph creation device in one embodiment of the invention.
Fig. 5 is the structural schematic diagram of computer readable storage medium in one embodiment of the invention.And
Fig. 6 is the structural schematic diagram of electronic equipment in one embodiment of the invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the disclosure will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.Described feature, knot
Structure or characteristic can be incorporated in any suitable manner in one or more embodiments.
In addition, attached drawing is only the schematic illustrations of the disclosure, it is not necessarily drawn to scale.Identical attached drawing mark in figure
Note indicates same or similar part, thus will omit repetition thereof.Some block diagrams shown in the drawings are function
Energy entity, not necessarily must be corresponding with physically or logically independent entity.These function can be realized using software form
Energy entity, or these functional entitys are realized in one or more hardware modules or integrated circuit, or at heterogeneous networks and/or place
These functional entitys are realized in reason device device and/or microcontroller device.
In order to solve the deficiencies in the prior art, according to an aspect of the present invention, a kind of Picture Generation Method is provided, Fig. 1 is
The flow chart of Picture Generation Method in one embodiment of the invention.As shown in Figure 1, the Picture Generation Method includes:
S110, with JavaScript sentence on canvas painting canvas graphing.
Specifically, JavaScript is a kind of based on object and event-driven and with the client script of relative safety
Language.Simultaneously it is also a kind of scripting language for being widely used in client Web exploitation, is commonly used to add dynamic function to html web page
Can, such as the various operations of response user.What one complete JavaScript realization was made of following 3 different pieces:
Core (ECMAScript), DOM Document Object Model (Document Object Model, abbreviation DOM), browser object model
(Browser Object Model, abbreviation BOM).Canvas painting canvas is defined by HTML code engagement height and width attribute
Out can drawing area.The accessible region of JavaScript code, it is logical similar to other general two-dimension computer functions
The drawing function for crossing complete set carrys out dynamic generation figure.At this point, these figures cannot be saved directly, itself is nor figure
Sheet form.
S120, the image data that the figure drawn is converted to base64 format.
In a specific embodiment, the step of figure that will have been drawn is converted to the image data of base64 format
Include:
The figure drawn is converted to the image data of base64 format with toDataURL method.Unified resource positioning
It accords with (Uniform Resource Locator, be abbreviated as URL), is called and does web page address, be the resource of standard on internet
Address (Address).Each file on internet has a unique URL, and the information that it includes points out the position of file
And how browser should handle it.Further, this method can compile the pattern transition in canvas painting canvas at base64
The png of code format, then returns to Data url data.Moreover, if being passed to the parameter of mine type to toDataURL (), also
The figure drawn can be transformed into the picture of other formats.Base64 coding is the process from binary system to character,
It can be used under HTTP environment transmitting longer identification information.For example, it is longer unique by one to use Base64
Identifier (the generally UUID of 128-bit) is encoded to a character string, as the ginseng in HTTP list and HTTP GET URL
Number.In other applications, also usually need to be to be suitble to be placed in URL (including hiding form fields) binary data coding
Form.At this point, there is unreadable property using Base64 coding, need to read after decoding.
S130, an a label link to be downloaded is generated by JavaScript sentence, a label links described in direction
Image data.
Specifically, in HTML5, a label is hyperlink always, and the most important attribute of a label is href attribute, and href belongs to
Property value can be the opposite or absolute URL of any effective document, including fragment identifier and JavaScript code section.It refers to
Show the target of link.But if not set href attribute, only the placeholder of hyperlink, then cannot use downloading etc. to belong to
Property.In the present invention, a label is directed toward the image data, to download the image data.
S140, the triggering a label link are to download the image data.
Specifically, the link of the triggering a label to download the image data the step of include:
The image data is downloaded to the download directory of browser.
S150, the picture that specified format is generated based on the image data downloaded.
Specifically, the step of picture that specified format is generated based on the image data downloaded includes:
The image data downloaded is subjected to base64 decoding, to generate the picture of JPG or PNG format.The picture
Data can be generated independent picture and save after carrying out base64 decoding.Thus, it is possible to directly be completed in front end browser, nothing
Background process need to be submitted.
Further, after the picture that specified format is generated based on the image data downloaded further include:
The multi-medium data in the region to be filled out is updated to draw at least one set of figure of next batch, wherein under described
One batch, that is, herein described Picture Generation Method subsequent cycle;It is possible thereby to insert the area to be filled out by replacement or adjustment
The multi-medium data in domain and obtaining is laid out the figure of similar but content difference.The figure that the figure that each batch is drawn is converted into
Sheet data respectively corresponds an a label link.That is, the image data that the figure drawn for each batch is converted into is given birth to respectively
It is linked at an a label, from the point of view of macroscopic view, the downloading of corresponding image data can be realized by triggering each a label link.
Present invention may apply in browser, generate a large amount of similar arrangements in a short time and by specified data it is assembled and
At picture.Compared with the prior art needed in it is manual and every time can only individual production picture for, the present invention can significantly improve figure
The formation efficiency of piece.While can reduce a large amount of human cost, human operational error can also be effectively avoided.
Fig. 2 is the part specific flow chart of Picture Generation Method shown in Fig. 1.As shown in Figure 1, in an embodiment party of the invention
It is described to be specifically included with JavaScript sentence in the step of graphing on the canvas painting canvas in formula:
S210, the corresponding DOM object of Canvas painting canvas is obtained;There is no drawing abilities for canvas painting canvas itself, it is only
It is the container of figure, it is necessary to actual drawing tasks are completed using script.It can return to one by getContext () method
Object, DOM, that is, Document Object Model, it is a set of Web standard of W3C international organization.It defines access HTML
A set of attribute, method and the event of document object.DOM is the set with the node of hierarchical structure tissue or pieces of information.Document
Object model (Document Object Model) is the one group of computer function used to HTML and XML file.The sheet of DOM
Matter is to establish the bridge that webpage and scripting language or program language are linked up.
S220, according to the corresponding context environmental object of the DOM object acquisition, context environmental object instruction is used for
The method and attribute drawn on canvas painting canvas;There are three the attribute that canvas painting canvas needs is general: identifier, it is wide, it is high.
S230, the context environmental object is called to draw by JavaScript sentence.
Specifically, figure, text to the canvas painting canvas can be written by the easeljs sentence of open source.Easeljs
A part of CreateJS, CreateJS be one using HTML5 create rich interactive experience the library Javascript and
Tool set.The library EaselJS Javascript provides a figure for the Canvas comprising a complete the hierarchical display list and protects
Mode is stayed, class therein to be easier to work on canvas 2D figure.EaselJS can create for HTML Canvas
Abundant patterns and interactive experience provide a kind of direct effective solution scheme.
Fig. 3 is the local flow chart of Picture Generation Method in another embodiment of the present invention.In this embodiment, described
Canvas painting canvas be configured with predefined layout, it is described it is predefined layout have multiple regions to be filled out, as shown in figure 3, it is described with
JavaScript sentence graphing on canvas painting canvas further include:
S310, multi-medium data wait insert the region to be filled out is obtained.
Specifically, multi-medium data may include text, picture, audio, video etc., the present invention is not limited thereto
System.
S320, the corresponding relationship for determining the multi-medium data Yu the region to be filled out.
In some embodiments of the invention, a configuration file can be pre-generated, to set in the configuration file
The corresponding relationship of fixed multi-medium data and region to be filled out to be inserted.
In some embodiments, the corresponding one group of multi-medium data of each configuration file (or includes in a configuration file
Multiple groups multi-medium data), one group of multi-medium data is for drawing a width picture.This group of multi-medium data can pass through region to be filled out
Mark/region to be filled out setting sequence with corresponding with region to be filled out.Multi-medium data is described when filling out region in filling, can be with
Shape, resolution ratio etc. are changed to be adapted to region to be filled out.The multi-medium data in identical region to be filled out is inserted in multiple groups multi-medium data
Can via identical adaptation processing (such as directly being handled by the processing mode of the corresponding multi-medium data of previous group), by
This, reduces the step of being adapted to again to determine processing mode, increases treatment effeciency.
Further, the quantity in the region to be filled out of each picture can be different.For example, the first width picture may include 3
Region to be filled out with A attribute;4 regions to be filled out with B attribute;The first width picture may include 3 with A attribute to
Fill out region;6 regions to be filled out with B attribute.The attribute in region to be filled out described herein may include region to be filled out length,
Width, shape, background color etc., the present invention is not limited thereto.It, can be with when the quantity difference wait fill out region of different pictures
Automatically predefined layout is adjusted by different quantity.
S330, with JavaScript sentence by the corresponding relationship by the multi-medium data insert the region to be filled out with
At least one set of figure is drawn, every block graphics respectively correspond a picture.
It is possible thereby to draw a large amount of similar arrangements on same painting canvas and the figure assembled by different data.This hair
It is bright to generate a large amount of similar arrangements and the picture by specifying data assembled in a short time.Compared with the prior art hand is needed in
Dynamic and every time can only be for individual production picture, the present invention can significantly improve the formation efficiency of picture.It is a large amount of that can reduce
Human cost while, can also effectively avoid human operational error.
In other embodiments of the invention, based on plurality of pictures, the base may be generated simultaneously on same painting canvas
After the step of image data downloaded generates the picture of specified format, can also include:
Based on the predefined layout, the cut-off rule between picture is determined;
The picture is split according to the cut-off rule.
Thus, it is possible to keep each picture mutually indepedent, to use.
According to another aspect of the present invention, a kind of photograph creation device is provided, Fig. 4 is that picture is raw in one embodiment of the invention
At the structural schematic diagram of device.As shown in figure 4, the photograph creation device 600 includes: that graphic plotting module 601, first is converted
Module 602, link generation module 603, link trigger module 604 and image generating module 605.The graphic plotting module 601
For with JavaScript sentence on canvas painting canvas graphing;First conversion module 602 is will draw
Figure is converted to the image data of base64 format;The link generation module 603 by JavaScript sentence to be generated
The image data is directed toward in one a label link to be downloaded, a label link;The link trigger module 604 is to trigger
The a label link is to download the image data;And the image generating module 605 is to based on the picture number downloaded
According to the picture for generating specified format.Further, the image generating module 605 further includes one second conversion module, and described
The image data downloaded is carried out base64 decoding to described by two conversion modules, to generate the figure of JPG or PNG format
Piece.
The effect of each module in photograph creation device described in the present embodiment, and from graphic plotting module 601 with
JavaScript sentence on canvas painting canvas graphing to by the image generating module 605 based on the picture downloaded
Data generate the specific steps of the picture of specified format and principle is illustrated in the above-described embodiments, therefore no longer superfluous
It states.The present invention can generate a large amount of similar arrangements and the picture by specifying data assembled in a short time.Compare existing skill
Needed in art it is manual and every time can only individual production picture for, the present invention can significantly improve the formation efficiency of picture.Can be with
While reducing a large amount of human cost, human operational error can also be effectively avoided.
In an exemplary embodiment of the present invention, a kind of computer readable storage medium is additionally provided, meter is stored thereon with
The step in Picture Generation Method described in above-described embodiment may be implemented in calculation machine program, the program when being executed by such as processor
Suddenly.In some possible embodiments, various aspects of the invention are also implemented as a kind of form of program product, packet
Program code is included, when described program product is run on the terminal device, said program code is for holding the terminal device
The step of various illustrative embodiments according to the present invention of the above-mentioned Picture Generation Method description of row this specification.
Fig. 5 is the structural schematic diagram of computer readable storage medium in one embodiment of the invention.Fig. 5 is described according to this hair
The program product 700 for realizing the above method of bright embodiment can use portable compact disc read only memory
(CD-ROM) it and including program code, and can be run on terminal device, such as PC.However, program of the invention
Product is without being limited thereto, and in this document, readable storage medium storing program for executing can be any tangible medium for including or store program, the program
Execution system, device or device use or in connection can be commanded.
Described program product 700 can be using any combination of one or more readable mediums.Readable medium can be can
Read signal medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared
The system of line or semiconductor, device or device, or any above combination.The more specific example of readable storage medium storing program for executing is (non-
The list of exhaustion) include: electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM),
Read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, the read-only storage of portable compact disc
Device (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
The computer readable storage medium may include in a base band or the data as the propagation of carrier wave a part are believed
Number, wherein carrying readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetism
Signal, optical signal or above-mentioned any appropriate combination.Readable storage medium storing program for executing can also be any other than readable storage medium storing program for executing
Readable medium, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or
Person's program in connection.The program code for including on readable storage medium storing program for executing can transmit with any suitable medium, packet
Include but be not limited to wireless, wired, optical cable, RF etc. or above-mentioned any appropriate combination.
The program for executing operation of the present invention can be write with any combination of one or more programming languages
Code, described program design language include object oriented program language-Java, C++ etc., further include conventional
Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user
It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating
Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far
Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind, including local area network (LAN) or wide area network
(WAN), it is connected to user calculating equipment, or, it may be connected to external computing device (such as utilize ISP
To be connected by internet).
In an exemplary embodiment of the present invention, a kind of electronic equipment is also provided, which may include processor,
And the memory of the executable instruction for storing the processor.Wherein, the processor is configured to via described in execution
Executable instruction executes the step in Picture Generation Method described in above-described embodiment.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as system, method or
Program product.Therefore, various aspects of the invention can be embodied in the following forms, it may be assumed that complete hardware embodiment, complete
The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.) or hardware and software, can unite here
Referred to as circuit, " module " or " system ".
The electronic equipment 400 of this embodiment according to the present invention is described referring to Fig. 6.The electronics that Fig. 6 is shown
Equipment 400 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in fig. 6, electronic equipment 400 is showed in the form of universal computing device.The component of electronic equipment 400 can wrap
It includes but is not limited to: at least one processing unit 410, at least one storage unit 420, (including the storage of the different system components of connection
Unit 420 and processing unit 410) bus 430, display unit 440 etc..
Wherein, the storage unit is stored with program code, and said program code can be held by the processing unit 410
Row, so that various examples according to the present invention described in the execution above-mentioned Picture Generation Method of this specification of the processing unit 410
The step of property embodiment.For example, the processing unit 410 can execute step as shown in fig. 1.
The storage unit 420 may include the readable medium of volatile memory cell form, such as random access memory
Unit (RAM) 4201 and/or cache memory unit 4202 can further include read-only memory unit (ROM) 4203.
The storage unit 420 can also include program/practical work with one group of (at least one) program module 4205
Tool 4204, such program module 4205 includes but is not limited to: operating system, one or more application program, other programs
It may include the realization of network environment in module and program data, each of these examples or certain combination.
Bus 430 can be to indicate one of a few class bus structures or a variety of, including storage unit bus or storage
Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures
Local bus.
Electronic equipment 400 can also be with one or more external equipments 500 (such as keyboard, sensing equipment, bluetooth equipment
Deng) communication, can also be enabled a user to one or more equipment interact with the electronic equipment 400 communicate, and/or with make
Any equipment (such as the router, modulation /demodulation that the electronic equipment 400 can be communicated with one or more of the other calculating equipment
Device etc.) communication.This communication can be carried out by input/output (I/O) interface 450.Also, electronic equipment 400 can be with
By network adapter 460 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public network,
Such as internet) communication.Network adapter 460 can be communicated by bus 430 with other modules of electronic equipment 400.It should
Understand, although not shown in the drawings, other hardware and/or software module can be used in conjunction with electronic equipment 400, including but unlimited
In: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and number
According to backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server or network equipment etc.) executes the above-mentioned picture of embodiment according to the present invention
The step of generation method.The present invention can generate a large amount of similar arrangements and the figure by specifying data assembled in a short time
Piece.Compared with the prior art needed in it is manual and every time can only individual production picture for, the present invention can significantly improve the life of picture
At efficiency.While can reduce a large amount of human cost, human operational error can also be effectively avoided.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that
Specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, exist
Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to of the invention
Protection scope.
Claims (10)
1. a kind of Picture Generation Method characterized by comprising
With JavaScript sentence on canvas painting canvas graphing;
The figure drawn is converted to the image data of base64 format;
An a label link to be downloaded is generated by JavaScript sentence, the image data is directed toward in a label link;
The a label link is triggered to download the image data;And
The picture of specified format is generated based on the image data downloaded.
2. Picture Generation Method according to claim 1, which is characterized in that it is described with JavaScript sentence described
The step of graphing, includes: on canvas painting canvas
Obtain the corresponding DOM object of Canvas painting canvas;
According to the corresponding context environmental object of the DOM object acquisition, which is indicated in canvas
The method and attribute drawn on painting canvas;
The context environmental object is called to draw by JavaScript sentence.
3. Picture Generation Method according to claim 1, which is characterized in that the figure that will have been drawn is converted to
The step of image data of base64 format includes:
The figure drawn is converted to the image data of base64 format with toDataURL method.
4. Picture Generation Method according to claim 1, which is characterized in that the triggering a label link is to download
The step of image data includes:
The image data is downloaded to the download directory of browser.
5. Picture Generation Method according to claim 1, which is characterized in that described to be generated based on the image data downloaded
The step of picture of specified format includes:
The image data downloaded is subjected to base64 decoding, to generate the picture of JPG or PNG format.
6. Picture Generation Method according to claim 1, which is characterized in that the canvas painting canvas is configured with predefined cloth
Office, the predefined layout have multiple regions to be filled out,
It is described with JavaScript sentence on canvas painting canvas graphing further include:
Obtain the multi-medium data wait insert the region to be filled out;
Determine the corresponding relationship of the multi-medium data Yu the region to be filled out;
The multi-medium data is inserted into the region to be filled out to draw at least by the corresponding relationship with JavaScript sentence
One block graphics, every block graphics respectively correspond a picture.
7. Picture Generation Method according to claim 6, which is characterized in that described to be generated based on the image data downloaded
After the picture of specified format further include:
The multi-medium data in the region to be filled out is updated to draw at least one set of figure of next batch.
8. a kind of photograph creation device characterized by comprising
Graphic plotting module, for JavaScript sentence on canvas painting canvas graphing;
First conversion module, the figure drawn to be converted to the image data of base64 format;
Generation module is linked, to generate an a label link to be downloaded, a label link by JavaScript sentence
It is directed toward the image data;
Trigger module is linked, to trigger a label link to download the image data;And
Image generating module, to generate the picture of specified format based on the image data downloaded.
9. a kind of storage medium, which is characterized in that be stored with computer program, the computer program quilt on the storage medium
Processor executes when running:
Such as step described in any item of the claim 1 to 8.
10. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Processor;
Storage medium is stored thereon with computer program, and the computer program executes when being run by the processor:
Such as step described in any item of the claim 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910215535.3A CN109918175A (en) | 2019-03-21 | 2019-03-21 | Picture Generation Method, device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910215535.3A CN109918175A (en) | 2019-03-21 | 2019-03-21 | Picture Generation Method, device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109918175A true CN109918175A (en) | 2019-06-21 |
Family
ID=66965970
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910215535.3A Pending CN109918175A (en) | 2019-03-21 | 2019-03-21 | Picture Generation Method, device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109918175A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104631A (en) * | 2019-11-30 | 2020-05-05 | 四川商通实业有限公司 | Webp picture format conversion method |
CN112269961A (en) * | 2020-11-12 | 2021-01-26 | 携程旅游网络技术(上海)有限公司 | Webpage generation method, system, equipment and storage medium based on associated report |
CN112269960A (en) * | 2020-11-12 | 2021-01-26 | 携程旅游网络技术(上海)有限公司 | Webpage updating method, system, equipment and storage medium based on associated report |
CN112269957A (en) * | 2020-11-11 | 2021-01-26 | 北京联创信安科技股份有限公司 | Picture processing method, device, equipment and storage medium |
CN112380296A (en) * | 2020-11-23 | 2021-02-19 | 北京明略软件系统有限公司 | ER (ER) graph generation method, system, electronic equipment and storage medium |
CN112788138A (en) * | 2021-01-11 | 2021-05-11 | 济南浪潮高新科技投资发展有限公司 | Method for downloading circuit diagram of quantum cloud platform to local |
CN115130034A (en) * | 2022-08-29 | 2022-09-30 | 深圳市明源云空间电子商务有限公司 | Picture coding generation method, device and equipment and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102314434A (en) * | 2010-06-30 | 2012-01-11 | 中兴通讯股份有限公司 | Method for combined display of page background pictures and device |
CN102799571A (en) * | 2011-05-23 | 2012-11-28 | 成都科创知识产权研究所 | Word document image generating method and system |
CN106649237A (en) * | 2016-12-16 | 2017-05-10 | 上海鹰谷信息科技有限公司 | Generation method of structural formula picture and structural formula editor |
WO2017105769A1 (en) * | 2015-12-18 | 2017-06-22 | Intel Corporation | Technologies for native game experience in web rendering engine |
-
2019
- 2019-03-21 CN CN201910215535.3A patent/CN109918175A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102314434A (en) * | 2010-06-30 | 2012-01-11 | 中兴通讯股份有限公司 | Method for combined display of page background pictures and device |
CN102799571A (en) * | 2011-05-23 | 2012-11-28 | 成都科创知识产权研究所 | Word document image generating method and system |
WO2017105769A1 (en) * | 2015-12-18 | 2017-06-22 | Intel Corporation | Technologies for native game experience in web rendering engine |
CN106649237A (en) * | 2016-12-16 | 2017-05-10 | 上海鹰谷信息科技有限公司 | Generation method of structural formula picture and structural formula editor |
Non-Patent Citations (2)
Title |
---|
DHENG: "HTML5 a标签的down属性进行图片下载", 《HTTPS://WWW.CNBLOGS.COM/LLCDXH/P/9318837.HTML》 * |
WEIXIN_33910460: "Canvas 实现图片合成并下载合成图片", 《HTTPS://BLOG.CSDN.NET/WEIXIN_33910460/ARTICLE/DETAILS/85977464》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104631A (en) * | 2019-11-30 | 2020-05-05 | 四川商通实业有限公司 | Webp picture format conversion method |
CN112269957A (en) * | 2020-11-11 | 2021-01-26 | 北京联创信安科技股份有限公司 | Picture processing method, device, equipment and storage medium |
CN112269961A (en) * | 2020-11-12 | 2021-01-26 | 携程旅游网络技术(上海)有限公司 | Webpage generation method, system, equipment and storage medium based on associated report |
CN112269960A (en) * | 2020-11-12 | 2021-01-26 | 携程旅游网络技术(上海)有限公司 | Webpage updating method, system, equipment and storage medium based on associated report |
CN112269960B (en) * | 2020-11-12 | 2024-02-13 | 携程旅游网络技术(上海)有限公司 | Webpage updating method, system, equipment and storage medium based on associated report |
CN112380296A (en) * | 2020-11-23 | 2021-02-19 | 北京明略软件系统有限公司 | ER (ER) graph generation method, system, electronic equipment and storage medium |
CN112788138A (en) * | 2021-01-11 | 2021-05-11 | 济南浪潮高新科技投资发展有限公司 | Method for downloading circuit diagram of quantum cloud platform to local |
CN115130034A (en) * | 2022-08-29 | 2022-09-30 | 深圳市明源云空间电子商务有限公司 | Picture coding generation method, device and equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109918175A (en) | Picture Generation Method, device, storage medium and electronic equipment | |
CN104461484B (en) | The implementation method and device of front-end template | |
CA2831588C (en) | Cross-compiling swf to html using an intermediate format | |
Boduch | React and react native | |
CN103077185B (en) | A kind of method of object-based self-defined extension information | |
US20200097526A1 (en) | Preserving semantic information in document conversion via color codes | |
WO2014071749A1 (en) | Html5-protocol-based webpage presentation method and device | |
CN112100550A (en) | Page construction method and device | |
US20130132422A1 (en) | System and method for creating and controlling an application operating on a plurality of computer platform types | |
CN106484408A (en) | A kind of node relationships figure display methods based on HTML5 and system | |
CN102741811A (en) | Improving performance of template based JavaScript widgets | |
US20130117656A1 (en) | Conversion of web template designs | |
CN110389755B (en) | Code processing method and device, electronic equipment and computer readable storage medium | |
CN104050238A (en) | Map labeling method and map labeling device | |
CN103593414A (en) | Showing method and device of webpages in browser | |
CN110263279B (en) | Page generation method and device, electronic equipment and computer readable storage medium | |
CN107479873A (en) | A kind of APP page modules melt forwarding method, electronic equipment and storage medium | |
CN114996619A (en) | Page display method and device, computer equipment and storage medium | |
CN105988814B (en) | Interface generation method and device | |
US8762836B1 (en) | Application of a system font mapping to a design | |
KR20140133125A (en) | Method and apparatus for a client to browse a web page provided by a server | |
CN102681848A (en) | Method, device, terminal and system for developing and accessing web page by Widget method | |
Bellamy-Royds et al. | Using SVG with CSS3 and HTML5: vector graphics for web design | |
CN112765252B (en) | Data transmission method, client, terminal, server and storage medium | |
CN107451167A (en) | The click data acquisition methods and system of position are clicked in standing |
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: 20190621 |
|
RJ01 | Rejection of invention patent application after publication |