CN115630622B - Drawing method implementation method and device based on vector graphics primitives - Google Patents

Drawing method implementation method and device based on vector graphics primitives Download PDF

Info

Publication number
CN115630622B
CN115630622B CN202211629593.9A CN202211629593A CN115630622B CN 115630622 B CN115630622 B CN 115630622B CN 202211629593 A CN202211629593 A CN 202211629593A CN 115630622 B CN115630622 B CN 115630622B
Authority
CN
China
Prior art keywords
basic
primitive
function
tree
module
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
CN202211629593.9A
Other languages
Chinese (zh)
Other versions
CN115630622A (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.)
Xi'an Grape City Software Co ltd
Original Assignee
Xi'an Grape City Software 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 Xi'an Grape City Software Co ltd filed Critical Xi'an Grape City Software Co ltd
Priority to CN202211629593.9A priority Critical patent/CN115630622B/en
Publication of CN115630622A publication Critical patent/CN115630622A/en
Application granted granted Critical
Publication of CN115630622B publication Critical patent/CN115630622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/174Form filling; Merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

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

Abstract

The application discloses a drawing method implementation method and device based on vector primitives, and belongs to the technical field of spreadsheet information processing. The method specifically comprises the following steps: acquiring a service object in an output area and determining the type of the service object; identifying a base object in the business object; abstracting basic elements in the basic object into basic primitives; wherein, different basic primitives are positioned in different layers; constructing a primitive tree of an output area according to the service object, the basic object and the basic element; and determining the type of the display equipment and calling a corresponding function to output the primitive tree. The problem of need write different functions to the whole output interface of different output device among the prior art, and the function can't be general is solved. The method also solves the problems that the output interface must be processed in place once when being rendered in the existing method, the output interface cannot be independently modified in the later period, and the whole canvas must be redrawn when any one layer is modified.

Description

Drawing method implementation method and device based on vector graphics primitives
Technical Field
The application relates to the technical field of spreadsheet information processing, in particular to a drawing method implementation method and device based on vector primitives.
Background
Spreadsheet software has various forms of visual analysis charts, layout modes with larger degrees of freedom and abundant components and interfaces, and is often applied to aspects such as financial statistics, data analysis, enterprise reports and the like. The spreadsheet has a graphical interface, and graphical rendering is required when displaying, printing or exporting, and the adaptation of the spreadsheet graphical rendering to different display screens and different export formats needs to be considered. Some of these different display devices are processed in a similar manner, and some of them are processed in a different manner.
For display devices with similar processing modes, such as rendering to a screen and exporting as PDF, drawing on a canvas can be considered, but the APIs called by the display devices are different. In the prior art, standard APIs are established, and each device can realize the APIs, and then the APIs are called uniformly, so that differences can be shielded, and the workload is reduced. However, in the output form, all elements are drawn on one canvas in the form of layers, and the elements must be processed in place at one time, cannot be processed in stages, cannot be adjusted at the later stage, and the whole canvas must be redrawn when any layer is modified.
For display devices with large differences in processing modes, such as deriving PDF and deriving Html, PDF can be regarded as drawing on a canvas, and Html is represented by multiple element combinations, so that both devices have difficulty in implementing APIs of a set of canvas. For the display devices with large differences, the derivation can be realized only by writing different drawing functions for different display devices, but because graphical interface elements in the electronic table are various and complex and have various output forms, the final drawing functions are also complex and can not be used universally, part of contents can be shared among the drawing functions, and the workload is still large.
Disclosure of Invention
The embodiment of the application provides a drawing method implementation method and device based on vector primitives, and solves the problems that in the prior art, an electronic form is not universal for output methods among different display devices, the workload is large and complex, meanwhile, the electronic form cannot be independently adjusted in a later period, and all layers must be redrawn when any one layer changes and other layers need to be redrawn.
In a first aspect, an embodiment of the present application provides a drawing method implementation method based on a vector primitive, including: creating a first function which can be used for acquiring a business object in an output area; wherein the output area comprises a whole electronic form, a selected piece of area or a displayed visual interface area; acquiring the service object in the output area according to the first function and determining the type of the service object; identifying a base object in the business objects; creating a second function for the base object; wherein the first function may call the second function; identifying a base element in the base object using the second function; creating a drawing function according to the basic element data; generating the basic primitive by using the drawing function; different basic primitives are positioned in different layers; the output area is used as a root node, the service object is used as a child node, and the basic object is used as a grandchild node to construct a primitive tree; the business object and the basic object are in a multilayer tree structure, the business object comprises the basic object and/or a primitive group and/or the basic primitive, and the primitive group comprises the basic primitive; traversing the primitive tree to search the business object and/or the basic element information; scaling or adjusting the position of the output area and/or a part of the objects in the output area by modifying the attributes of the primitive tree and/or the sub-nodes of each node in the primitive tree; deleting or adding the service object and/or the basic element in the primitive tree; and determining the type of the display equipment and calling a corresponding function to output the primitive tree.
With reference to the first aspect, in a first possible implementation manner, the basic elements include text elements, line segment elements, polygon elements, curve elements, color filling elements, and picture elements; creating a drawing function according to the basic element data; and generating the basic primitive by using the drawing function.
With reference to the first aspect, in a second possible implementation manner, the determining a type of a display device and invoking a corresponding function to output the primitive tree includes: determining a type of the display device; wherein the display device types include: display screen, printer, PDF, HTML, picture and SVG; traversing the primitive tree to determine the basic primitive in the primitive tree; and calling a drawing function and an API corresponding to the display equipment, and drawing the primitive tree in the display equipment.
In a second aspect, an embodiment of the present application provides a drawing implementation apparatus based on a vector primitive, including: the first function module is used for creating a first function which can be used for acquiring the business object in the output area; wherein the output area comprises a whole electronic form, a selected piece of area or a displayed visual interface area; the determining module is used for acquiring the business object in the output area according to the first function and determining the type of the business object; the first identification module is used for identifying a basic object in the business objects; a second function module for creating a second function for the base object; wherein the first function may call the second function; a second identification module for identifying a base element in the base object using the second function; the drawing function module is used for creating a drawing function according to the basic element data; the generating module is used for generating the basic primitive by utilizing the drawing function; different basic primitives are positioned in different layers; the primitive tree module is used for constructing a primitive tree by taking the output area as a root node, the service object as a child node and the basic object as a grandchild node; the business object and the basic object are in a multilayer tree structure, the business object comprises the basic object and/or a primitive group and/or the basic primitive, and the primitive group comprises the basic primitive; the traversal module is used for traversing the primitive tree to search the business object and/or the basic element information; the adjusting module is used for carrying out scaling or position adjustment on the output area and/or part of objects in the output area by modifying the attributes of the primitive tree and/or the child nodes of each node in the primitive tree; the adding module is used for deleting or adding the service object and/or the basic element in the primitive tree; and the output module is used for determining the type of the display equipment and calling a corresponding function to output the primitive tree. .
With reference to the second aspect, in a first possible implementation manner, the basic elements include text elements, line segment elements, polygon elements, curve elements, color filling elements, and picture elements; creating a drawing function according to the basic element data; and generating the basic primitive by using the drawing function.
With reference to the second aspect, in a second possible implementation manner, the determining a display device type and calling a corresponding function to output the primitive tree includes: determining a type of the display device; wherein the display device types include: display screen, printer, PDF, HTML, picture and SVG; traversing the primitive tree to determine the basic primitive in the primitive tree; and calling a drawing function and an API corresponding to the display equipment, and drawing the primitive tree in the display equipment.
In a third aspect, an embodiment of the present application provides an apparatus, where the apparatus includes: a processor; a memory for storing processor-executable instructions; the processor, when executing the executable instructions, performs the method as described in the first aspect or any possible implementation manner of the first aspect.
In a fourth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium including instructions or computer programs for storing a computer program, which when executed, causes a method according to the first aspect or any one of the possible implementations of the first aspect to be implemented.
According to the method and the device for realizing the drawing method based on the vector primitives, firstly, the business objects in the spreadsheet output area are decomposed layer by layer, basic elements forming the business objects are abstracted into the basic primitives, different basic primitives are located in different layers, then the appearances of the business objects are packaged into the primitive tree, and finally the display equipment is connected in a butt joint mode. Secondly, different elements are drawn on different layers, and the elements can be independently zoomed or adjusted and added or deleted in the primitive tree, so that the elements of the graphical interface can be freely modified without redrawing, and a large amount of time and energy can be saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below, and it is apparent that the drawings in the following description are 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 flowchart of a drawing method implementation method based on vector primitives according to an embodiment of the present application;
fig. 2 is a flowchart for abstracting basic elements in a basic object into basic primitives according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a drawing implementation apparatus based on vector primitives according to an embodiment of the present application;
fig. 4 is an exemplary diagram of a primitive tree structure provided in an embodiment of the present application;
FIG. 5 is an exemplary diagram of a primitive tree of an output area according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating an example of a portion of a display device provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all 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.
Some of the techniques involved in the embodiments of the present application are described below to aid in understanding, and they should be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of a method for implementing drawing based on vector primitives according to an embodiment of the present application, including steps 101 to 105. Fig. 1 is only one execution sequence shown in the embodiment of the present application, and does not represent the only execution sequence of the drawing implementation method based on vector primitives, and in the case that the final result can be achieved, the steps shown in fig. 1 may be executed in parallel or in reverse.
Step 101: and acquiring the service object in the output area and determining the type of the service object. Specifically, a first function which can be used for acquiring a service object in an output area is created; wherein the output area includes the entire spreadsheet, a selected piece of area, or a displayed visual interface area. In the embodiment of the present application, IRange range = workschet. Range [ "A1: D10" ] is used to obtain an output area, that is, A1: D10 piece of output area is obtained; the GetRangeDrawing () function is then used to obtain the business objects in the output areas A1: D10 within the function. Types of business objects include, but are not limited to: tables, charts, slices, pictures, graphs. Wherein, getransedrawing () is a first function described in the embodiments of the present application, and getrans Draawing () is only a name for a method in the embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application.
Step 102: a base object in the business object is identified. Specifically, in the embodiment of the present application, the basic objects in the chart include: cell, fill, text, curve, etc. The base objects in the table include: cell, fill, text, etc.
Step 103: the basic elements in the base object are abstracted into basic primitives. Wherein, different basic primitives are located in different image layers.
The specific implementation manner and technical effects of step 103 can refer to the embodiment shown in fig. 2, including steps 201 to 204, which are described in detail as follows.
Step 201: a second function is created for the base object. Wherein the first function may call the second function. Specifically, in the embodiment of the present application, the second function is getcelldraw (), which can be called by the first function getpagedraw (); herein, getCellDrawin () is only a name for the embodiment of the present application, and is not a limitation to the scope of the present application.
Step 202: the base elements in the base object are identified using a second function. Specifically, in the embodiment of the present application, when the base object is a table, the second function can traverse each cell in the table, and obtain information of the row width, the column height, and the like of the cell, so as to calculate the position and the size of the cell. When the basic object is a graph, a picture, a chart and the like, the second function finds out the optimal circumscribed rectangle of the basic object by acquiring the coordinate and the width and height information of the upper left corner of the basic object, judges whether the optimal circumscribed rectangle of the basic object is intersected with the output area or not, if the optimal circumscribed rectangle of the basic object is intersected with the output area, continues to acquire the basic element of the basic object, and otherwise, does not perform processing. The method for obtaining the position and size of other basic objects is similar to the method for obtaining the position and size of cells or graphics, and those skilled in the art can also obtain the position and size of the basic object in other manners, which are not described in detail herein.
Step 203: a drawing function is created from the base element data. Specifically, a drawing function is created for the basic elements in the basic object according to the acquired basic object data.
Step 204: and generating a basic primitive by using a drawing function. Specifically, the drawing function created in step 203 may be used to draw vector primitives, which are referred to as primitives in this application. In the embodiment of the present application, if the basic object is a cell, the basic elements in the cell of the basic object include: character elements, filling elements and frame elements. The second function creates a drawing function from the cell data, comprising: drawing function of text: createTextDrawing () which represents the generation of a character primitive used for drawing a character element; drawing function of the frame: createLineDrawing (), which indicates that line segment primitives are generated, and the border or broken line segment of one cell can be represented by a plurality of line segment primitives; filled drawing function: and the CreateFillDrawing () represents the generation of the filling graphic primitive and is used for filling the closed area formed by the line segment graphic primitive. The embodiment of the application also comprises a drawing method which is created by the second function for other basic objects, and the drawing method comprises the following steps: createPolygonDrawing (), which represents to generate polygon primitives for drawing polygon graphics and specifying filling colors; createPathDrawing () used for representing a generated path primitive and drawing an arbitrary curve; createimagedraw (), which represents generating a picture primitive for drawing a picture element.
Step 104: and constructing a primitive tree of the output area according to the service object, the basic object and the basic element. Specifically, a primitive tree is constructed by taking an output area as a root node, a service object as a child node and a basic object as a grandchild node; the business object and the basic object can be in a multi-layer tree structure. The business object comprises a basic object and/or a diagram group and/or a basic diagram element; the group of primitives comprises basic primitives. Through steps 101 to 103, the service object in the output area is decomposed hierarchically and is constructed as a primitive tree as shown in fig. 4, wherein the basic elements are replaced by the abstracted basic primitives, the basic primitives in 404 may form primitive groups, the basic object in 403 may form primitive groups, and the basic primitives may also be used as child nodes to form the service object individually and/or as the basic object. In this embodiment, as shown in fig. 5, where 501 is a root node of the output area primitive tree, 502 is a child node of the primitive tree, 503 is a grandchild node of the primitive tree, and a basic primitive abstracted by a basic element of a basic object in 503 may constitute a primitive group such as 505.
Step 105: and determining the type of the display equipment and calling a corresponding function to output the primitive tree. Specifically, determining the type of the display equipment; wherein the display device types include: display screen, printer, PDF, HTML, picture and SVG; traversing the primitive tree to determine the basic primitive in the primitive tree; and calling a drawing function and an API corresponding to the display equipment, and drawing the primitive tree in the display equipment. In the embodiment of the present application, if the display device is the display 604, 604 shown in fig. 6, controlled by the host 603 and connected to the network 601, the display device is the screen of the display 604, and the PaintToScreen () method in the API is called to draw the primitive tree on the display during output. Similar to 604 input methods, a tablet computer 602 and a portable computer 606 are also included. In addition, the primitive tree can be output in an Html format, a PDF format or an SVG format through the combination of operations 603 and 604 and 606 or 602, and the primitive tree can be drawn as required only by calling different functions PaintToHtml (), paintToPDF () and PaintToSVG () in the API respectively. Because each output device has a fixed drawing function, when the primitive tree in the application is output, each basic primitive in the primitive tree needs to be traversed, a pre-programmed conversion layer function is called, and the basic primitives in the application are converted, so that the drawing of the output device draws each basic primitive in the primitive tree.
Meanwhile, the printer can be connected to print files with different formats. The device used in the embodiments of the present application includes at least the device or module shown in fig. 7.
Moreover, in the embodiment of the application, different basic primitives are located in different layers, and a service object and/or a basic object and/or basic element information can be searched by traversing the primitive tree; or the attributes of the primitive tree and/or the child nodes of each node in the primitive tree are modified, and the scaling or position adjustment is carried out on the output area and/or part of the objects in the output area; or deleting or adding business objects and/or base elements in the primitive tree.
It should be noted that, in the embodiments of the present application, the business object, the basic element, the basic primitive, the text primitive, getRangeDrawing (), getCellDrawing (), the primitive group, drawingGroup (), paintToHtml (), paintToPDF (), paintToSVG (), etc. can be understood as a name by those skilled in the art, and the idea of the embodiments of the present application is to decompose the complex object in the spreadsheet, abstract the bottom object into a drawing (in the embodiments of the present application, called primitive, basic primitive, or vector primitive), add an intermediate layer, isolate the spreadsheet and the final display device, render the spreadsheet into a uniform and adjustable form (in the embodiments of the present application, called primitive tree layer by layer), and finally, different devices only interface with the most basic elements. During output, only the conversion function written in advance and the API containing various output device types need to be called.
Although the present application provides method steps as described in an embodiment or flowchart, additional or fewer steps may be included based on conventional or non-inventive efforts. The sequence of steps recited in this embodiment is only one of many steps performed and does not represent a unique order of execution. When an actual apparatus or client product executes, it can execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the methods shown in this embodiment or the figures.
As shown in fig. 3, an embodiment of the present application further provides a drawing implementation apparatus 300 based on vector primitives. The device includes: a determination module 301, an identification module 302, an abstraction module 303, a construction module 304 and an output module 305.
The determining module 301 is configured to obtain a service object in the output area and determine a type of the service object. The determining module 301 is specifically configured to create a first function for acquiring a service object in an output area; wherein the output area includes the entire spreadsheet, a selected piece of area, or a displayed visual interface area.
The identification module 302 is used for identifying a basic object in the business objects. The identifying module 302 is specifically configured to, in this embodiment of the application, the basic objects in the graph include: cell, fill, text, curve, etc. The base objects in the table include: cell, fill, text, etc.
The abstraction module 303 is configured to abstract the basic elements in the basic object into basic primitives; and different basic primitives are positioned in different layers. The abstraction module 303 is specifically configured to create a second function for the base object; wherein the first function may call the second function; identifying a base element in the base object using a second function; a drawing function is created from the base element data. Specifically, the basic elements in the basic object are identified by using a second function, and when the basic object is a table, the second function can traverse each cell in the table, and obtain information of the cell, such as row width, column height and the like, so as to calculate the position and size of the cell. When the basic object is a graph, a picture, a chart and the like, the second function finds out the optimal circumscribed rectangle of the basic object by acquiring the coordinate and the width and height information of the upper left corner of the basic object, judges whether the optimal circumscribed rectangle of the basic object is intersected with the output area or not, if the optimal circumscribed rectangle of the basic object is intersected with the output area, continues to acquire the basic element of the basic object, and otherwise, does not perform processing. The method for obtaining the position and size of other basic objects is similar to the method for obtaining the position and size of cells or graphics, and those skilled in the art can also obtain the position and size of the basic object in other manners, which are not described in detail herein. Creating a drawing function for the basic elements in the basic object according to the obtained basic object data can be used for drawing vector primitives, and the vector primitives are simply called as primitives in the application.
The building module 304 is configured to build a primitive tree of the output area according to the business object, the base object, and the basic element. The building module 304 is specifically configured to build a primitive tree of the output area according to the service object, the base object, and the basic element. Specifically, the output area is taken as a root node, the service object is taken as a child node, and the basic object is taken as a grandchild node to construct the primitive tree; the business object and the basic object can be in a multi-layer tree structure. The business object comprises a basic object and/or a diagram group and/or a basic diagram element; the group of primitives comprises basic primitives.
The output module 305 is used for determining the type of the display device and calling the corresponding function to output the primitive tree. The output module 305 is specifically configured to determine the type of the display device; wherein the display device types include: display screen, printer, PDF, HTML, picture and SVG; and calling an API corresponding to the display equipment, and drawing a primitive tree in the display equipment. Different basic primitives are positioned in different layers, and business objects and/or basic element information can be searched by traversing a primitive tree; or the attributes of the primitive tree and/or the child nodes of each node in the primitive tree are modified, and the scaling or position adjustment is carried out on the output area and/or part of the objects in the output area; or deleting or adding business objects and/or base elements in the primitive tree.
The storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache, a Hard Disk (Hard Disk Drive), or a Memory Card (HDD). The memory may be used to store computer program instructions.
The apparatuses or modules illustrated in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. The functionality of the modules may be implemented in the same one or more software and/or hardware implementations of the present application. Of course, a module that implements a certain function may be implemented by a plurality of sub-modules or sub-units in combination.
The methods, apparatus or modules described herein may be implemented in computer readable program code means for a controller in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application Specific Integrated Circuits (ASICs), programmable logic controllers and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
An embodiment of the present application further provides an apparatus, including: a processor; a memory for storing processor-executable instructions; when the processor executes the executable instructions, the method according to the embodiment of the application is realized.
Embodiments of the present application also provide a non-transitory computer-readable storage medium having stored thereon a computer program or instructions, which when executed, cause a method as described in embodiments of the present application to be implemented.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone, or two or more modules may be integrated into one module.
The storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache, a Hard Disk (Hard Disk Drive), or a Memory Card (HDD). The memory may be used to store computer program instructions.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary hardware. Based on such understanding, the technical solutions of the present application may be embodied in the form of software products or in the implementation process of data migration, which essentially or partially contributes to the prior art. The computer software product may be stored in a storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to perform the methods described in the various embodiments or portions of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. All or portions of the present application are operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure.

Claims (6)

1. A drawing method implementation method based on vector graphics primitives is characterized by comprising the following steps:
creating a first function which can be used for acquiring a business object in an output area; wherein the output area comprises a whole electronic form, a selected piece of area or a displayed visual interface area;
acquiring the business object in the output area according to the first function and determining the type of the business object;
identifying a base object in the business objects;
creating a second function for the base object; wherein the first function may call the second function;
identifying a base element in the base object using the second function;
creating a drawing function according to the basic element data;
generating a basic primitive by using the drawing function; different basic primitives are positioned in different layers;
the output area is used as a root node, the service object is used as a child node, and the basic object is used as a grandchild node to construct a primitive tree; the business object and the basic object are in a multilayer tree structure, the business object comprises the basic object and/or a primitive group and/or the basic primitive, and the primitive group comprises the basic primitive;
traversing the primitive tree to search the business object and/or the basic element information;
scaling or adjusting the position of the output area and/or a part of the objects in the output area by modifying the attributes of the primitive tree and/or the sub-nodes of each node in the primitive tree;
deleting or adding the service object and/or the basic element in the primitive tree;
and determining the type of the display equipment and calling a corresponding function to output the primitive tree.
2. The method of claim 1, wherein the basic elements comprise text elements, line segment elements, polygon elements, curve elements, color fill elements, and picture elements.
3. The method of claim 1, wherein determining the display device type and calling the corresponding function to output the primitive tree comprises:
determining a type of the display device; wherein the display device types include: display screen, printer, PDF, HTML, picture and SVG;
traversing the primitive tree to determine the basic primitive in the primitive tree;
and calling a drawing function and an API corresponding to the display equipment, and drawing the primitive tree in the display equipment.
4. A drawing realization device based on vector primitives is characterized by comprising the following steps:
the first function module is used for creating a first function which can be used for acquiring the business object in the output area; wherein the output area comprises a whole electronic form, a selected piece of area or a displayed visual interface area;
the determining module is used for acquiring the business object in the output area according to the first function and determining the type of the business object;
the first identification module is used for identifying a basic object in the business objects;
a second function module for creating a second function for the base object; wherein the first function may call the second function;
a second identification module for identifying a base element in the base object using the second function;
the drawing function module is used for creating a drawing function according to the basic element data;
the generating module is used for generating a basic primitive by using the drawing function; different basic primitives are positioned in different layers;
the primitive tree module is used for constructing a primitive tree by taking the output area as a root node, the service object as a child node and the basic object as a grandchild node; the business object and the basic object are in a multilayer tree structure, the business object comprises the basic object and/or a primitive group and/or the basic primitive, and the primitive group comprises the basic primitive;
the traversal module is used for traversing the primitive tree to search the business object and/or the basic element information;
the adjusting module is used for carrying out scaling or position adjustment on the output area and/or part of objects in the output area by modifying the attributes of the primitive tree and/or the child nodes of each node in the primitive tree;
the adding module is used for deleting or adding the service object and/or the basic element in the primitive tree;
and the output module is used for determining the type of the display equipment and calling a corresponding function to output the primitive tree.
5. An apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
the processor, when executing the executable instructions, implements the method of any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium comprising instructions for storing a computer program or instructions that, when executed, cause the method of any of claims 1 to 3 to be implemented.
CN202211629593.9A 2022-12-19 2022-12-19 Drawing method implementation method and device based on vector graphics primitives Active CN115630622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211629593.9A CN115630622B (en) 2022-12-19 2022-12-19 Drawing method implementation method and device based on vector graphics primitives

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211629593.9A CN115630622B (en) 2022-12-19 2022-12-19 Drawing method implementation method and device based on vector graphics primitives

Publications (2)

Publication Number Publication Date
CN115630622A CN115630622A (en) 2023-01-20
CN115630622B true CN115630622B (en) 2023-03-21

Family

ID=84910790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211629593.9A Active CN115630622B (en) 2022-12-19 2022-12-19 Drawing method implementation method and device based on vector graphics primitives

Country Status (1)

Country Link
CN (1) CN115630622B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857696A (en) * 2019-04-30 2020-10-30 腾讯科技(深圳)有限公司 Structure adjustment method, device, equipment and medium for visual manuscript
CN115359145A (en) * 2022-04-24 2022-11-18 远光软件股份有限公司 Method and device for drawing process graphics primitives, storage medium and computer equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0862302A3 (en) * 1997-02-26 2002-10-09 Nec Corporation Decorder using a finite state machine in decoding an abstract syntax notation-message and an encoder for carrying out encoding operation at a high speed
CN104217306A (en) * 2014-09-23 2014-12-17 中国南方电网有限责任公司 Computer modeling method of full operation flow based on structuralization
CN104866319B (en) * 2015-06-04 2018-05-01 南京国电南自城乡电网自动化工程有限公司 The method of logic chart execution sequence and feedback decoupling based on adjacency matrix
US10360288B2 (en) * 2017-01-25 2019-07-23 International Business Machines Corporation Web page design snapshot generator
CN113052942B (en) * 2021-03-31 2023-06-30 抖音视界有限公司 Chart generation method, device, storage medium and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857696A (en) * 2019-04-30 2020-10-30 腾讯科技(深圳)有限公司 Structure adjustment method, device, equipment and medium for visual manuscript
CN115359145A (en) * 2022-04-24 2022-11-18 远光软件股份有限公司 Method and device for drawing process graphics primitives, storage medium and computer equipment

Also Published As

Publication number Publication date
CN115630622A (en) 2023-01-20

Similar Documents

Publication Publication Date Title
CN110096277B (en) Dynamic page display method and device, electronic equipment and storage medium
CA2773152C (en) A method for users to create and edit web page layouts
US9620084B2 (en) Method and apparatus of graphical object selection in a web browser
JP3392870B2 (en) Graphic edge system
EP0679278B1 (en) Object-oriented constructive area system
Wu et al. ViSizer: a visualization resizing framework
CN110377285A (en) A kind of method, apparatus and computer equipment generating page skeleton screen
US7278098B1 (en) Method and apparatus for implementing web pages having smart tables
US9886465B2 (en) System and method for rendering of hierarchical data structures
US20140164911A1 (en) Preserving layout of region of content during modification
US9646362B2 (en) Algorithm for improved zooming in data visualization components
US10403040B2 (en) Vector graphics rendering techniques
CN114895891A (en) Graphic software processing method and device, electronic equipment and storage medium
US10169734B2 (en) Dynamic layout for organizational charts
CN107391148B (en) View element saving method and device, electronic equipment and computer storage medium
CN115630622B (en) Drawing method implementation method and device based on vector graphics primitives
CN109800039B (en) User interface display method and device, electronic equipment and storage medium
CN116010736A (en) Vector icon processing method, device, equipment and storage medium
CN112417345B (en) Rendering method, rendering device, electronic equipment and storage medium
CN111768823B (en) SVG element-based medical expression editing method, device, equipment and medium
Quint et al. An abstract model for interactive pictures
CN114625460B (en) Image-text mixed arrangement method, device, equipment and storage medium
RU2752777C1 (en) Web browser objects computer-aided magnification and centering
CN117688916A (en) Method, device, equipment and storage medium for inserting form in layout document
Hsia et al. Construction and manipulation of dynamic icons

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