CN111158564A - Method and terminal for restoring picture clipping effect in PowerPoint - Google Patents

Method and terminal for restoring picture clipping effect in PowerPoint Download PDF

Info

Publication number
CN111158564A
CN111158564A CN201911321692.9A CN201911321692A CN111158564A CN 111158564 A CN111158564 A CN 111158564A CN 201911321692 A CN201911321692 A CN 201911321692A CN 111158564 A CN111158564 A CN 111158564A
Authority
CN
China
Prior art keywords
picture
cutting
resource
powerpoint
cut
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.)
Granted
Application number
CN201911321692.9A
Other languages
Chinese (zh)
Other versions
CN111158564B (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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology 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 Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201911321692.9A priority Critical patent/CN111158564B/en
Publication of CN111158564A publication Critical patent/CN111158564A/en
Application granted granted Critical
Publication of CN111158564B publication Critical patent/CN111158564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a method and a terminal for restoring a picture cutting effect in PowerPoint, which are used for reading an XML file in a PPTX compression format file; traversing the node content in the XML file, and determining a cut picture; obtaining cutting parameters and picture resources of the picture according to the cut picture; and cutting the picture resource according to the cutting parameters, so that the PowerPoint can be simulated under the condition that the pictures in the PPTX file do not rely on the PowerPoint any more, the purpose of quickly and accurately restoring the picture cutting effect is achieved, meanwhile, the problem that a large amount of time is consumed due to the fact that picture pixels need to be checked one by one and the pictures need to be restored when the traditional picture cutting effect is restored is effectively solved, and the efficiency of the picture cutting effect in the PowerPoint is improved.

Description

Method and terminal for restoring picture clipping effect in PowerPoint
Technical Field
The invention relates to the field of image processing, in particular to a method and a terminal for restoring a picture cutting effect in PowerPoint.
Background
In order to trim an original picture in a PPTX file to have the same effect as that of a picture clipped by PowerPoint, the clipped picture needs to be analyzed, the PPTX file is usually saved as a web page format by means of PowerPoint and saved in a folder, all pictures in the PPT in the PPTX file are stored under the folder, including the original picture and the picture processed by PowerPoint, wherein the jpg format is the original picture, the gif format is the picture processed by PowerPoint, the gif format picture is selected, the picture attribute is checked, the picture pixel of the picture is obtained and recorded, the original picture is led into the PS, the original picture is correspondingly processed according to the recorded corresponding processed picture pixel, or the original picture is directly led into the PowerPoint, the clipping option in the PowerPoint format is clicked to correspondingly clip the picture, however, the method can achieve the effect of restoration, however, it takes a lot of time to view the pixels of the picture one by one and restore the pixels by using the drawing library, which affects the efficiency of restoring the clipping effect of the picture in PowerPoint.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method and the terminal for restoring the picture cutting effect in the PowerPoint can effectively analyze the cutting parameters of the picture in the PPTX file and realize the fast and accurate picture cutting effect in the PowerPoint.
In order to solve the technical problems, the invention adopts the technical scheme that:
a method for restoring a picture clipping effect in PowerPoint comprises the following steps:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a terminal for restoring the image clipping effect in PowerPoint comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the following steps when executing the computer program:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
The invention has the beneficial effects that: traversing node contents in an XML file under a PPTX file, determining a cut picture, acquiring cutting parameters and picture resources of the picture, and cutting the picture resources according to the cutting parameters. Because the XML file contains the mark symbols for describing the PPT page content, all cut pictures in the file can be quickly positioned by reading the node content in the XML file under the PPTX compression format file, the cutting parameters of the pictures are analyzed, and the picture resources are cut according to the cutting parameters, so that the pictures in the PPTX file can also simulate PowerPoint without depending on PowerPoint, the purpose of quickly restoring the picture cutting effect is achieved, meanwhile, the problem of large time consumption caused by the fact that picture pixels need to be checked one by one in the traditional restoration cutting effect is effectively solved, and the efficiency of restoring the picture cutting effect in the PowerPoint is improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for restoring a cropping effect of a PowerPoint according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a terminal for restoring a picture clipping effect in PowerPoint according to an embodiment of the present invention;
description of reference numerals:
1. a terminal for restoring the image cutting effect in PowerPoint; 2. a memory; 3. a processor.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, a method for restoring a clipping effect of a picture in PowerPoint includes the steps of:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
As can be seen from the above description, the beneficial effects of the present invention are: traversing node contents in an XML file under a PPTX file, determining a cut picture, acquiring cutting parameters and picture resources of the picture, and cutting the picture resources according to the cutting parameters. Because the XML file contains the mark symbols for describing the PPT page content, all cut pictures in the file can be quickly positioned by reading the node content in the XML file under the PPTX compression format file, the cutting parameters of the pictures are analyzed, and the picture resources are cut according to the cutting parameters, so that the pictures in the PPTX file can also simulate PowerPoint without depending on PowerPoint, the purpose of quickly restoring the picture cutting effect is achieved, meanwhile, the problem of large time consumption caused by the fact that picture pixels need to be checked one by one in the traditional restoration cutting effect is effectively solved, and the efficiency of restoring the picture cutting effect in the PowerPoint is improved.
Further, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for marking the cut picture exist under the picture nodes, if so, executing step S3, and if not, not processing.
According to the description, the specific node identification is under the corresponding picture node after the picture is cut, so that whether the node for identifying the cut picture exists under the picture node is judged, all the cut pictures in the file can be quickly positioned, the analysis time of the picture cutting effect in the PPTX file can be effectively saved, and the analysis efficiency is improved.
Further, the step S3 includes:
s31, analyzing the node of the marked picture after being cut, obtaining the cutting parameter of the picture and the unique mark of the picture, and storing the cutting parameter and the unique mark in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and executing the following steps for each unique identifier respectively:
s321, matching a relative path of the corresponding picture resource in the page resource association file according to the unique identifier, and acquiring the picture resource by using the relative path;
s322, establishing a corresponding relation between the corresponding cutting parameter and the picture resource based on the unique identifier, and storing the picture resource in a project directory in a file form.
According to the description, the cutting data of the picture is required to be known when the cutting effect of the picture is to be restored, so that the cutting parameter of the picture is acquired, and the purpose of accurately simulating the picture cutting effect in PowerPoint can be achieved according to the cutting parameter. The unique identification of the picture is obtained, the picture resource is obtained through the unique identification as the unique ID for identifying the picture, the reliability of picture obtaining can be ensured, in addition, the unique identification of the picture and the corresponding cutting parameter are stored into the JSON array together, the corresponding relation between the cutting parameter and the picture is avoided from being confused, meanwhile, the JSON array is used for storing data, the data transmission is facilitated, redundant characters are reduced, and the structure of data storage is more visual. According to the unique identification of the picture, the corresponding relation between the cutting parameter and the picture resource is established, the numerical value of the cutting parameter can be conveniently obtained according to the corresponding relation when the picture resource is cut subsequently, and the efficiency of restoring the picture cutting effect in PowerPoint is improved.
Further, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
and acquiring a JSON array storing the cutting parameters according to the corresponding relation between the picture resources and the cutting parameters, reading the numerical values of the cutting parameters based on the JSON array, and cutting the picture resources according to the cutting parameters by using a drawing library.
According to the description, all the picture resources are traversed, the numerical values of the transmitted cutting parameters are directly read according to the obtained JSON array, the picture resources are cut according to the numerical values of the parameters by using the drawing library, the problem that a large amount of time is consumed due to the fact that picture pixels need to be checked one by one and pictures need to be restored when the traditional cutting effect is restored is effectively solved, and the efficiency of the picture cutting effect in PowerPoint is improved.
Further, the clipping the picture resource according to the clipping parameter by using the drawing library in the step S4 includes:
obtaining the original pixel width and height of the picture resource, calculating the pixel width and height of the picture resource after cutting according to the original pixel width and height of the picture resource and the corresponding cutting parameter, and carrying out graphic drawing on the picture resource by using a drawing library based on the pixel width and height after cutting to obtain the cut picture resource.
According to the description, the essence of the image clipping effect in the restored PowerPoint is to process the original image resource into the size of the clipped pixel of the image, so that the width and the height of the clipped pixel of the image resource are calculated according to the original pixel width and the height of the image resource and the corresponding clipping parameters, and the original image can achieve the purposes of simulating the PowerPoint and accurately restoring the image clipping effect according to the clipped pixel width and the height.
Referring to fig. 2, a terminal for restoring a clipping effect of a picture in PowerPoint includes a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the following steps when executing the computer program:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
As can be seen from the above description, the beneficial effects of the present invention are: traversing node contents in an XML file under a PPTX file, determining a cut picture, acquiring cutting parameters and picture resources of the picture, and cutting the picture resources according to the cutting parameters. Because the XML file contains the mark symbols for describing the PPT page content, all cut pictures in the file can be quickly positioned by reading the node content in the XML file under the PPTX compression format file, the cutting parameters of the pictures are analyzed, and the picture resources are cut according to the cutting parameters, so that the pictures in the PPTX file can also simulate PowerPoint without depending on PowerPoint, the purpose of quickly restoring the picture cutting effect is achieved, meanwhile, the problem of large time consumption caused by the fact that picture pixels need to be checked one by one in the traditional restoration cutting effect is effectively solved, and the efficiency of restoring the picture cutting effect in the PowerPoint is improved.
Further, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for marking the cut picture exist under the picture nodes, if so, executing step S3, and if not, not processing.
According to the description, the specific node identification is under the corresponding picture node after the picture is cut, so that whether the node for identifying the cut picture exists under the picture node is judged, all the cut pictures in the file can be quickly positioned, the analysis time of the picture cutting effect in the PPTX file can be effectively saved, and the analysis efficiency is improved.
Further, the step S3 includes:
s31, analyzing the node of the marked picture after being cut, obtaining the cutting parameter of the picture and the unique mark of the picture, and storing the cutting parameter and the unique mark in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and executing the following steps for each unique identifier respectively:
s321, matching a relative path of the corresponding picture resource in the page resource association file according to the unique identifier, and acquiring the picture resource by using the relative path;
s322, establishing a corresponding relation between the corresponding cutting parameter and the picture resource based on the unique identifier, and storing the picture resource in a project directory in a file form.
According to the description, the cutting data of the picture is required to be known when the cutting effect of the picture is to be restored, so that the cutting parameter of the picture is acquired, and the purpose of accurately simulating the picture cutting effect in PowerPoint can be achieved according to the cutting parameter. The unique identification of the picture is obtained, the picture resource is obtained through the unique identification as the unique ID for identifying the picture, the reliability of picture obtaining can be ensured, in addition, the unique identification of the picture and the corresponding cutting parameter are stored into the JSON array together, the corresponding relation between the cutting parameter and the picture is avoided from being confused, meanwhile, the JSON array is used for storing data, the data transmission is facilitated, redundant characters are reduced, and the structure of data storage is more visual. According to the unique identification of the picture, the corresponding relation between the cutting parameter and the picture resource is established, the numerical value of the cutting parameter can be conveniently obtained according to the corresponding relation when the picture resource is cut subsequently, and the efficiency of restoring the picture cutting effect in PowerPoint is improved.
Further, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
and acquiring a JSON array storing the cutting parameters according to the corresponding relation between the picture resources and the cutting parameters, reading the numerical values of the cutting parameters based on the JSON array, and cutting the picture resources according to the cutting parameters by using a drawing library.
According to the description, all the picture resources are traversed, the numerical values of the transmitted cutting parameters are directly read according to the obtained JSON array, the picture resources are cut according to the numerical values of the parameters by using the drawing library, the problem that a large amount of time is consumed due to the fact that picture pixels need to be checked one by one and pictures need to be restored when the traditional cutting effect is restored is effectively solved, and the efficiency of the picture cutting effect in PowerPoint is improved.
Further, the clipping the picture resource according to the clipping parameter by using the drawing library in the step S4 includes:
obtaining the original pixel width and height of the picture resource, calculating the pixel width and height of the picture resource after cutting according to the original pixel width and height of the picture resource and the corresponding cutting parameter, and carrying out graphic drawing on the picture resource by using a drawing library based on the pixel width and height after cutting to obtain the cut picture resource.
According to the description, the essence of the image clipping effect in the restored PowerPoint is to process the original image resource into the size of the clipped pixel of the image, so that the width and the height of the clipped pixel of the image resource are calculated according to the original pixel width and the height of the image resource and the corresponding clipping parameters, and the original image can achieve the purposes of simulating the PowerPoint and accurately restoring the image clipping effect according to the clipped pixel width and the height.
Example one
Referring to fig. 1, a method for restoring a clipping effect of a picture in PowerPoint includes the following steps:
s1, reading an XML file in the PPTX compression format file;
specifically, the contents of the specified files in the PPTX compression format file are decompressed through a zlib function library, and an XML file in the contents of the specified files is read through an RAPIDxml analysis library.
S2, traversing the node content in the XML file, and determining a cut picture;
specifically, the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for marking the cut picture exist under the picture nodes, if so, executing step S3, and if not, not processing.
Specifically, a file directory of a PPTX compressed format file after decompression is obtained, all PPT page content file slide #. XML in a slides directory under a PPT directory is searched in the decompressed directory, a picture node p: pic under the XML file is traversed, and when a: srcRect node exists in the p: blipFill node under the node, it is judged that a picture corresponding to the picture node is processed through a PowerPoint clipping effect.
S3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
specifically, the step S3 includes:
s31, analyzing the node of the marked picture after being cut, obtaining the cutting parameter of the picture and the unique mark of the picture, and storing the cutting parameter and the unique mark in an array in a JSON data format;
specifically, analysis a: the content of a node under a src node, wherein at least one of attributes l, t, r and b exists under the node, the value of the attribute l represents the left clipping value of the picture, the cropping value needs to be divided by 10000 to convert to the percentage of the left area of the picture that is cropped, when the calculated percentage is positive, the picture is extended outwards, when the calculated percentage is negative, the picture is cut inwards, similarly, the numerical values of the attributes of t, r and b are divided by 10000 to respectively represent the percentage size of cutting of the upper area, the right area and the lower area of the picture, the percentage converted from l, t, r and b is used for forming the cutting parameter of the picture, and a: peer node a of srcRect node: blip, obtaining r under the node: the value of the embed is set according to the formula, the r: the embed value represents the unique identification of the picture, and the cutting parameters and the unique identification of the picture are stored in an array in a one-to-one correspondence mode in a JSON data format.
S32, traversing all the unique identifiers stored in the array, and executing the following steps for each unique identifier respectively:
s321, matching a relative path of the corresponding picture resource in the page resource association file according to the unique identifier, and acquiring the picture resource by using the relative path;
specifically, matching a Target attribute representing a relative path of the picture resource under a Relationship node corresponding to the r: embed value in a page resource associated file slide #. xml.rels corresponding to the page number where the r: embed value is located, and acquiring the picture resource by using the relative path.
S322, establishing a corresponding relation between the corresponding cutting parameter and the picture resource based on the unique identifier, and storing the picture resource in a project directory in a file form.
Specifically, the corresponding relation between the cutting parameter and the picture resource is established according to the corresponding relation between the unique identifier of the picture and the cutting parameter and the corresponding relation between the unique identifier of the picture and the picture resource, and the picture resource is stored in the project directory in a file form.
And S4, cutting the picture resource according to the cutting parameters.
Specifically, the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
and acquiring a JSON array storing the cutting parameters according to the corresponding relation between the picture resources and the cutting parameters, reading the numerical values of the cutting parameters based on the JSON array, and cutting the picture resources according to the cutting parameters by using a drawing library.
Specifically, the cutting the picture resource according to the cutting parameter by using the drawing library in the step S4 includes:
obtaining the original pixel width and height of the picture resource, calculating the pixel width and height of the picture resource after cutting according to the original pixel width and height of the picture resource and the corresponding cutting parameter, and carrying out graphic drawing on the picture resource by using a drawing library based on the pixel width and height after cutting to obtain the cut picture resource.
Specifically, the original pixel width and height w and h of the picture resource are obtained, and assuming that the pixel width and height of the picture after clipping are width and height, the following steps are performed:
width=w–(w*l+w*r)
height=h–(h*t+h*b)
and l, t, r and b respectively represent cutting percentage parameters of left, upper, right and lower regions of the picture, and the picture resource is subjected to graphic drawing by using a drawing library GDI + according to the calculated width, height and height of the cut pixel to obtain the cut or extended picture.
Example two
Referring to fig. 2, a terminal 1 for restoring a picture cropping effect in PowerPoint includes a memory 2, a processor 3, and a computer program stored in the memory 2 and operable on the processor 3, where the processor 3 implements the steps in the first embodiment when executing the computer program.
In summary, according to the method and terminal for restoring the clipping effect of the picture in PowerPoint provided by the present invention, because the XML file includes the markup symbol for describing the content of the PPT page, which can be used to explain the element information in the PPT, the PPTX compressed format file is decompressed through zlib, the node content in the XML file decompressed by the PPTX file is read by using RAPIDxml, all the clipped pictures in the file can be quickly located, because the clipping of the picture involves the change of the picture pixel, the clipped nodes of the marked picture are analyzed, the clipping percentages of the upper, lower, left and right regions of the picture are obtained as the clipping parameters, so that the drawing library can clip the picture resources according to the clipping parameters, thereby achieving the purpose of accurately restoring the clipping effect of the picture in PowerPoint, the unique mark of the picture and the corresponding clipping parameters thereof are stored together in the on array, thereby avoiding confusion of the corresponding relationship between the clipping parameters and the picture, meanwhile, the corresponding relation between the cutting parameters and the picture resources is conveniently established according to the corresponding relation, so that the JSON array for storing the cutting parameters can be directly obtained by using the picture resources in the process of reducing the cutting effect, the problem that a large amount of time is consumed due to the fact that picture pixels need to be checked one by one in the traditional process of reducing the cutting effect is effectively solved, the efficiency of reducing the picture cutting effect in PowerPoint is improved, the picture cutting effect in the PowerPoint is essentially that the original picture resources are processed into the size of the pixels of the picture after cutting, the picture resources are traversed, the picture resources are cut according to the calculated width and height of the cut pixels, and the purposes of simulating the PowerPoint and accurately reducing the picture cutting effect are achieved.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for restoring a picture clipping effect in PowerPoint is characterized by comprising the following steps:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
2. The method for restoring picture cropping effects in PowerPoint according to claim 1, wherein said step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for marking the cut picture exist under the picture nodes, if so, executing step S3, and if not, not processing.
3. The method for restoring picture cropping effects in PowerPoint according to claim 2, wherein the step S3 includes:
s31, analyzing the node of the marked picture after being cut, obtaining the cutting parameter of the picture and the unique mark of the picture, and storing the cutting parameter and the unique mark in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and executing the following steps for each unique identifier respectively:
s321, matching a relative path of the corresponding picture resource in the page resource association file according to the unique identifier, and acquiring the picture resource by using the relative path;
s322, establishing a corresponding relation between the corresponding cutting parameter and the picture resource based on the unique identifier, and storing the picture resource in a project directory in a file form.
4. The method for restoring picture cropping effects in PowerPoint according to claim 3, wherein said step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
and acquiring a JSON array storing the cutting parameters according to the corresponding relation between the picture resources and the cutting parameters, reading the numerical values of the cutting parameters based on the JSON array, and cutting the picture resources according to the cutting parameters by using a drawing library.
5. The method according to claim 4, wherein the clipping the picture resource according to the clipping parameter by using the drawing library in step S4 comprises:
obtaining the original pixel width and height of the picture resource, calculating the pixel width and height of the picture resource after cutting according to the original pixel width and height of the picture resource and the corresponding cutting parameter, and carrying out graphic drawing on the picture resource by using a drawing library based on the pixel width and height after cutting to obtain the cut picture resource.
6. A terminal for restoring the image clipping effect in PowerPoint comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and is characterized in that the processor executes the computer program to realize the following steps:
s1, reading an XML file in the PPTX compression format file;
s2, traversing the node content in the XML file, and determining a cut picture;
s3, obtaining cutting parameters and picture resources of the picture according to the cut picture;
and S4, cutting the picture resource according to the cutting parameters.
7. The terminal for restoring the cropping effect of pictures in PowerPoint according to claim 6, wherein the step S2 includes:
acquiring all files representing PPT page content under the XML file, traversing picture nodes under the files, judging whether nodes for marking the cut picture exist under the picture nodes, if so, executing step S3, and if not, not processing.
8. The terminal for restoring the cropping effect of pictures in PowerPoint according to claim 7, wherein the step S3 includes:
s31, analyzing the node of the marked picture after being cut, obtaining the cutting parameter of the picture and the unique mark of the picture, and storing the cutting parameter and the unique mark in an array in a JSON data format;
s32, traversing all the unique identifiers stored in the array, and executing the following steps for each unique identifier respectively:
s321, matching a relative path of the corresponding picture resource in the page resource association file according to the unique identifier, and acquiring the picture resource by using the relative path;
s322, establishing a corresponding relation between the corresponding cutting parameter and the picture resource based on the unique identifier, and storing the picture resource in a project directory in a file form.
9. The terminal for restoring the cropping effect of pictures in PowerPoint according to claim 8, wherein the step S4 includes:
traversing all the picture resources stored in the project directory, and respectively executing the following steps on each picture resource:
and acquiring a JSON array storing the cutting parameters according to the corresponding relation between the picture resources and the cutting parameters, reading the numerical values of the cutting parameters based on the JSON array, and cutting the picture resources according to the cutting parameters by using a drawing library.
10. The terminal for restoring picture clipping effect in PowerPoint according to claim 9, wherein the clipping picture resources according to the clipping parameters by using the drawing library in step S4 includes:
obtaining the original pixel width and height of the picture resource, calculating the pixel width and height of the picture resource after cutting according to the original pixel width and height of the picture resource and the corresponding cutting parameter, and carrying out graphic drawing on the picture resource by using a drawing library based on the pixel width and height after cutting to obtain the cut picture resource.
CN201911321692.9A 2019-12-20 2019-12-20 Method and terminal for restoring picture clipping effect in PowerPoint Active CN111158564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911321692.9A CN111158564B (en) 2019-12-20 2019-12-20 Method and terminal for restoring picture clipping effect in PowerPoint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911321692.9A CN111158564B (en) 2019-12-20 2019-12-20 Method and terminal for restoring picture clipping effect in PowerPoint

Publications (2)

Publication Number Publication Date
CN111158564A true CN111158564A (en) 2020-05-15
CN111158564B CN111158564B (en) 2021-03-30

Family

ID=70557454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911321692.9A Active CN111158564B (en) 2019-12-20 2019-12-20 Method and terminal for restoring picture clipping effect in PowerPoint

Country Status (1)

Country Link
CN (1) CN111158564B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963956A (en) * 2010-09-19 2011-02-02 深圳市万兴软件有限公司 Method and device for converting XML document into PPTX document
CN105094563A (en) * 2015-08-11 2015-11-25 成都视达科信息技术有限公司 Image clipping method and system
CN105303516A (en) * 2015-10-15 2016-02-03 黄云鸿 Picture batch processing method and system
CN105988790A (en) * 2015-02-09 2016-10-05 腾讯科技(深圳)有限公司 Information processing method, transmitting terminal and receiving terminal
WO2017083169A1 (en) * 2015-11-13 2017-05-18 Microsoft Technology Licensing, Llc Content file layout arrangement suggestions
CN108037915A (en) * 2017-11-07 2018-05-15 福建天泉教育科技有限公司 A kind of method and terminal of acquisition json configuration files
CN109521914A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 Restore the methods, devices and systems of data in file

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963956A (en) * 2010-09-19 2011-02-02 深圳市万兴软件有限公司 Method and device for converting XML document into PPTX document
CN105988790A (en) * 2015-02-09 2016-10-05 腾讯科技(深圳)有限公司 Information processing method, transmitting terminal and receiving terminal
CN105094563A (en) * 2015-08-11 2015-11-25 成都视达科信息技术有限公司 Image clipping method and system
CN105303516A (en) * 2015-10-15 2016-02-03 黄云鸿 Picture batch processing method and system
WO2017083169A1 (en) * 2015-11-13 2017-05-18 Microsoft Technology Licensing, Llc Content file layout arrangement suggestions
CN109521914A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 Restore the methods, devices and systems of data in file
CN108037915A (en) * 2017-11-07 2018-05-15 福建天泉教育科技有限公司 A kind of method and terminal of acquisition json configuration files

Also Published As

Publication number Publication date
CN111158564B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN103488569B (en) The method of testing of electronic equipment performance and device
CN109389659B (en) Rendering method and device of mathematical formula in PPT, storage medium and terminal equipment
CN112445693A (en) Page update detection method, device, equipment and storage medium
CN111581208A (en) Data visualization display method and device
CN114972817A (en) Image similarity matching method, device and storage medium
CN111061896B (en) Loading method, device, equipment and medium for 3D (three-dimensional) graph based on glTF (generalized likelihood TF)
CN115439609A (en) Three-dimensional model rendering method, system, device and medium based on map service
CN115115968A (en) Video quality evaluation method and device and computer readable storage medium
CN107169057B (en) Method and device for detecting repeated pictures
CN110662080A (en) Machine-oriented universal coding method
CN111158564B (en) Method and terminal for restoring picture clipping effect in PowerPoint
CN112836124A (en) Image data acquisition method and device, electronic equipment and storage medium
CN111460629B (en) Graphic data checking method and device, electronic equipment and computer storage medium
JP2019101889A (en) Test execution device and program
CN110727565B (en) Network equipment platform information collection method and system
CN115375812A (en) CAD data rendering method and device, electronic equipment and storage medium
CN111145104B (en) Method and terminal for restoring picture brightness and contrast
CN111680178B (en) Method and terminal for checking thumbnail
CN111192336A (en) Method and terminal for restoring linear gradual change of background title shadows in PPTX
CN111127306B (en) Method and terminal for restoring transparency of picture in PPTX file
CN111080745B (en) Method and terminal for re-coloring pictures in PowerPoint
CN110909098A (en) Cloud geographic information data analysis method and system
CN103345437B (en) The method of testing of the graphic output interface of mobile terminal client terminal browser and device
CN114724276B (en) Processing method, playing method and related equipment for multi-type log data
CN115455327A (en) Page template generation method, electronic device, storage medium and program product

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