CN112307391A - Method and device for displaying vector graphics on webpage, electronic equipment and storage medium - Google Patents

Method and device for displaying vector graphics on webpage, electronic equipment and storage medium Download PDF

Info

Publication number
CN112307391A
CN112307391A CN201910703710.3A CN201910703710A CN112307391A CN 112307391 A CN112307391 A CN 112307391A CN 201910703710 A CN201910703710 A CN 201910703710A CN 112307391 A CN112307391 A CN 112307391A
Authority
CN
China
Prior art keywords
file
vector graphics
vector
graphic
coordinate information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910703710.3A
Other languages
Chinese (zh)
Inventor
宋辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201910703710.3A priority Critical patent/CN112307391A/en
Publication of CN112307391A publication Critical patent/CN112307391A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Abstract

The embodiment of the invention provides a method and a device for generating a vector graphic, electronic equipment and a storage medium, which are used for acquiring a vector graphic information file corresponding to a target vector graphic; extracting coordinate information corresponding to the target vector graphics from the vector graphics information file; forming a vector graphic file according to the extracted coordinate information of the target vector graphic; and sending the vector graphic file to the user terminal equipment so that the user terminal equipment executes the vector graphic file, and displaying the target vector graphic in the webpage according to the coordinate information of the target vector graphic. Therefore, the embodiment of the invention can automatically form the vector graphic file corresponding to the target vector graphic, so that the user terminal equipment executes the vector graphic file and displays the target vector graphic in the webpage according to the coordinate information of the target vector graphic. Unlike the prior art, the developer is required to write the coordinate information corresponding to the vector graphics into the code of the web page, and therefore, the workload of the developer is reduced.

Description

Method and device for displaying vector graphics on webpage, electronic equipment and storage medium
Technical Field
The present invention relates to the field of front end design technology of web pages, and in particular, to a method, an apparatus, an electronic device, and a storage medium for displaying vector graphics on a web page.
Background
At present, a method for making a web page generally includes firstly writing a code in an HTML (Hyper Text Mark-up Language) Language to determine a web page structure of the web page, and then adding content, such as adding graphics, adding background color, and the like, to the web page with the defined web page structure to fill and beautify the web page.
The inventor finds that the prior art at least has the following problems in the process of implementing the invention: in order to present a vector graphic in a web page, a developer is usually required to first determine the vector graphic, manually acquire coordinate information corresponding to the vector graphic, then write the coordinate information corresponding to the vector graphic into a code of the web page, and further present the vector graphic in the web page, so that the workload of the developer is relatively large.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, electronic equipment and a storage medium for displaying a vector graph on a webpage so as to reduce the workload of developers. The specific technical scheme is as follows:
in order to achieve the above object, in a first aspect, an embodiment of the present invention provides a method for displaying vector graphics on a web page, where the method includes:
acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and sending the vector graphics file to user equipment so that the user equipment executes the vector graphics file, and displaying the target vector graphics in a webpage according to the coordinate information of the target vector graphics.
Optionally, the vector graphics information file is a vector graphics information file corresponding to the target vector graphics, which is generated and derived when the target vector graphics are drawn in preset vector drawing software;
the extracting of the coordinate information corresponding to the target vector graphics from the vector graphics information file includes:
and acquiring information with a preset marker from the derived target vector graphic information file, wherein the information with the preset marker is coordinate information corresponding to the target vector graphic.
Optionally, the target vector graphics is vector path graphics having a plurality of paths and the plurality of paths have a drawing order;
the extracting of the coordinate information corresponding to the target vector graphics from the vector graphics information file includes:
extracting corresponding coordinate information corresponding to each path from the vector graphic information file according to the drawing sequence of the paths;
the forming a vector graphic file according to the extracted coordinate information of the target vector graphic comprises:
and forming a vector graphic file according to the extracted coordinate information corresponding to the paths and the extraction sequence of the coordinate information corresponding to the paths, so that the user end equipment can sequentially display each path according to the drawing sequence of the paths.
Optionally, the vector graphics file is a vector graphics file in Scalable Vector Graphics (SVG) format;
the forming a vector graphic file according to the extracted coordinate information of the target vector graphic comprises:
and setting attribute values of the attribute of the drawing starting point position of the solid line in the SVG attribute according to the extracted coordinate information of the target vector graphics so as to form a vector graphics file in the SVG format.
Optionally, the method further includes:
and receiving pattern normal form configuration information of the target vector graphics input by a user, and configuring attribute values of pattern normal form attributes in SVG attributes according to the configuration information to form a vector graphics file in an SVG format.
In a second aspect, an embodiment of the present invention provides an apparatus for generating a vector graphics, where the apparatus includes:
the acquisition module is used for acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
the extraction module is used for extracting the coordinate information corresponding to the target vector graphics from the vector graphics information file;
the file forming module is used for forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and the sending module is used for sending the vector graphics file to user end equipment so as to enable the user end equipment to execute the vector graphics file, and therefore the target vector graphics are displayed in a webpage according to the coordinate information of the target vector graphics.
Optionally, the vector graphics information file is a vector graphics information file corresponding to the target vector graphics, which is generated and derived when the target vector graphics are drawn in preset vector drawing software;
the extracting module is specifically configured to obtain information with a preset marker from the derived target vector graphics information file, where the information with the preset marker is coordinate information corresponding to the target vector graphics.
Optionally, the target vector graphics is vector path graphics having a plurality of paths and the plurality of paths have a drawing order;
the extracting module is specifically configured to extract, from the vector graphics information file, corresponding coordinate information corresponding to each of the paths according to the drawing order of the paths;
the file forming module is specifically configured to form a vector graphics file according to the extracted coordinate information corresponding to the paths and the extraction sequence of the coordinate information corresponding to the multiple paths, so that the user end device can sequentially display each path according to the drawing sequence of the multiple paths.
Optionally, the vector graphics file is a vector graphics file in Scalable Vector Graphics (SVG) format;
the file forming module is specifically configured to set an attribute value of a solid line drawing starting point position attribute in an SVG attribute according to the extracted coordinate information of the target vector graphics, so as to form a vector graphics file in an SVG format.
Optionally, the apparatus further includes:
a receiving module: the SVG attribute management system is used for receiving pattern normal form configuration information of the target vector graphics input by a user and configuring attribute values of pattern normal form attributes in SVG attributes according to the configuration information so as to form a vector graphics file in SVG format.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
the processor is used for realizing the following steps when executing the program stored in the memory:
acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and sending the vector graphics file to user equipment so that the user equipment executes the vector graphics file, and displaying the target vector graphics in a webpage according to the coordinate information of the target vector graphics.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the following steps:
acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and sending the vector graphics file to user equipment so that the user equipment executes the vector graphics file, and displaying the target vector graphics in a webpage according to the coordinate information of the target vector graphics.
The method, the device, the electronic equipment and the storage medium for displaying the vector graphics on the webpage provided by the embodiment of the invention can realize the acquisition of the corresponding vector graphics information file of the target vector graphics; extracting coordinate information corresponding to the target vector graphics from the vector graphics information file; forming a vector graphic file according to the extracted coordinate information of the target vector graphic; and sending the vector graphic file to the user terminal equipment so that the user terminal equipment executes the vector graphic file, and displaying the target vector graphic in the webpage according to the coordinate information of the target vector graphic. Therefore, the method provided by the embodiment of the invention can automatically acquire the vector graphic information file corresponding to the target vector graphic, extract the coordinate information corresponding to the target vector graphic from the vector graphic information file, and form the vector graphic file according to the extracted coordinate information of the target vector graphic, so that the user terminal equipment executes the vector graphic file and displays the target vector graphic in the webpage according to the coordinate information of the target vector graphic. Unlike the prior art, developers need to firstly determine the vector graphics, manually acquire the coordinate information corresponding to the vector graphics, and then write the coordinate information corresponding to the vector graphics into the codes of the web pages to present the vector graphics in the web pages, so that the workload of the developers is reduced.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for displaying a vector graphic on a web page according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a vector graphics information file;
FIG. 3 is a schematic flow chart illustrating a method for displaying vector graphics on a web page according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for displaying vector graphics on a web page according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for displaying vector graphics on a web page according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to reduce the workload of developers when vector graphics are displayed on a web page, an embodiment of the present invention provides a method for displaying vector graphics on a web page, where, referring to fig. 1, the method may include:
s101: acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
the vector graphic information file is generated and exported when a target vector graphic is drawn in preset vector drawing software and corresponds to the target vector graphic; the drawing software may be AI (Adobe illustrator, vector drawing software) or PS (Adobe Photoshop, PS software).
In a specific embodiment, the Vector Graphics file may be a Vector Graphics file in SVG (Scalable Vector Graphics) format.
S102: extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
specifically, the information with the preset marker may be obtained from the derived target vector graphics information file, and the information with the preset marker may be coordinate information corresponding to the target vector graphics.
For example: if the predetermined flag is "< g", all the information whose flag is "< g" is extracted in the vector graphics information file with reference to fig. 2.
S103: forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
the vector graphics file may be a vector graphics file in Scalable Vector Graphics (SVG) format, and specifically, an attribute value of a solid line drawing starting point position attribute in an SVG attribute may be set according to the extracted coordinate information of the target vector graphics, so as to form the vector graphics file in the SVG format.
In a specific embodiment, the target vector graphic may be a vector path graphic having a plurality of paths and the plurality of paths having a drawing order; in this embodiment, the corresponding coordinate information corresponding to each path may be extracted from the vector graphics information file in the drawing order of the plurality of paths; and forming a vector graphic file according to the extracted coordinate information corresponding to the paths and the extraction sequence of the coordinate information corresponding to the paths, so that the user end equipment can display each path in sequence according to the drawing sequence of the paths.
S104: and sending the vector graphic file to the user terminal equipment so that the user terminal equipment executes the vector graphic file, and displaying the target vector graphic in the webpage according to the coordinate information of the target vector graphic.
As can be seen from the embodiment shown in fig. 1, the method for displaying a vector graphic on a web page according to the embodiment of the present invention can automatically obtain a vector graphic information file corresponding to a target vector graphic, extract coordinate information corresponding to the target vector graphic from the vector graphic information file, and form a vector graphic file according to the extracted coordinate information of the target vector graphic, so that a user end device executes the vector graphic file and displays the target vector graphic in the web page according to the coordinate information of the target vector graphic. Unlike the prior art, developers need to firstly determine the vector graphics, manually acquire the coordinate information corresponding to the vector graphics, and then write the coordinate information corresponding to the vector graphics into the codes of the web pages to present the vector graphics in the web pages, so that the workload of the developers is reduced.
The following describes a method for displaying vector graphics on a web page according to an embodiment of the present invention in further detail by referring to a specific embodiment.
In the present embodiment, the vector graphics file is a vector graphics file in SVG format in CSS3, where CSS3 is the latest version of CSS (Cascading Style Sheet).
Referring to fig. 3, a method for displaying a vector graphic on a web page according to an embodiment of the present invention may include:
s301: acquiring a vector graphic information file in an SVG format corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
the vector graphic information file is generated and exported when a target vector graphic is drawn in preset vector drawing software and corresponds to the target vector graphic.
S302: extracting information having a tag of "< g" from the target vector graphics information file; wherein, the information with the marker "< g" is the coordinate information corresponding to the target vector graphics;
s303: receiving pattern normal form configuration information of a target vector graph input by a user, and configuring an attribute value of the pattern normal form attribute in the SVG attribute and coordinate information corresponding to the target vector graph according to the configuration information to form a vector graph file in the SVG format;
s304: and sending the vector graphic file to the user terminal equipment so that the user terminal equipment executes the vector graphic file, and displaying the target vector graphic in the webpage according to the coordinate information of the target vector graphic.
Specifically, a stroke-dashoffset attribute of a pattern paradigm for setting dotted lines of edges, a stroke-dasharray attribute for setting a position of a drawing start point of a solid line, and the like in a stroke attribute (brush attribute) in a vector graphics file in the SVG format may be configured according to received configuration information input by a user to form the vector graphics file in the SVG format. Therefore, the user end can display the drawing process of the target vector graphics in the webpage from the drawing starting point according to the coordinate information of the target vector graphics, the pattern normal form attribute of the dotted line of the set edge in the vector graphics file and the attribute value of the drawing starting point position attribute of the set solid line, namely, the target vector graphics are dynamically generated, wherein the stroke-dashboard attribute and the stroke-dashboard attribute can be set to be the same value in practical application, and the purpose of dynamically drawing the vector graphics is achieved.
As can be seen from the embodiment shown in fig. 3, the method for displaying a vector graphic on a web page according to the embodiment of the present invention can automatically obtain a vector graphic information file corresponding to a target vector graphic, extract coordinate information corresponding to the target vector graphic from the vector graphic information file, and form a vector graphic file according to the extracted coordinate information of the target vector graphic, so that a user end device executes the vector graphic file and displays the target vector graphic in the web page according to the coordinate information of the target vector graphic. Unlike the prior art, developers need to firstly determine the vector graphics, manually acquire the coordinate information corresponding to the vector graphics, and then write the coordinate information corresponding to the vector graphics into the codes of the web pages to present the vector graphics in the web pages, so that the workload of the developers is reduced.
In addition, the method provided by the embodiment of the invention can also configure the pattern normal form attribute of the dot-and-dash line of the set edge and the drawing starting point position attribute of the set solid line in the vector graphics file in the SVG format according to the received configuration information input by the user, thereby realizing the dynamic generation of the target vector graphics in the webpage.
Corresponding to the embodiment shown in fig. 1, an embodiment of the present invention further provides an apparatus for displaying a vector graphic on a web page, as shown in fig. 4, the apparatus for displaying a vector graphic on a web page includes:
an obtaining module 401, configured to obtain a vector graphics information file corresponding to the target vector graphics, where the vector graphics information file includes coordinate information corresponding to the target vector graphics;
an extracting module 402, configured to extract coordinate information corresponding to a target vector graphic from a vector graphic information file;
a file forming module 403, configured to form a vector graphics file according to the extracted coordinate information of the target vector graphics;
a sending module 404, configured to send the vector graphics file to the user end device, so that the user end device executes the vector graphics file, and thus displays the target vector graphics in the web page according to the coordinate information of the target vector graphics.
Optionally, the vector graphic information file is a vector graphic information file corresponding to the target vector graphic and generated and exported when the target vector graphic is drawn in the preset vector drawing software;
the extracting module 402 is specifically configured to obtain information with a preset marker from the derived target vector graphics information file, where the information with the preset marker is coordinate information corresponding to the target vector graphics.
Optionally, the target vector graphic is a vector path graphic having a plurality of paths and a drawing order of the plurality of paths;
an extracting module 402, configured to extract, from the vector graphics information file, corresponding coordinate information corresponding to each path according to a drawing order of the plurality of paths;
the file forming module 403 is specifically configured to form a vector graphics file according to the extracted coordinate information corresponding to the path and the extraction sequence of the coordinate information corresponding to the multiple paths, so that the user equipment can sequentially display each path according to the drawing sequence of the multiple paths.
Optionally, the vector graphics file is in a Scalable Vector Graphics (SVG) format;
the file forming module 403 is specifically configured to set an attribute value of a solid line drawing starting point location attribute in the SVG attribute according to the extracted coordinate information of the target vector graphics, so as to form a vector graphics file in the SVG format.
Referring to fig. 5, the apparatus for displaying vector graphics on a web page may further include:
a receiving module 501, configured to receive pattern paradigm configuration information of a target vector graphic input by a user, and configure an attribute value of a pattern paradigm attribute in an SVG attribute according to the configuration information, so as to form a vector graphic file in an SVG format.
As can be seen from the embodiments shown in fig. 4 and 5, the apparatus for displaying a vector graphic on a web page according to the embodiments of the present invention can automatically obtain a vector graphic information file corresponding to a target vector graphic, extract coordinate information corresponding to the target vector graphic from the vector graphic information file, and form a vector graphic file according to the extracted coordinate information of the target vector graphic, so that a user end device executes the vector graphic file and displays the target vector graphic in the web page according to the coordinate information of the target vector graphic. Unlike the prior art, developers need to firstly determine the vector graphics, manually acquire the coordinate information corresponding to the vector graphics, and then write the coordinate information corresponding to the vector graphics into the codes of the web pages to present the vector graphics in the web pages, so that the workload of the developers is reduced.
Corresponding to the embodiment shown in fig. 1, the embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete communication with each other through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and sending the vector graphic file to the user terminal equipment so that the user terminal equipment executes the vector graphic file, and displaying the target vector graphic in the webpage according to the coordinate information of the target vector graphic. .
As can be seen from the embodiment shown in fig. 6, the electronic device according to the embodiment of the present invention may automatically obtain the vector graphics information file corresponding to the target vector graphics, extract the coordinate information corresponding to the target vector graphics from the vector graphics information file, and form the vector graphics file according to the extracted coordinate information of the target vector graphics, so that the user end device executes the vector graphics file, and displays the target vector graphics in the web page according to the coordinate information of the target vector graphics. Unlike the prior art, developers need to firstly determine the vector graphics, manually acquire the coordinate information corresponding to the vector graphics, and then write the coordinate information corresponding to the vector graphics into the codes of the web pages to present the vector graphics in the web pages, so that the workload of the developers is reduced.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above methods for displaying vector graphics on a web page.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described embodiments of the method for displaying vector graphics on a web page.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method for displaying vector graphics on a web page, the method comprising:
acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
extracting coordinate information corresponding to the target vector graphics from the vector graphics information file;
forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and sending the vector graphics file to user equipment so that the user equipment executes the vector graphics file, and displaying the target vector graphics in a webpage according to the coordinate information of the target vector graphics.
2. The method according to claim 1, wherein the vector graphic information file is a vector graphic information file corresponding to the target vector graphic, which is generated and derived when the target vector graphic is drawn in a preset vector drawing software;
the extracting of the coordinate information corresponding to the target vector graphics from the vector graphics information file includes:
and acquiring information with a preset marker from the derived target vector graphic information file, wherein the information with the preset marker is coordinate information corresponding to the target vector graphic.
3. The method of claim 1, wherein the target vector graphic is a vector path graphic having a plurality of paths and the plurality of paths having a drawing order;
the extracting of the coordinate information corresponding to the target vector graphics from the vector graphics information file includes:
extracting corresponding coordinate information corresponding to each path from the vector graphic information file according to the drawing sequence of the paths;
the forming a vector graphic file according to the extracted coordinate information of the target vector graphic comprises:
and forming a vector graphic file according to the extracted coordinate information corresponding to the paths and the extraction sequence of the coordinate information corresponding to the paths, so that the user end equipment can sequentially display each path according to the drawing sequence of the paths.
4. The method of claim 1, wherein the vector graphics file is a vector graphics file in Scalable Vector Graphics (SVG) format;
the forming a vector graphic file according to the extracted coordinate information of the target vector graphic comprises:
and setting attribute values of the attribute of the drawing starting point position of the solid line in the SVG attribute according to the extracted coordinate information of the target vector graphics so as to form a vector graphics file in the SVG format.
5. The method of claim 4, further comprising:
and receiving pattern normal form configuration information of the target vector graphics input by a user, and configuring attribute values of pattern normal form attributes in SVG attributes according to the configuration information to form a vector graphics file in an SVG format.
6. An apparatus for displaying vector graphics on a web page, the apparatus comprising:
the acquisition module is used for acquiring a vector graphic information file corresponding to a target vector graphic, wherein the vector graphic information file comprises coordinate information corresponding to the target vector graphic;
the extraction module is used for extracting the coordinate information corresponding to the target vector graphics from the vector graphics information file;
the file forming module is used for forming a vector graphic file according to the extracted coordinate information of the target vector graphic;
and the sending module is used for sending the vector graphics file to user end equipment so as to enable the user end equipment to execute the vector graphics file, and therefore the target vector graphics are displayed in a webpage according to the coordinate information of the target vector graphics.
7. The apparatus according to claim 6, wherein the vector graphics information file is a vector graphics information file corresponding to the target vector graphics, generated and derived when the target vector graphics are drawn in preset vector drawing software;
the extracting module is specifically configured to obtain information with a preset marker from the derived target vector graphics information file, where the information with the preset marker is coordinate information corresponding to the target vector graphics.
8. The apparatus of claim 6, wherein the target vector graphic is a vector path graphic having a plurality of paths and the plurality of paths having a drawing order;
the extracting module is specifically configured to extract, from the vector graphics information file, corresponding coordinate information corresponding to each of the paths according to the drawing order of the paths;
the file forming module is specifically configured to form a vector graphics file according to the extracted coordinate information corresponding to the paths and the extraction sequence of the coordinate information corresponding to the multiple paths, so that the user end device can sequentially display each path according to the drawing sequence of the multiple paths.
9. The apparatus according to claim 6, characterized in that said vector graphics file is a vector graphics file in scalable vector graphics, SVG, format;
the file forming module is specifically configured to set an attribute value of a solid line drawing starting point position attribute in an SVG attribute according to the extracted coordinate information of the target vector graphics, so as to form a vector graphics file in an SVG format.
10. The apparatus of claim 9, further comprising:
a receiving module: the SVG attribute management system is used for receiving pattern normal form configuration information of the target vector graphics input by a user and configuring attribute values of pattern normal form attributes in SVG attributes according to the configuration information so as to form a vector graphics file in SVG format.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201910703710.3A 2019-07-31 2019-07-31 Method and device for displaying vector graphics on webpage, electronic equipment and storage medium Pending CN112307391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910703710.3A CN112307391A (en) 2019-07-31 2019-07-31 Method and device for displaying vector graphics on webpage, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910703710.3A CN112307391A (en) 2019-07-31 2019-07-31 Method and device for displaying vector graphics on webpage, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112307391A true CN112307391A (en) 2021-02-02

Family

ID=74485326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910703710.3A Pending CN112307391A (en) 2019-07-31 2019-07-31 Method and device for displaying vector graphics on webpage, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112307391A (en)

Similar Documents

Publication Publication Date Title
CN109254773B (en) Skeleton page generation method, device, equipment and storage medium
CN111026392B (en) Method and device for generating guide page and electronic equipment
CN113190781B (en) Page layout method, device, equipment and storage medium
CN108959495B (en) page display method, device, equipment and computer storage medium of H5 webpage
CN109753641B (en) Method and device for changing object position, electronic equipment and storage medium
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
CN108733370B (en) Stylized display method, device, terminal and storage medium of native APP
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN106155654B (en) Method and device for shielding webpage operation and electronic equipment
CN110990010A (en) Software interface code generation method and device
CN114417226A (en) Page generation method, display method, device, electronic equipment and storage medium
CN113900647A (en) Method, device and equipment for screenshot of webpage
US9875316B2 (en) Identifying user selection using coordinates and snapshots of webpages
CN112052647A (en) Document editing method and device, electronic equipment and readable storage medium
CN111428452B (en) Annotation data storage method and device
US11126410B2 (en) Method and apparatus for building pages, apparatus and non-volatile computer storage medium
CN113050921A (en) Webpage conversion method, device, storage medium and computer equipment
CN112307391A (en) Method and device for displaying vector graphics on webpage, electronic equipment and storage medium
CN107341038B (en) Compatibility processing method and device and electronic equipment
CN112800373B (en) Webpage resource data generation method and device, computer equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN107357926B (en) Webpage processing method and device and electronic equipment
CN108459890B (en) Interface display method and device for application

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