CN102789501B - Method for replacing vector diagram in swf (shock wave flash) file - Google Patents
Method for replacing vector diagram in swf (shock wave flash) file Download PDFInfo
- Publication number
- CN102789501B CN102789501B CN201210248011.2A CN201210248011A CN102789501B CN 102789501 B CN102789501 B CN 102789501B CN 201210248011 A CN201210248011 A CN 201210248011A CN 102789501 B CN102789501 B CN 102789501B
- Authority
- CN
- China
- Prior art keywords
- file
- swf file
- label
- source swf
- source
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a method for replacing a vector diagram in a swf (shock wave flash) file, which comprises the following steps of: S1, receiving a first source swf file of which the vector diagram needs to be replaced; S2, reading the first source swf file in a binary stream mode; S3, analyzing a file header of the first source swf file to obtain first file header information of the first source swf file; S4, according to the first file header information, analyzing a tag in the first source swf file to obtain first tag information; S5, according to the first tag information, positioning a first DefineShape4 tag; S6, covering a specific part in the first DefineShape4 tag of the first source swf file with vector diagram data for replacement; and S7, generating a new swf file to complete the replacement. The method dispenses with programming, is simple and convenient to operate and is easy to understand; the efficiency is improved; and the processing difficulty is reduced.
Description
Technical field
The present invention relates to technical field of internet application, relate in particular to the method for the polar plot in a kind of swf of replacement file.
Background technology
When needs are during to swf file modification, conventionally need to replace the polar plot in swf file, to reach the object of revising swf file.
But in prior art, major part is all the polar plot that can only check in swf file, and can not replace.
Even if can replace the polar plot in swf file by the mode of coding voluntarily, although realized the replacement of polar plot, but in replacement process, destroyed the attribute of original swf file, the replacement result that causes the swf file after replacement normally to use or to obtain is not needed, has just lost yet and has replaced the meaning of revising.And this program of writing voluntarily cannot tackle all swf files, so it has significant limitation.
The file that swf file ends up with " .swf ", Swf i.e. the abbreviation of " shock wave flash ", it is the professional format of the animation software Flash of Macromedia (Xian Yibei ADOBE corporate buyout) company, it is the animation file form of a kind of support vector and dot pattern, be widely used in webpage design, the fields such as cartoon making.
Summary of the invention
The object of the present invention is to provide and a kind ofly do not destroying original swf file, do not changing under the prerequisite of original swf file, replace the method for the polar plot in swf file, thereby solve the foregoing problems existing in prior art.To achieve these goals, the technical solution used in the present invention is as follows:
A method of replacing the polar plot in swf file, comprises the following steps:
S1, reception need to be replaced the first source swf file of polar plot;
S2, reads described the first source swf file in binary stream mode;
S 3, resolve the file header of described the first source swf file, obtain the first file header information of described the first source swf file;
S4, according to described the first file header information, resolves the label in described the first source swf file, obtains the first label information;
S5, according to described the first label information, navigates to a DefineShape4 label;
S6, covers the vector map data that is used for replacing the specific part in the described DefineShape4 label of described the first source swf file;
S7, generates new swf file, completes replacement.
Preferably, described specific part is that a described DefineShape4 label is removed other parts after tag head information, shapeID, ShapeBounds and EdgeBounds.
Preferably, further comprising the steps of between S3 and S4:
According to described the first file header information, judge the whether compressed mistake of described the first source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step.
Preferably, described vector map data is to extract by following steps the data that obtain:
S61, reception need to be from wherein extracting the second source swf file of vector map data;
S62, reads described the second source swf file in binary stream mode;
S63, resolves the file header of described the second source swf file, obtains the second file header information of described the second source swf file;
S64, according to described the second file header information, judges the whether compressed mistake of described the second source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step;
S65, according to described the second file header information, resolves the label in described the second source swf file, obtains the second label information;
S 66, according to described the second label information, navigate to the 2nd DefineShape4 label;
S 67, obtain in described the 2nd DefineShape4 label and remove other parts after tag head information, shapeID, ShapeBounds and EdgeBounds, obtained described vector map data.
The invention has the beneficial effects as follows:
Without programming, easy and simple to handle understandable, improve efficiency and reduced intractability.
The attribute, the nothing that have intactly retained original swf file are destructive.
Accompanying drawing explanation
Fig. 1 is this bright flow chart of steps.
Embodiment
In order to make technical matters solved by the invention, technical scheme and beneficial effect clearer, below in conjunction with accompanying drawing, the present invention is further elaborated.Should be appreciated that embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Following table is, the structure of swf file:
Header is wherein file header part, and tag is label segment.
Following table is, the structure of the polar plot label in swf file (that is, DefineShape4 label):
As shown in Figure 1, the method for the polar plot in replacement swf file disclosed in this invention, comprises the following steps:
S1, reception need to be replaced the first source swf file of polar plot;
S2, reads described the first source swf file in binary stream mode;
S3, resolves the file header of described the first source swf file, obtains the first file header information of described the first source swf file;
According to described the first file header information, judge the whether compressed mistake of described the first source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step;
S4, according to described the first file header information, resolves the label in described the first source swf file, obtains the first label information;
S5, according to described the first label information, navigates to a DefineShape4 label;
S6, covers the vector map data that is used for replacing the specific part in the described DefineShape4 label of described the first source swf file; Described specific part is that a described DefineShape4 label is removed other parts after tag head information, shapeID, ShapeBounds and EdgeBounds; Described vector map data is to extract the data that obtain: S61 by following steps, and reception need to be from wherein extracting the second source swf file of vector map data; S62, reads described the second source swf file in binary stream mode; S63, resolves the file header of described the second source swf file, obtains the second file header information of described the second source swf file; S64, according to described the second file header information, judges the whether compressed mistake of described the second source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step; S65, according to described the second file header information, resolves the label in described the second source swf file, obtains the second label information; S66, according to described the second label information, navigates to the 2nd DefineShape4 label; S67, obtains in described the 2nd DefineShape4 label and removes other parts after tag head information, shapeID, ShapeBounds and EdgeBounds, has obtained described vector map data;
S7, generates new swf file, completes replacement.
By adopting technique scheme disclosed by the invention, obtained following useful effect:
Without programming, easy and simple to handle understandable, improve efficiency and reduced intractability.
The attribute, the nothing that have intactly retained original swf file are destructive.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.
Claims (2)
1. a method of replacing the polar plot in swf file, is characterized in that, comprises the following steps:
S1, reception need to be replaced the first source swf file of polar plot;
S2, reads described the first source swf file in binary stream mode;
S3, resolves the file header of described the first source swf file, obtains the first file header information of described the first source swf file;
S4, according to described the first file header information, resolves the label in described the first source swf file, obtains the first label information;
S5, according to described the first label information, navigates to a DefineShape4 label;
S6, covers the vector map data that is used for replacing the specific part in the described DefineShape4 label of described the first source swf file;
S7, generates new swf file, completes replacement;
Described specific part is that a described DefineShape4 label is removed other parts after tag head information, shapeID, ShapeBounds and EdgeBounds;
Described vector map data is to extract by following steps the data that obtain:
S61, reception need to be from wherein extracting the second source swf file of vector map data;
S62, reads described the second source swf file in binary stream mode;
S63, resolves the file header of described the second source swf file, obtains the second file header information of described the second source swf file;
S64, according to described the second file header information, judges the whether compressed mistake of described the second source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step;
S65, according to described the second file header information, resolves the label in described the second source swf file, obtains the second label information;
S66, according to described the second label information, navigates to the 2nd DefineShape4 label;
S67, obtains in described the 2nd DefineShape4 label and removes other parts after tag head information, shapeID, ShapeBounds and EdgeBounds, has obtained described vector map data.
2. the method for the polar plot in replacement swf file according to claim 1, is characterized in that, further comprising the steps of between S3 and S4:
According to described the first file header information, judge the whether compressed mistake of described the first source swf file; If compressed mistake, carries out next step after first it being decompressed again; If there is no compressed mistake, directly carry out next step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210248011.2A CN102789501B (en) | 2012-07-17 | 2012-07-17 | Method for replacing vector diagram in swf (shock wave flash) file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210248011.2A CN102789501B (en) | 2012-07-17 | 2012-07-17 | Method for replacing vector diagram in swf (shock wave flash) file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102789501A CN102789501A (en) | 2012-11-21 |
CN102789501B true CN102789501B (en) | 2014-12-10 |
Family
ID=47154904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210248011.2A Active CN102789501B (en) | 2012-07-17 | 2012-07-17 | Method for replacing vector diagram in swf (shock wave flash) file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102789501B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104660267B (en) * | 2013-11-20 | 2019-04-12 | 腾讯科技(上海)有限公司 | The method and device of compressing file |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101470893A (en) * | 2007-12-26 | 2009-07-01 | 中国科学院声学研究所 | Vector graphic display acceleration method based on bitmap caching |
CN101916276A (en) * | 2010-08-13 | 2010-12-15 | 北京新岸线网络技术有限公司 | Method, device and server for improving release of rich media file in network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010124356A1 (en) * | 2009-04-27 | 2010-11-04 | Research In Motion Limited | Conversion of swf morph shape definitions for vector graphics rendering |
-
2012
- 2012-07-17 CN CN201210248011.2A patent/CN102789501B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101470893A (en) * | 2007-12-26 | 2009-07-01 | 中国科学院声学研究所 | Vector graphic display acceleration method based on bitmap caching |
CN101916276A (en) * | 2010-08-13 | 2010-12-15 | 北京新岸线网络技术有限公司 | Method, device and server for improving release of rich media file in network |
Also Published As
Publication number | Publication date |
---|---|
CN102789501A (en) | 2012-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103049729B (en) | Based on the augmented reality method of Quick Response Code, system and terminal | |
CN104461484B (en) | The implementation method and device of front-end template | |
CN103870487B (en) | Web page files processing method and mobile terminal | |
CN107357929A (en) | File reading, mobile terminal and readable storage medium storing program for executing | |
CN105138340A (en) | Interaction method and system for Native and Web pages | |
JP2019517700A5 (en) | ||
CN111131403A (en) | Message coding and decoding method and device for Internet of things equipment | |
CN108984328B (en) | Stack backtracking method and device | |
CN105022619A (en) | Code processing method and device | |
CN104156421B (en) | The page shows method, apparatus and system | |
CN103365894B (en) | A kind of font format conversion method and device | |
CN102789501B (en) | Method for replacing vector diagram in swf (shock wave flash) file | |
JP2012085274A (en) | Computer-implemented method of encoding text on matrix code symbol, computer-implemented method of decoding matrix code symbol, encoder for encoding text on matrix code symbol, and decoder for decoding matrix code symbol | |
CN102982046B (en) | A kind of web data compression and storage method and system | |
JP2011139449A5 (en) | ||
CN105793842B (en) | Conversion method and device between serialized message | |
CN102855115A (en) | Method and system for displaying character label based on splicing wall | |
CN102799672A (en) | Method for extracting jpg pictures and mp3 files in batch from swf files | |
CN102164178B (en) | Content acquiring method and client | |
CN101908133B (en) | Method and device for decoding bar code | |
CN106874979B (en) | Bar code processing, displaying and reading method and device | |
CN107436929A (en) | Expandable mark language XML document analysis method and device | |
CN114841175A (en) | Machine translation method, device, equipment and storage medium | |
CN109922330B (en) | Data sending method, data receiving method and device | |
CN103207958B (en) | The SWF files in batch encryption method of AS3.0 script exploitation and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee |
Owner name: 4399 NETWORK CO., LTD. Free format text: FORMER NAME: XIAMEN YOUJIA NETWORK CO., LTD. |
|
CP03 | Change of name, title or address |
Address after: Xiamen torch high tech Development Zone Software Park two expected sea Siming District of Xiamen city in Fujian province 361008 Building No. 2 Room 202 Patentee after: 4399 Network Co., Ltd. Address before: 361008 Fujian city of Xiamen province Xiamen torch Software Park, hi tech Zone two expected Road No. 2 building 202 room Patentee before: Xiamen Youjia Network Co., Ltd. |