CN103279456B - Change the method and apparatus that swf file is sequence chart - Google Patents

Change the method and apparatus that swf file is sequence chart Download PDF

Info

Publication number
CN103279456B
CN103279456B CN201310168404.7A CN201310168404A CN103279456B CN 103279456 B CN103279456 B CN 103279456B CN 201310168404 A CN201310168404 A CN 201310168404A CN 103279456 B CN103279456 B CN 103279456B
Authority
CN
China
Prior art keywords
swf
frame picture
amended
sequence chart
file
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
CN201310168404.7A
Other languages
Chinese (zh)
Other versions
CN103279456A (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.)
4399 NETWORK Co Ltd
Original Assignee
4399 NETWORK 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 4399 NETWORK Co Ltd filed Critical 4399 NETWORK Co Ltd
Priority to CN201310168404.7A priority Critical patent/CN103279456B/en
Publication of CN103279456A publication Critical patent/CN103279456A/en
Application granted granted Critical
Publication of CN103279456B publication Critical patent/CN103279456B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Studio Circuits (AREA)

Abstract

The invention provides a kind of method and apparatus changed swf file and be sequence chart, method comprises: S41, generates the primitive frame picture of each frame on described swf element; S42, the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture; S43, is revised as described maximum wide high level by the wide high level of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated; S44, derives each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.Can automatic batch be multiple sequence chart by swf file transform, there is the advantage that sequence chart conversion efficiency is high, and the sequence chart obtained be undistorted, thus facilitate user to obtain picture in swf file.

Description

Change the method and apparatus that swf file is sequence chart
Technical field
The invention belongs to field of computer technology, be specifically related to a kind of method and apparatus changed swf file and be sequence chart.
Background technology
Flash plays, and refers to game that a class is made by flash Software for producing, that be published to everybody amusement and recreation of confession on website.Flash game is general smaller and more exquisite, when player carries out Flash game, does not need the troublesome operation of carrying out download client and mounting software, only needs directly to click to enter flash game, therefore, is that namely a kind of typically namely opening play games, fast very convenient.
Swf file is the special animation file of flash game, is the Animation File Format of a kind of support vector and dot pattern, is widely used in webpage design, the fields such as cartoon making.Because the picture exquisiteness of flash game is attractive in appearance, player is carrying out in game process, usually needs screenshotss to obtain picture, therefore, has picture and obtains inefficient deficiency.
Summary of the invention
For the defect that prior art exists, the invention provides a kind of method and apparatus changed swf file and be sequence chart, can automatic batch be multiple sequence chart by swf file transform, there is the advantage that sequence chart conversion efficiency is high, and, the sequence chart obtained is undistorted, thus facilitates user to obtain picture in swf file.
The technical solution used in the present invention is as follows:
The invention provides a kind of method changed swf file and be sequence chart, comprise the following steps:
S1, loads pending swf file;
S2, traversal loads the stage of the described swf file obtained, and obtains multiple swf element;
S3, by described swf element stored in array, swf element described in each has the element title for identifying self in described array;
S4, all performs following operation to swf element described in each:
S41, generates the primitive frame picture of each frame on described swf element;
S42, the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
S43, is revised as described maximum wide high level by the wide high level of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
S44, derives each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.
Preferably, after S4, also comprise:
S5, is saved in this locality by after amended for each Zhang Suoshu frame picture and the packing of described configuration file.
Preferably, after amended for each Zhang Suoshu frame picture and described configuration file are packaged as the file of zip form, this locality is saved in.
Preferably, S4 is specially:
S4-1, when there being X swf element to need to be converted into sequence chart, creating Y processing threads according to current memory state, then a described Y processing threads being distributed to described X swf element; Wherein, X >=1, X is integer; Y >=1, Y is integer;
S4-2, described processing threads all performs S41-S44 and S5 to the described swf element that self is responsible for, and then, described processing threads changes idle thread into;
S4-3, timing judges whether there is idle thread in a described Y processing threads, if existed, then judges whether to there is pending swf element further; If existed, then described idle thread is re-assigned to described pending swf element; If there is no, then described idle thread is nullified.
The present invention also provides a kind of device changed swf file and be sequence chart, comprising:
Load-on module, for loading pending swf file;
Spider module, loading the stage of the described swf file obtained, obtaining multiple swf element for traveling through described load-on module;
Memory module, for described spider module being traveled through the described swf element that obtains stored in array, swf element described in each has the element title for identifying self in described array;
Modular converter, for being converted to sequence chart by swf element described in each;
Wherein, described modular converter comprises:
Generate submodule, for generating the primitive frame picture of each frame on described swf element;
Comparison sub-module, for the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
Re-generate submodule, for the wide high level of each Zhang Suoshu primitive frame picture is revised as described maximum wide high level, obtain amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
Derive submodule, for deriving each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.
Beneficial effect of the present invention is as follows:
The method and apparatus changed swf file and be sequence chart provided by the invention, can automatic batch be multiple sequence chart by swf file transform, there is the advantage that sequence chart conversion efficiency is high, and, the sequence chart obtained is undistorted, thus facilitates user to obtain picture in swf file.
Accompanying drawing explanation
Fig. 1 provided by the inventionly changes the method flow schematic diagram that swf file is sequence chart;
Fig. 2 provided by the inventionly changes the apparatus structure schematic diagram that swf file is sequence chart.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail:
As shown in Figure 1, the invention provides a kind of method changed swf file and be sequence chart, comprise the following steps:
S1, loads pending swf file;
S2, traversal loads the stage of the described swf file obtained, and obtains multiple swf element;
S3, by described swf element stored in array, swf element described in each has the element title for identifying self in described array;
S4, all performs following operation to swf element described in each:
S41, generates the primitive frame picture of each frame on described swf element;
S42, the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
S43, is revised as described maximum wide high level by the wide high level of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
S44, derives each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.
After S4, also comprise:
S5, is saved in this locality by after amended for each Zhang Suoshu frame picture and the packing of described configuration file.Concrete packing manner can be: the file being packaged as zip form.
In addition, owing to needing that the multiple swf elements in swf file are converted to sequence chart respectively, for improving conversion efficiency, multiple threads mode can be adopted, concrete, comprising:
S4-1, when there being X swf element to need to be converted into sequence chart, creating Y processing threads according to current memory state, then a described Y processing threads being distributed to described X swf element; Wherein, X >=1, X is integer; Y >=1, Y is integer;
In this step, the quantity Y of processing threads is less than, be more than or equal to swf number of elements X, the following situation of concrete differentiation: (1) is if Y=X, such as, Y=X=5, then distribute to 5 swf elements by 5 processing threads, is responsible for a swf element by a processing threads.(2) if Y is less than X, such as, Y=5, X=8, then, first by 5 processing threads process, 5 swf elements, after certain processing threads is disposed, one in still untreated 3 the swf elements of reprocessing, finally make all swf elements be disposed.(3) if Y is greater than X, such as, Y=5, X=3, then can make two or 3 thread associated treatment swf element.That is, in the present invention, for a swf element, can be processed by one or more thread simultaneously, thus improve treatment effeciency.
S4-2, described processing threads all performs S41-S44 and S5 to the described swf element that self is responsible for, and then, described processing threads changes idle thread into;
In the present invention, during to the process of swf element, swf element is converted to the operation of sequence chart, and is stored into the operation in memory device, perform by identical processing threads, thus can simplify the complexity of system configuration, simplify the operation instruction.
S4-3, timing judges whether there is idle thread in a described Y processing threads, if existed, then judges whether to there is pending swf element further; If existed, then described idle thread is re-assigned to described pending swf element; If there is no, then described idle thread is nullified.
As shown in Figure 2, the present invention also provides a kind of device changed swf file and be sequence chart, comprising:
Load-on module, for loading pending swf file;
Spider module, loading the stage of the described swf file obtained, obtaining multiple swf element for traveling through described load-on module;
Memory module, for described spider module being traveled through the described swf element that obtains stored in array, swf element described in each has the element title for identifying self in described array;
Modular converter, for being converted to sequence chart by swf element described in each;
Wherein, described modular converter comprises:
Generate submodule, for generating the primitive frame picture of each frame on described swf element;
Comparison sub-module, for the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
Re-generate submodule, for the wide high level of each Zhang Suoshu primitive frame picture is revised as described maximum wide high level, obtain amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
Derive submodule, for deriving each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.
The method and apparatus changed swf file and be sequence chart provided by the invention, can automatic batch be multiple sequence chart by swf file transform, there is the advantage that sequence chart conversion efficiency is high, and, the sequence chart obtained is undistorted, thus facilitates user to obtain picture in swf file.
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 look protection scope of the present invention.

Claims (2)

1. change the method that swf file is sequence chart, it is characterized in that, comprise the following steps:
S1, loads pending swf file;
S2, traversal loads the stage of the described swf file obtained, and obtains multiple swf element;
S3, by described swf element stored in array, swf element described in each has the element title for identifying self in described array;
S4, all performs following operation to swf element described in each:
S41, generates the primitive frame picture of each frame on described swf element;
S42, the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
S43, is revised as described maximum wide high level by the wide high level of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
S44, derives each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart;
After S4, also comprise:
S5, is saved in this locality by after amended for each Zhang Suoshu frame picture and the packing of described configuration file;
After amended for each Zhang Suoshu frame picture and described configuration file are packaged as the file of zip form, be saved in this locality;
Wherein, S4 is specially:
S4-1, when there being X swf element to need to be converted into sequence chart, creating Y processing threads according to current memory state, then a described Y processing threads being distributed to described X swf element; Wherein, X >=1, X is integer; Y >=1, Y is integer;
S4-2, described processing threads all performs S41-S44 and S5 to the described swf element that self is responsible for, and then, described processing threads changes idle thread into;
S4-3, timing judges whether there is idle thread in a described Y processing threads, if existed, then judges whether to there is pending swf element further; If existed, then described idle thread is re-assigned to described pending swf element; If there is no, then described idle thread is nullified.
2. change the device that swf file is sequence chart, it is characterized in that, comprising:
Load-on module, for loading pending swf file;
Spider module, loading the stage of the described swf file obtained, obtaining multiple swf element for traveling through described load-on module;
Memory module, for described spider module being traveled through the described swf element that obtains stored in array, swf element described in each has the element title for identifying self in described array;
Modular converter, for being converted to sequence chart by swf element described in each;
Wherein, described modular converter comprises:
Generate submodule, for generating the primitive frame picture of each frame on described swf element;
Comparison sub-module, for the wide high level of each primitive frame picture in more described swf element, obtains the maximum wide high level of described primitive frame picture;
Re-generate submodule, for the wide high level of each Zhang Suoshu primitive frame picture is revised as described maximum wide high level, obtain amended frame picture; Meanwhile, the configuration file for locating each amended frame picture is generated;
Derive submodule, for deriving each Zhang Suoshu amended frame picture of temporally frame sequential arrangement and described configuration file; Temporally each Zhang Suoshu amended frame picture of frame sequential arrangement is described sequence chart.
CN201310168404.7A 2013-05-09 2013-05-09 Change the method and apparatus that swf file is sequence chart Active CN103279456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310168404.7A CN103279456B (en) 2013-05-09 2013-05-09 Change the method and apparatus that swf file is sequence chart

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310168404.7A CN103279456B (en) 2013-05-09 2013-05-09 Change the method and apparatus that swf file is sequence chart

Publications (2)

Publication Number Publication Date
CN103279456A CN103279456A (en) 2013-09-04
CN103279456B true CN103279456B (en) 2016-01-27

Family

ID=49061981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310168404.7A Active CN103279456B (en) 2013-05-09 2013-05-09 Change the method and apparatus that swf file is sequence chart

Country Status (1)

Country Link
CN (1) CN103279456B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105513115B (en) * 2014-10-16 2020-06-16 腾讯科技(深圳)有限公司 Method and device for converting SWF into Canvas animation
CN106339210B (en) * 2016-08-09 2018-09-07 腾讯科技(深圳)有限公司 Data processing method and relevant apparatus in a kind of web game
CN110276769B (en) * 2018-03-13 2023-07-11 上海薇龙文化传播有限公司 Live broadcast content positioning method in video picture-in-picture architecture

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855316A (en) * 2012-08-29 2013-01-02 四三九九网络股份有限公司 Method and device for guiding out vector diagram in swf file format from swf file

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332959A1 (en) * 2009-06-24 2010-12-30 Nextslide, Llc System and Method of Capturing a Multi-Media Presentation for Delivery Over a Computer Network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855316A (en) * 2012-08-29 2013-01-02 四三九九网络股份有限公司 Method and device for guiding out vector diagram in swf file format from swf file

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Using the Adobe Flash Sprite Sheet Generator;Chris Georgenes;《Using the Adobe Flash Sprite Sheet Generator | Adobe Developer Connection(http://www.adobe.com/cn/devnet/flash/articles/using-sprite-sheet-generator.html)》;20120507;第1-8页 *
萧小笑.Flash与视频混编的方法.《电脑报》.2003,第1-2页. *

Also Published As

Publication number Publication date
CN103279456A (en) 2013-09-04

Similar Documents

Publication Publication Date Title
CN104680421B (en) A kind of saleable vector graphics SVG display methods and device
CN103279456B (en) Change the method and apparatus that swf file is sequence chart
TW200923831A (en) System, method and computer program product for performing a scan operation
CN101882077B (en) Method and device for efficiently drawing and rendering basic graphic
CN108337547B (en) Character animation realization method, device, terminal and storage medium
WO2012006907A1 (en) Method and apparatus for implementing dynamic switch of mobile terminal interface
CN104517307B (en) A kind of animation method and device
WO2021008627A1 (en) Game character rendering method and apparatus, electronic device, and computer-readable medium
CN100421119C (en) Method for drawing map in game
CN103268624A (en) Method and device for generating animation with high-efficiency
CN110533755A (en) A kind of method and relevant apparatus of scene rendering
CN105550974A (en) GPU-based acceleration method of image feature extraction algorithm
CN105426204A (en) Web high-speed loading rendering method based on domestic CPU, operating system and browser
CN106210724B (en) Picture decoding method and device
CN108920274B (en) Performance optimization and device for image processing server side
CN106815880A (en) animation multiplexing method and system
CN110443880A (en) Image rendering method, device, storage medium and electronic equipment
CN108132820A (en) Dynamic picture display methods, device and equipment
CN102663795B (en) 2.5D character animation realization method based on webpage and system thereof
CN106371808B (en) A kind of method and terminal of parallel computation
CN104740873A (en) Image rendering method for game
WO2024067159A1 (en) Video generation method and apparatus, electronic device, and storage medium
CN101192149A (en) Method and system for creating application program interface
CN108090062A (en) A kind of page furbishing method and device
CN104899051B (en) Structure loading method, system and the device of Flash program library file

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