CN109445901B - Method and device for drawing vector graphics tool in cross-file format - Google Patents

Method and device for drawing vector graphics tool in cross-file format Download PDF

Info

Publication number
CN109445901B
CN109445901B CN201811351816.3A CN201811351816A CN109445901B CN 109445901 B CN109445901 B CN 109445901B CN 201811351816 A CN201811351816 A CN 201811351816A CN 109445901 B CN109445901 B CN 109445901B
Authority
CN
China
Prior art keywords
vector
point coordinate
tool
end point
drawn
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.)
Active
Application number
CN201811351816.3A
Other languages
Chinese (zh)
Other versions
CN109445901A (en
Inventor
何中
顾志平
陈明敏
姚童
严伟
戴建峰
巢振军
杨双红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Zhongwei Technology Software System Co ltd
Original Assignee
Jiangsu Zhongwei Technology Software System 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 Jiangsu Zhongwei Technology Software System Co ltd filed Critical Jiangsu Zhongwei Technology Software System Co ltd
Priority to CN201811351816.3A priority Critical patent/CN109445901B/en
Publication of CN109445901A publication Critical patent/CN109445901A/en
Application granted granted Critical
Publication of CN109445901B publication Critical patent/CN109445901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/169Annotation, e.g. comment data or footnotes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method and a device for drawing a vector graphics tool in a cross-file format, wherein the method comprises the following steps: acquiring a description file of a graphic format in a format data stream file system; acquiring the geometric figure type of a vector figure tool to be drawn according to the description file; acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; and drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn. The invention realizes the drawing of the vector graphic tool of the cross-file format, can support the format stream data file system and the operating device thereof, enhances the performance of the format stream data file system and greatly improves the transmission efficiency of the file.

Description

Method and device for drawing vector graphics tool in cross-file format
Technical Field
The invention relates to the technical field of information processing, in particular to a method and a device for drawing a vector graphics tool in a cross-file format.
Background
With the continuous development of internet technology and handheld reading devices, format data stream files are applied to more and more fields, such as e-book reading, and the circulation of government electronic documents, and the like, in the e-book reading and the circulation of government electronic documents, it is often necessary to perform approval on the contents therein, for example, a part of the contents is circled by a rectangular graph, or a key is drawn by a straight line, and the like.
However, when the format data stream file is signed, some normative vector graphics tools are not available, and in the prior art, pictures are added to the format file in a picture adding mode, and the added pictures are blurred after being amplified, the size of the file is increased, and the file circulation speed is reduced. In addition, the above-mentioned approval method for adding pictures in the format file cannot support the format stream file system and the operating device thereof.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for drawing a vector graphics tool across file formats. The technical scheme is as follows:
in one aspect, a method for drawing a vector graphics tool across file formats is provided, and is applied to a format data stream file system, and the method includes:
acquiring a description file of a graphic format in a format data stream file system;
acquiring the geometric figure type of a vector figure tool to be drawn according to the description file;
acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure;
and drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn.
Furthermore, the description file in the graphic format is written in a json text format.
Specifically, if the vector graphics tool to be drawn is a rectangle or a straight line, the key information includes a start point coordinate and an end point coordinate;
correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes:
acquiring a starting point coordinate and an end point coordinate of a vector graphic tool to be drawn;
and drawing the vector diagram of the rectangle or the straight line according to the starting point coordinate and the end point coordinate.
Specifically, if the vector graphics tool to be drawn is a straight arrow, the key information includes a start point coordinate, an end point coordinate, and an offset angle;
correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes:
acquiring a starting point coordinate, an end point coordinate and an offset angle of a vector graphic tool to be drawn;
drawing a vector diagram of a straight line according to the starting point coordinate and the end point coordinate;
and drawing two vector straight lines of the offset angle according to a preset length by taking the end point coordinate of the vector graph of the straight line as a starting point to obtain the vector graph of the straight line arrow.
Specifically, if the vector graphics tool to be drawn is a curved arrow, the key information includes: starting point coordinates, end point coordinates, track coordinates from the starting point coordinates to the end point coordinates and offset angles;
correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes:
acquiring a starting point coordinate, an end point coordinate, a track coordinate from the starting point coordinate to the end point coordinate and an offset angle of a vector graphic tool to be drawn;
drawing a vector diagram of a curve according to the starting point coordinate, the end point coordinate and the track coordinate between the starting point coordinate and the end point coordinate;
obtaining a first number of track coordinates near the end point coordinate;
calculating the slope between two adjacent track coordinates in the first quantity of track coordinates;
calculating an average slope according to the slope between the two adjacent track coordinates;
determining a final offset angle according to the average slope and the offset angle;
and drawing two vector straight lines of the final deviation angle according to a preset length by taking the terminal point coordinate of the vector diagram of the curve as a starting point to obtain the vector diagram of the curve arrow.
In another aspect, a rendering apparatus of a vector graphics tool across file formats is provided, which is applied to a format data stream file system, and the apparatus includes:
the first acquisition module is used for acquiring a description file of a graphic format in the format data stream file system;
the second acquisition module is used for acquiring the geometric figure type of the vector figure tool to be drawn according to the description file;
the third acquisition module is used for acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure;
and the drawing module is used for drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn.
Furthermore, the description file in the graphic format is written in a json text format.
Specifically, if the vector graphics tool to be drawn is a rectangle or a straight line, the key information includes a start point coordinate and an end point coordinate;
correspondingly, the drawing module comprises:
the fourth acquisition module is used for acquiring the starting point coordinate and the end point coordinate of the vector graphic tool to be drawn;
and the first drawing submodule is used for drawing the vector diagram of the rectangle or the straight line according to the starting point coordinate and the end point coordinate.
Specifically, if the vector graphics tool to be drawn is a straight arrow, the key information includes a start point coordinate, an end point coordinate, and an offset angle;
correspondingly, the drawing module comprises:
the fifth acquisition module is used for acquiring a starting point coordinate, an end point coordinate and an offset angle of the vector graphic tool to be drawn;
the second drawing submodule is used for drawing a vector diagram of a straight line according to the starting point coordinate and the end point coordinate;
and the third drawing submodule is used for drawing two vector straight lines of the offset angle according to a preset length by taking the end point coordinate of the vector graph of the straight line as a starting point to obtain the vector graph of the straight line arrow.
Specifically, if the vector graphics tool to be drawn is a curved arrow, the key information includes: starting point coordinates, end point coordinates, track coordinates from the starting point coordinates to the end point coordinates and offset angles;
correspondingly, the drawing module comprises:
the sixth acquisition module is used for acquiring a starting point coordinate, an end point coordinate, a track coordinate from the starting point coordinate to the end point coordinate and an offset angle of the vector graphic tool to be drawn;
the fourth drawing submodule is used for drawing a vector diagram of a curve according to the starting point coordinate, the end point coordinate and the track coordinate from the starting point coordinate to the end point coordinate;
a seventh obtaining module, configured to obtain a first number of track coordinates close to the end point coordinate;
the first calculation module is used for calculating the slope between two adjacent track coordinates in the first quantity of track coordinates;
the second calculation module is used for calculating an average slope according to the slope between the two adjacent track coordinates;
the determining module is used for determining a final offset angle according to the average slope and the offset angle;
and the fifth drawing submodule is used for drawing two vector straight lines of the final offset angle according to a preset length by taking the terminal point coordinate of the vector diagram of the curve as a starting point to obtain the vector diagram of the curve arrow.
In another aspect, an electronic device is provided, including:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a memory storing one or more instructions adapted to be loaded by the processor and to execute the method of rendering of a vector graphics tool in a cross-file format described above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the method comprises the steps of obtaining a description file of a graphic format in a format data stream file system; acquiring the geometric figure type of a vector figure tool to be drawn according to the description file; acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; and drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn, thereby realizing the drawing of the vector graphic tool with a cross-file format, supporting a format stream data file system and an operating device thereof and enhancing the performance of the format stream data file system.
In addition, because the graphic tool is a vector graphic tool, no burr and no blur exist after the graphic tool is enlarged or circulated and displayed on other equipment.
In addition, the drawn vector graphics tool occupies a small space, the transmission of the light format data stream file can be realized, and the transmission efficiency of the file is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flowchart of a method for drawing a vector graphics tool across file formats according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an example of a description file written in a json format according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of rendering the vector graphics tool according to key information of the vector graphics tool to be rendered according to an embodiment of the present invention;
FIG. 4 is another schematic flow chart of rendering the vector graphics tool according to key information of the vector graphics tool to be rendered according to the embodiment of the present invention;
FIG. 5 is a schematic diagram of another process for rendering the vector graphics tool according to key information of the vector graphics tool to be rendered according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a drawing apparatus of a cross-file format vector graphics tool according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a rendering module according to an embodiment of the present invention;
fig. 8 is another schematic structural diagram of a rendering module according to an embodiment of the present invention;
fig. 9 is another schematic structural diagram of a rendering module according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of a method for drawing a cross-file format vector graphics tool according to an embodiment of the present invention is shown.
It should be noted that the drawing method of the vector graphics tool across file formats provided in the embodiments of the present specification may be applied to a format data stream file system. The present specification provides method steps as described in the examples or flowcharts, but may include more or fewer steps based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In actual system or product execution, sequential execution or parallel execution (e.g., parallel processor or multi-threaded environment) may be possible according to the embodiments or methods shown in the figures. As shown in fig. 1, the method may include:
step 101, obtaining a description file of a graphic format in a format data stream file system.
In the embodiment of the present specification, a description file in a graphic format is stored in the format data stream file system, the description file in the graphic format may be written in a json text format, and the description file in the graphic format written in the json text format may support viewing and editing at a PC end and a mobile end (IOS, Android), and may be displayed across platforms.
Fig. 2 is a schematic diagram illustrating an example of a description file written in a json format according to an embodiment of the present invention.
And 103, acquiring the geometric figure type of the vector figure tool to be drawn according to the description file.
In the embodiment of the present specification, several graphic types of the vector graphic tool to be drawn in the description file of the graphic format are defined, for example, the geometric graphic type may include, but is not limited to, a rectangle, a straight line arrow, a curved line arrow, and the like.
And 105, acquiring key information of the vector graphic tool to be drawn according to the type of the geometric figure.
In the embodiment of the present specification, when the geometric figure types of the vector graphics tools to be rendered are different, the corresponding key information to be acquired when rendering is different. The key information is the minimum parameters required for determining the geometry.
And 107, drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn.
In one embodiment, if the vector graphics tool to be rendered is a rectangle or a straight line, the key information includes start point coordinates and end point coordinates. Correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn may refer to a method shown in fig. 3, where the method includes:
step 301, obtaining the start point coordinate and the end point coordinate of the vector graphics tool to be drawn.
Specifically, a start point coordinate and an end point coordinate input by a user may be received.
And step 303, drawing the vector diagram of the rectangle or the straight line according to the starting point coordinate and the end point coordinate.
Specifically, the starting point coordinate and the end point coordinate may be used as two diagonal points of a rectangle, then another two diagonal points are determined according to the starting point coordinate and the end point coordinate, and finally four diagonal points are connected to form a rectangular vector tool drawing. Of course, other ways of rendering a rectangular vector map based on the start point coordinates and the end point coordinates may be used.
For a vector diagram of straight lines, the start point coordinates and the end point coordinates may be directly connected.
In another embodiment, if the vector graphics tool to be rendered is a straight arrow, the key information includes start point coordinates, end point coordinates, and offset angle. Correspondingly, the rendering of the vector graphics tool according to the key information of the vector graphics tool to be rendered may employ a method shown in fig. 4, and the method may include:
step 401, obtaining the start point coordinate, the end point coordinate and the offset angle of the vector graphics tool to be drawn.
Specifically, a start point coordinate and an end point coordinate input by a user may be received. The offset angle may be pre-configured in the description file, for example, by configuring the offset angle to be 30 ° and-30 ° with reference to the description file.
And step 403, drawing a vector diagram of the straight line according to the starting point coordinate and the end point coordinate.
Specifically, the start point coordinates and the end point coordinates may be directly connected to draw a vector diagram of a straight line.
And 405, drawing two vector straight lines of the offset angle according to a preset length by taking the end point coordinate of the vector graph of the straight line as a starting point to obtain the vector graph of the straight line arrow.
In this embodiment of the present specification, the preset length may be 60 units long, and the preset length may be pre-configured in the description file, or may receive a length input by a user. The two vector straight lines with offset angles drawn according to the preset length are the end point coordinates of the vector graph of the straight line drawn in the previous step 503 as the starting point, and then the two vector straight lines with the preset length are drawn by taking the vector graph of the drawn straight line as the reference, namely plus or minus 30 degrees, so that the vector graph of the straight line arrow is obtained.
Of course, the above is only an example of the offset angle and the preset length, and in practical applications, other values or value ranges may be set, and the present invention is not limited thereto.
In another embodiment, if the vector graphics tool to be drawn is a curved arrow, the key information includes: the coordinate system comprises a starting point coordinate, an end point coordinate, a track coordinate from the starting point coordinate to the end point coordinate and an offset angle.
Correspondingly, the rendering of the vector graphics tool according to the key information of the vector graphics tool to be rendered may employ a method shown in fig. 5, and the method may include:
step 501, obtaining a start point coordinate, an end point coordinate, a track coordinate from the start point coordinate to the end point coordinate, and an offset angle of a vector graphics tool to be drawn.
Specifically, a start point coordinate and an end point coordinate input by a user may be received. The track coordinate from the start point coordinate to the end point coordinate can also be obtained by the input of the user.
The offset angle may be pre-configured in the description file, for example, by configuring the offset angle to be 30 ° and-30 ° with reference to the description file.
Step 503, drawing a vector diagram of the curve according to the starting point coordinate, the end point coordinate and the track coordinate between the starting point coordinate and the end point coordinate.
In the present specification embodiment, the vector diagram of a curve is a line composed of a series of points.
Step 505, a first number of trajectory coordinates near the end point coordinates are obtained.
In the embodiment of the present specification, the first number of track coordinates may include an end point coordinate, and the first number may be 20 or a greater number.
Step 507, calculating a slope between two adjacent track coordinates in the first number of track coordinates.
For example, the slope of two coordinates in 20 trajectory coordinates near the end point coordinate is calculated.
In step 509, an average slope is calculated according to the slope between the two adjacent track coordinates.
After the slopes between every two coordinates in the 20 track coordinates are calculated, the average value of all the slopes is calculated to obtain the average slope.
And 511, determining a final offset angle according to the average slope and the offset angle.
Specifically, the offset angle may be offset based on the average slope, and the final offset angle may be determined. For example, the offset is plus or minus 30 ° on the basis of the average slope, resulting in the final offset angle.
And 513, drawing two vector straight lines of the final offset angle according to a preset length by taking the terminal point coordinate of the vector diagram of the curve as a starting point to obtain the vector diagram of the curve arrow.
In this embodiment of the present specification, the preset length may be 60 units long, and the preset length may be pre-configured in the description file, or may receive a length input by a user. And taking the two final offset angle vector straight lines drawn according to the preset length as the end point coordinates of the vector diagram of the curve drawn in the step 603 as the starting points, and then taking the vector diagram of the drawn curve as a reference to draw the two final offset angle vector straight lines with the preset length, thereby obtaining the vector diagram of the curved arrow.
Of course, the above is only an example of the offset angle and the preset length, and in practical applications, other values or value ranges may be set, and the present invention is not limited thereto.
According to the embodiment, the description file of the graphic format in the format data stream file system is obtained; acquiring the geometric figure type of a vector figure tool to be drawn according to the description file; acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; and drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn, thereby realizing the drawing of the vector graphic tool with a cross-file format, supporting a format stream data file system and an operating device thereof and enhancing the performance of the format stream data file system.
In addition, because the graphic tool is a vector graphic tool, no burr and no blur exist after the graphic tool is enlarged or circulated and displayed on other equipment.
In addition, the drawn vector graphics tool occupies a small space, the transmission of the light format data stream file can be realized, and the transmission efficiency of the file is greatly improved.
The embodiments of the method for drawing a vector graphics tool across file formats provided in the embodiments of the present invention are also applicable to the apparatus for drawing a vector graphics tool across file formats provided in the embodiments of the present invention, and will not be described in detail in the embodiments of the present invention.
Referring to fig. 6, a schematic structural diagram of a drawing apparatus of a cross-file format vector graphics tool according to an embodiment of the present invention is shown, and as shown in fig. 6, the apparatus may include:
a first obtaining module 610, configured to obtain a description file of a graphic format in a format data stream file system;
a second obtaining module 620, configured to obtain, according to the description file, a geometric figure type of a vector graphics tool to be drawn;
a third obtaining module 630, configured to obtain key information of a vector graphics tool to be drawn according to the geometric figure type;
and the drawing module 640 is used for drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn.
Specifically, the description file in the graphic format is written in a json text format.
In a specific embodiment, if the vector graphics tool to be drawn is a rectangle or a straight line, the key information includes a start point coordinate and an end point coordinate;
accordingly, as shown in fig. 7, the drawing module 640 may include:
a fourth obtaining module 6410, configured to obtain a start point coordinate and an end point coordinate of a vector graphics tool to be drawn;
a first rendering submodule 6420, configured to render a vector diagram of the rectangle or the straight line according to the start point coordinate and the end point coordinate.
In another embodiment, if the vector graphics tool to be drawn is a straight arrow, the key information includes a start point coordinate, an end point coordinate, and an offset angle;
accordingly, as shown in fig. 8, the drawing module 640 may include:
a fifth obtaining module 6430, configured to obtain a start point coordinate, an end point coordinate, and an offset angle of the vector graphics tool to be drawn;
the second drawing submodule 6440 is used for drawing a vector diagram of a straight line according to the starting point coordinate and the end point coordinate;
and the third drawing submodule 6450 is configured to draw two vector straight lines of the offset angle according to a preset length by using the end point coordinate of the vector graph of the straight line as a starting point, so as to obtain the vector graph of the straight line arrow.
In another embodiment, if the vector graphics tool to be drawn is a curved arrow, the key information includes: starting point coordinates, end point coordinates, track coordinates from the starting point coordinates to the end point coordinates and offset angles;
accordingly, as shown in fig. 9, the drawing module 640 may include:
a sixth obtaining module 6460, configured to obtain a start point coordinate, an end point coordinate, a track coordinate between the start point coordinate and the end point coordinate, and an offset angle of the vector graphics tool to be drawn;
the fourth drawing submodule 6470 is configured to draw a vector diagram of a curve according to the start point coordinate, the end point coordinate, and a track coordinate between the start point coordinate and the end point coordinate;
a seventh obtaining module 6480, configured to obtain a first number of trajectory coordinates close to the end point coordinate;
a first calculating module 6490, configured to calculate a slope between two adjacent track coordinates in the first number of track coordinates;
a second calculating module 6491, configured to calculate an average slope according to a slope between the two adjacent track coordinates;
a determining module 6492, configured to determine a final offset angle according to the average slope and the offset angle;
and the fifth drawing submodule 6493 is configured to draw two vector straight lines of the final offset angle according to a preset length by using the end point coordinate of the vector diagram of the curve as a starting point, so as to obtain the vector diagram of the curved arrow.
According to the embodiment, the description file of the graphic format in the format data stream file system is obtained; acquiring the geometric figure type of a vector figure tool to be drawn according to the description file; acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; and drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn, thereby realizing the drawing of the vector graphic tool with a cross-file format, supporting a format stream data file system and an operating device thereof and enhancing the performance of the format stream data file system.
In addition, because the graphic tool is a vector graphic tool, no burr and no blur exist after the graphic tool is enlarged or circulated and displayed on other equipment.
In addition, the drawn vector graphics tool occupies a small space, the transmission of the light format data stream file can be realized, and the transmission efficiency of the file is greatly improved.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above.
Please refer to fig. 10, which is a schematic structural diagram of an electronic device according to an embodiment of the present invention, the electronic device is used to implement the drawing apparatus of the cross-file format vector graphics tool provided in the foregoing embodiment. The electronic device may be a terminal device such as a PC (personal computer), a mobile phone, a PDA (tablet personal computer), or a service device such as an application server and a cluster server. Referring to fig. 10, the internal structure of the electronic device may include, but is not limited to: a processor, a network interface, and a memory. The processor, the network interface, and the memory in the electronic device may be connected by a bus or in other manners, and fig. 10 shown in the embodiment of the present specification is exemplified by being connected by a bus.
The processor (or CPU) is a computing core and a control core of the electronic device. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.). A Memory (Memory) is a Memory device in an electronic device for storing programs and data. It is understood that the memory herein may be a high-speed RAM storage device, or may be a non-volatile storage device (non-volatile memory), such as at least one magnetic disk storage device; optionally, at least one memory device located remotely from the processor. The memory provides storage space that stores an operating system of the electronic device, which may include, but is not limited to: a Windows system (an operating system), a Linux system (an operating system), an Android system, an IOS system, etc., which are not limited in the present invention; also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. In this embodiment of the present specification, the processor loads and executes one or more instructions stored in the memory to implement the method for drawing the vector graphics tool in the cross-file format provided in the above-described method embodiment.
Embodiments of the present invention also provide a storage medium, which may be disposed in an electronic device to store at least one instruction, at least one program, a code set, or a set of instructions related to a rendering method for implementing a vector graphics tool in a cross-file format in method embodiments, where the at least one instruction, the at least one program, the code set, or the set of instructions may be loaded and executed by a processor of the electronic device to implement the rendering method for a vector graphics tool in a cross-file format provided in the above method embodiments.
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.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (7)

1. A drawing method of a vector graphics tool in a cross-file format is applied to a format data stream file system, and is characterized by comprising the following steps: acquiring a description file of a graphic format in a format data stream file system; acquiring the geometric figure type of a vector figure tool to be drawn according to the description file; acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn;
if the vector graphic tool to be drawn is a rectangle or a straight line, the key information comprises a start point coordinate and an end point coordinate; correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes: acquiring a starting point coordinate and an end point coordinate of a vector graphic tool to be drawn; drawing a vector diagram of the rectangle or the straight line according to the starting point coordinate and the end point coordinate;
if the vector graphic tool to be drawn is a straight line arrow, the key information comprises a starting point coordinate, an end point coordinate and an offset angle; correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes: acquiring a starting point coordinate, an end point coordinate and an offset angle of a vector graphic tool to be drawn; drawing a vector diagram of a straight line according to the starting point coordinate and the end point coordinate; drawing two vector straight lines of the offset angle according to a preset length by taking the end point coordinate of the vector graph of the straight line as a starting point to obtain the vector graph of the straight line arrow;
if the vector graphics tool to be drawn is a curved arrow, the key information includes: starting point coordinates, end point coordinates, track coordinates from the starting point coordinates to the end point coordinates and offset angles; correspondingly, the drawing the vector graphics tool according to the key information of the vector graphics tool to be drawn includes: acquiring a starting point coordinate, an end point coordinate, a track coordinate from the starting point coordinate to the end point coordinate and an offset angle of a vector graphic tool to be drawn; drawing a vector diagram of a curve according to the starting point coordinate, the end point coordinate and the track coordinate between the starting point coordinate and the end point coordinate; obtaining a first number of track coordinates near the end point coordinate; calculating the slope between two adjacent track coordinates in the first quantity of track coordinates; calculating an average slope according to the slope between the two adjacent track coordinates; determining a final offset angle according to the average slope and the offset angle; and drawing two vector straight lines of the final deviation angle according to a preset length by taking the terminal point coordinate of the vector diagram of the curve as a starting point to obtain the vector diagram of the curve arrow.
2. The method for rendering a vector graphics tool across file formats as recited in claim 1, wherein the description file in graphics format is written in json text format.
3. A drawing device for a drawing method of a vector graphics tool across file formats according to claim 1 or 2, applied to a layout data stream file system, the device comprising a first obtaining module, configured to obtain a description file of a graphics format in the layout data stream file system; the second acquisition module is used for acquiring the geometric figure type of the vector figure tool to be drawn according to the description file; the third acquisition module is used for acquiring key information of a vector graphic tool to be drawn according to the type of the geometric figure; and the drawing module is used for drawing the vector graphic tool according to the key information of the vector graphic tool to be drawn.
4. The apparatus for rendering a vector graphics tool across file formats as claimed in claim 3, wherein the description file of graphics format is written in json text format.
5. The apparatus for drawing a vector graphics tool across file formats as claimed in claim 3, wherein if the vector graphics tool to be drawn is a rectangle or a straight line, the key information includes a start point coordinate and an end point coordinate; correspondingly, the drawing module comprises: the fourth acquisition module is used for acquiring the starting point coordinate and the end point coordinate of the vector graphic tool to be drawn; and the first drawing submodule is used for drawing the vector diagram of the rectangle or the straight line according to the starting point coordinate and the end point coordinate.
6. The apparatus for drawing a vector graphics tool across file formats as claimed in claim 3, wherein if the vector graphics tool to be drawn is a straight arrow, the key information includes a start point coordinate, an end point coordinate, and an offset angle; correspondingly, the drawing module comprises: the fifth acquisition module is used for acquiring a starting point coordinate, an end point coordinate and an offset angle of the vector graphic tool to be drawn; the second drawing submodule is used for drawing a vector diagram of a straight line according to the starting point coordinate and the end point coordinate; and the third drawing submodule is used for drawing two vector straight lines of the offset angle according to a preset length by taking the end point coordinate of the vector graph of the straight line as a starting point to obtain the vector graph of the straight line arrow.
7. The apparatus for rendering a vector graphics tool across file formats as claimed in claim 3, wherein if the vector graphics tool to be rendered is a curved arrow, the key information includes: starting point coordinates, end point coordinates, track coordinates from the starting point coordinates to the end point coordinates and offset angles; correspondingly, the drawing module comprises: the sixth acquisition module is used for acquiring a starting point coordinate, an end point coordinate, a track coordinate from the starting point coordinate to the end point coordinate and an offset angle of the vector graphic tool to be drawn; the fourth drawing submodule is used for drawing a vector diagram of a curve according to the starting point coordinate, the end point coordinate and the track coordinate from the starting point coordinate to the end point coordinate; a seventh obtaining module, configured to obtain a first number of track coordinates close to the end point coordinate; the first calculation module is used for calculating the slope between two adjacent track coordinates in the first quantity of track coordinates; the second calculation module is used for calculating an average slope according to the slope between the two adjacent track coordinates; the determining module is used for determining a final offset angle according to the average slope and the offset angle; and the fifth drawing submodule is used for drawing two vector straight lines of the final offset angle according to a preset length by taking the terminal point coordinate of the vector diagram of the curve as a starting point to obtain the vector diagram of the curve arrow.
CN201811351816.3A 2018-11-14 2018-11-14 Method and device for drawing vector graphics tool in cross-file format Active CN109445901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811351816.3A CN109445901B (en) 2018-11-14 2018-11-14 Method and device for drawing vector graphics tool in cross-file format

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811351816.3A CN109445901B (en) 2018-11-14 2018-11-14 Method and device for drawing vector graphics tool in cross-file format

Publications (2)

Publication Number Publication Date
CN109445901A CN109445901A (en) 2019-03-08
CN109445901B true CN109445901B (en) 2022-04-12

Family

ID=65553377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811351816.3A Active CN109445901B (en) 2018-11-14 2018-11-14 Method and device for drawing vector graphics tool in cross-file format

Country Status (1)

Country Link
CN (1) CN109445901B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110659026A (en) * 2019-08-02 2020-01-07 深圳市优必选科技股份有限公司 Method, device and equipment for generating graphic control
CN111045663B (en) * 2019-11-11 2023-05-23 中冶南方(武汉)自动化有限公司 Method and system for automatically generating vector graphic frame
CN111061823B (en) * 2019-11-26 2023-08-01 深圳震有科技股份有限公司 Custom vector symbol generation method, intelligent terminal and storage medium
CN111179416B (en) * 2019-12-30 2023-04-25 北京东方逸腾数码医疗设备技术有限公司 Vascular vector diagram model generation method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1504417A2 (en) * 2002-05-10 2005-02-09 NEC Electronics Corporation Graphics engine converting individual commands to spatial image information, and electrical device and memory incorporating the graphics engine
CN1235404C (en) * 2003-12-24 2006-01-04 清华大学深圳研究生院 Video frequency meeting shared white plate realizing method based on Internet
CN104346174B (en) * 2014-11-19 2017-12-29 北京大学 A kind of description of online polar plot modeling process and replay method
CN104572967B (en) * 2014-12-30 2018-01-19 北京奇虎科技有限公司 A kind of method and apparatus in page graphing
CN104966311B (en) * 2015-06-10 2017-03-15 江苏中威科技软件***有限公司 A kind of vector pattern storage method for Handwriting Signature System
CN105302550B (en) * 2015-10-12 2019-03-26 江苏中威科技软件***有限公司 The page is switched to the method and system of format data stream file
CN105843786A (en) * 2016-03-23 2016-08-10 江苏中威科技软件***有限公司 Layout file displaying method and device
CN106126098B (en) * 2016-06-23 2018-07-17 江苏中威科技软件***有限公司 A kind of writing signing method and system for capableing of Information locating
US10635787B2 (en) * 2017-04-19 2020-04-28 International Business Machines Corporation Analysis of output files

Also Published As

Publication number Publication date
CN109445901A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
CN109445901B (en) Method and device for drawing vector graphics tool in cross-file format
CN109634598B (en) Page display method, device, equipment and storage medium
CN107656911B (en) Form processing method and system
CN109491742B (en) Page table rendering method and device
CN111433762A (en) Graphically organizing content in a user interface of a software application
CN110069191B (en) Terminal-based image dragging deformation implementation method and device
CN111310866B (en) Data labeling method, device, system and terminal equipment
CN114648615A (en) Method, device and equipment for controlling interactive reproduction of target object and storage medium
CN112419430B (en) Animation playing method and device and computer equipment
CN110069195B (en) Image dragging deformation method and device
CN109739403B (en) Method and apparatus for processing information
CN111273982A (en) Method, device, electronic equipment and medium for confirming default font of operating system
CN110020285B (en) Histogram processing method and device
CN110070479B (en) Method and device for positioning image deformation dragging point
CN110895550B (en) Method and device for processing acquired data
CN113360692A (en) Display method and system of carousel view
CN112445394B (en) Screenshot method and screenshot device
CN111258582A (en) Window rendering method and device, computer equipment and storage medium
CN113284174A (en) Method and device for processing pictures
CN111563214B (en) Reference line processing method and device
CN112306339B (en) Method and apparatus for displaying image
CN112380821B (en) Graphic display method and device and electronic equipment
CN109324797B (en) Desktop icon generation method, computer readable storage medium and terminal equipment
CN117435831A (en) Page loading method and device, computer equipment and storage medium
CN111753230A (en) Reference line processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant