CN103279456A - Method and device for converting swf file into sequence charts - Google Patents

Method and device for converting swf file into sequence charts Download PDF

Info

Publication number
CN103279456A
CN103279456A CN2013101684047A CN201310168404A CN103279456A CN 103279456 A CN103279456 A CN 103279456A CN 2013101684047 A CN2013101684047 A CN 2013101684047A CN 201310168404 A CN201310168404 A CN 201310168404A CN 103279456 A CN103279456 A CN 103279456A
Authority
CN
China
Prior art keywords
swf
frame picture
file
sequence chart
amended
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
CN2013101684047A
Other languages
Chinese (zh)
Other versions
CN103279456B (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

Images

Abstract

The invention provides a method and device for converting a swf file into sequence charts. The method comprises the steps of generating an original frame picture of each frame on the swf file, comparing a width-height value of each original frame picture in the swf file and obtaining the largest width-height value of the original frame picture, revising the width-height value of each original frame picture into the largest width-height value and obtaining revised frame pictures, at the same time, generating a configuration file used for locating each revised frame picture, leading out the revised frame pictures which are arranged in sequence according to a time frame and the configuration file, and using the revised frame pictures which are arranged in sequence according to the time frame as the sequence charts. The method and device can convert the swf file into a plurality of sequence charts automatically and has the advantage of being high in sequence chart converting efficiency. Besides, the obtained sequence charts are distortionless, and therefore a user can obtain pictures in the swf picture conveniently.

Description

Conversion swf file is the method and apparatus of sequence chart
Technical field
The invention belongs to field of computer technology, the method and apparatus that to be specifically related to a kind of swf of conversion file be sequence chart.
Background technology
The flash recreation refers to that a class is by recreation flash making software development, that be published to everybody amusement and recreation of confession on the website.The flash recreation is general smaller and more exquisite, and when the player carried out the Flash recreation, the troublesome operation that does not need to carry out download client and software is installed only needs direct click can enter the flash recreation, therefore, is that a kind of typically namely opening namely played games, and was very convenient quick.
The swf file is the special-purpose animation file of flash recreation, is a kind of animation file form of supporting vector and dot pattern, is widely used in webpage design, fields such as cartoon making.Because the picture exquisiteness of flash recreation is attractive in appearance, the player usually needs screenshotss could obtain picture in carrying out game process, therefore, has picture and obtains inefficient deficiency.
Summary of the invention
Defective at the prior art existence, the method and apparatus that to the invention provides a kind of swf of conversion file be sequence chart, can automatic batch be many sequence chart with the swf file conversion, has the high advantage of sequence chart conversion efficiency, and, resulting sequence chart is undistorted, thereby makes things convenient for the user to obtain picture in the swf file.
The technical solution used in the present invention is as follows:
The method that to the invention provides a kind of swf of conversion file be sequence chart may further comprise the steps:
S1 loads pending swf file;
S2, traversal loads the stage of the described swf file that obtains, and obtains a plurality of swf elements;
S3 deposits described swf element in the array in, and each described swf element has the element title for indicating self in described array;
S4, all carry out following operation to each described swf element:
S41 generates the primitive frame picture of each frame on the described swf element;
S42, the wide height of each primitive frame picture is worth in the more described swf element, obtains the maximum wide high value of described primitive frame picture;
S43 is revised as the wide height of described maximum value with the wide high value of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
S44 derives the amended frame picture of each Zhang Suoshu and the described configuration file arranged by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu is described sequence chart.
Preferably, after the S4, also comprise:
S5 will be saved in this locality after the amended frame picture of each Zhang Suoshu and the packing of described configuration file.
Preferably, the amended frame picture of each Zhang Suoshu and described configuration file be packaged as the file of zip form after, be saved in this locality.
Preferably, S4 is specially:
S4-1 when X swf element need be converted into sequence chart, creates Y processing threads according to current internal storage state, then a described Y processing threads is distributed to described X swf element; Wherein, X 〉=1, X is integer; Y 〉=1, Y is integer;
S4-2, described processing threads is all carried out S41-S44 and S5 to the described swf element of self being responsible for, and then, described processing threads changes idle thread into;
S4-3 regularly judges in the described Y processing threads whether have idle thread, if exist, then further judges whether to exist pending swf element; If exist, then described idle thread heavily distributed to described pending swf element; If there is no, then nullify described idle thread.
It is the device of sequence chart that the present invention also provides a kind of swf of conversion file, comprising:
Load-on module is used for loading pending swf file;
Spider module is used for the stage that the described load-on module of traversal loads the described swf file that obtains, and obtains a plurality of swf elements;
Memory module is used for depositing the described swf element that described spider module traversal obtains in array, and each described swf element has the element title for indicating self in described array;
Modular converter is used for each described swf element is converted to sequence chart;
Wherein, described modular converter comprises:
Generate submodule, be used for generating the primitive frame picture of each frame on the described swf element;
Comparison sub-module, the wide height that is used for more described each primitive frame picture of swf element is worth, and obtains the maximum wide high value of described primitive frame picture;
Re-generate submodule, be used for the wide high value of each Zhang Suoshu primitive frame picture is revised as the wide high value of described maximum, obtain amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
Derive submodule, be used for deriving the amended frame picture of each Zhang Suoshu and the described configuration file of arranging by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu is described sequence chart.
Beneficial effect of the present invention is as follows:
Conversion swf file provided by the invention is the method and apparatus of sequence chart, can automatic batch be many sequence chart with the swf file conversion, have the high advantage of sequence chart conversion efficiency, and, resulting sequence chart is undistorted, thereby makes things convenient for the user to obtain picture in the swf file.
Description of drawings
Fig. 1 is the method flow synoptic diagram of sequence chart for conversion swf file provided by the invention;
Fig. 2 is the apparatus structure synoptic diagram of sequence chart for conversion swf file provided by the invention.
Embodiment
The present invention is described in detail below in conjunction with accompanying drawing:
As shown in Figure 1, the method that to the invention provides a kind of swf of conversion file be sequence chart may further comprise the steps:
S1 loads pending swf file;
S2, traversal loads the stage of the described swf file that obtains, and obtains a plurality of swf elements;
S3 deposits described swf element in the array in, and each described swf element has the element title for indicating self in described array;
S4, all carry out following operation to each described swf element:
S41 generates the primitive frame picture of each frame on the described swf element;
S42, the wide height of each primitive frame picture is worth in the more described swf element, obtains the maximum wide high value of described primitive frame picture;
S43 is revised as the wide height of described maximum value with the wide high value of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
S44 derives the amended frame picture of each Zhang Suoshu and the described configuration file arranged by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu is described sequence chart.
After the S4, also comprise:
S5 will be saved in this locality after the amended frame picture of each Zhang Suoshu and the packing of described configuration file.Concrete packing manner can be the file that is packaged as the zip form.
In addition, owing to a plurality of swf elements in the swf file need be converted to sequence chart respectively, for improving conversion efficiency, can adopt the multithreading processing mode, concrete, comprising:
S4-1 when X swf element need be converted into sequence chart, creates Y processing threads according to current internal storage state, then a described Y processing threads is 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 less than, more than or equal to swf number of elements X, specifically distinguish following situation: (1) is if Y=X, for example, Y=X=5 then distributes to 5 swf elements with 5 processing threads, is responsible for a swf element by a processing threads.(2) if Y less than X, for example, Y=5, X=8 then at first handles 5 swf elements by 5 processing threads, after certain processing threads disposes, handles in untreated 3 swf elements still again, and all swf elements are disposed.(3) if Y greater than X, for example, Y=5, X=3 then can make two or swf element of 3 thread associated treatment.That is to say, among the present invention, for a swf element, can be handled simultaneously by one or more threads, thereby improve treatment effeciency.
S4-2, described processing threads is all carried out S41-S44 and S5 to the described swf element of self being responsible for, and then, described processing threads changes idle thread into;
Among the present invention, when the swf element is handled, the swf element is converted to the operation of sequence chart, and stores the operation in the memory device into, carry out by identical processing threads, thereby can simplify the complexity of system configuration, instruction simplifies the operation.
S4-3 regularly judges in the described Y processing threads whether have idle thread, if exist, then further judges whether to exist pending swf element; If exist, then described idle thread heavily distributed to described pending swf element; If there is no, then nullify described idle thread.
As shown in Figure 2, it is the device of sequence chart that the present invention also provides a kind of swf of conversion file, comprising:
Load-on module is used for loading pending swf file;
Spider module is used for the stage that the described load-on module of traversal loads the described swf file that obtains, and obtains a plurality of swf elements;
Memory module is used for depositing the described swf element that described spider module traversal obtains in array, and each described swf element has the element title for indicating self in described array;
Modular converter is used for each described swf element is converted to sequence chart;
Wherein, described modular converter comprises:
Generate submodule, be used for generating the primitive frame picture of each frame on the described swf element;
Comparison sub-module, the wide height that is used for more described each primitive frame picture of swf element is worth, and obtains the maximum wide high value of described primitive frame picture;
Re-generate submodule, be used for the wide high value of each Zhang Suoshu primitive frame picture is revised as the wide high value of described maximum, obtain amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
Derive submodule, be used for deriving the amended frame picture of each Zhang Suoshu and the described configuration file of arranging by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu is described sequence chart.
Conversion swf file provided by the invention is the method and apparatus of sequence chart, can automatic batch be many sequence chart with the swf file conversion, have the high advantage of sequence chart conversion efficiency, and, resulting sequence chart is undistorted, thereby makes things convenient for the user to obtain picture in the swf file.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle 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 (5)

1. change the method that the swf file is sequence chart for one kind, it is characterized in that, may further comprise the steps:
S1 loads pending swf file;
S2, traversal loads the stage of the described swf file that obtains, and obtains a plurality of swf elements;
S3 deposits described swf element in the array in, and each described swf element has the element title for indicating self in described array;
S4, all carry out following operation to each described swf element:
S41 generates the primitive frame picture of each frame on the described swf element;
S42, the wide height of each primitive frame picture is worth in the more described swf element, obtains the maximum wide high value of described primitive frame picture;
S43 is revised as the wide height of described maximum value with the wide high value of each Zhang Suoshu primitive frame picture, obtains amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
S44 derives the amended frame picture of each Zhang Suoshu and the described configuration file arranged by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu is described sequence chart.
2. conversion swf file according to claim 1 is the method for sequence chart, it is characterized in that, after the S4, also comprises:
S5 will be saved in this locality after the amended frame picture of each Zhang Suoshu and the packing of described configuration file.
3. conversion swf file according to claim 2 is the method for sequence chart, it is characterized in that, the amended frame picture of each Zhang Suoshu and described configuration file are packaged as the file of zip form after, be saved in this locality.
4. conversion swf file according to claim 2 is the method for sequence chart, it is characterized in that S4 is specially:
S4-1 when X swf element need be converted into sequence chart, creates Y processing threads according to current internal storage state, then a described Y processing threads is distributed to described X swf element; Wherein, X 〉=1, X is integer; Y 〉=1, Y is integer;
S4-2, described processing threads is all carried out S41-S44 and S5 to the described swf element of self being responsible for, and then, described processing threads changes idle thread into;
S4-3 regularly judges in the described Y processing threads whether have idle thread, if exist, then further judges whether to exist pending swf element; If exist, then described idle thread heavily distributed to described pending swf element; If there is no, then nullify described idle thread.
5. change the device that the swf file is sequence chart for one kind, it is characterized in that, comprising:
Load-on module is used for loading pending swf file;
Spider module is used for the stage that the described load-on module of traversal loads the described swf file that obtains, and obtains a plurality of swf elements;
Memory module is used for depositing the described swf element that described spider module traversal obtains in array, and each described swf element has the element title for indicating self in described array;
Modular converter is used for each described swf element is converted to sequence chart;
Wherein, described modular converter comprises:
Generate submodule, be used for generating the primitive frame picture of each frame on the described swf element;
Comparison sub-module, the wide height that is used for more described each primitive frame picture of swf element is worth, and obtains the maximum wide high value of described primitive frame picture;
Re-generate submodule, be used for the wide high value of each Zhang Suoshu primitive frame picture is revised as the wide high value of described maximum, obtain amended frame picture; Simultaneously, generate the configuration file that is used for each amended frame picture of location;
Derive submodule, be used for deriving the amended frame picture of each Zhang Suoshu and the described configuration file of arranging by the time frame sequential; The amended frame picture of arranging by the time frame sequential of each Zhang Suoshu 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 true CN103279456A (en) 2013-09-04
CN103279456B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105513115A (en) * 2014-10-16 2016-04-20 腾讯科技(深圳)有限公司 Method and device for converting SWF into Canvas cartoon
CN106339210A (en) * 2016-08-09 2017-01-18 腾讯科技(深圳)有限公司 Webpage game data processing method and related device
CN110276769A (en) * 2018-03-13 2019-09-24 上海狮吼网络科技有限公司 Live content localization method in a kind of video picture-in-pictures framework

Citations (2)

* 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
CN102855316A (en) * 2012-08-29 2013-01-02 四三九九网络股份有限公司 Method and device for guiding out vector diagram in swf file format from swf file

Patent Citations (2)

* 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
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
CHRIS GEORGENES: "Using the Adobe Flash Sprite Sheet Generator", 《USING THE ADOBE FLASH SPRITE SHEET GENERATOR | ADOBE DEVELOPER CONNECTION(HTTP://WWW.ADOBE.COM/CN/DEVNET/FLASH/ARTICLES/USING-SPRITE-SHEET-GENERATOR.HTML)》, 7 May 2012 (2012-05-07), pages 1 - 8 *
萧小笑: "Flash与视频混编的方法", 《电脑报》, 9 June 2003 (2003-06-09), pages 1 - 2 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105513115A (en) * 2014-10-16 2016-04-20 腾讯科技(深圳)有限公司 Method and device for converting SWF into Canvas cartoon
CN105513115B (en) * 2014-10-16 2020-06-16 腾讯科技(深圳)有限公司 Method and device for converting SWF into Canvas animation
CN106339210A (en) * 2016-08-09 2017-01-18 腾讯科技(深圳)有限公司 Webpage game data processing method and related device
CN110276769A (en) * 2018-03-13 2019-09-24 上海狮吼网络科技有限公司 Live content localization method in a kind of video picture-in-pictures framework
CN110276769B (en) * 2018-03-13 2023-07-11 上海薇龙文化传播有限公司 Live broadcast content positioning method in video picture-in-picture architecture

Also Published As

Publication number Publication date
CN103279456B (en) 2016-01-27

Similar Documents

Publication Publication Date Title
CN106997348A (en) A kind of data method for drafting and device
CN109997132A (en) Low time delay matrix multiplication component
CN104680421B (en) A kind of saleable vector graphics SVG display methods and device
TW200923831A (en) System, method and computer program product for performing a scan operation
CN103279456A (en) Method and device for converting swf file into sequence charts
CN102938776A (en) Dynamic page processing system based on Asynchronous JavaScript and XML (ajax) technique
CN105550974A (en) GPU-based acceleration method of image feature extraction algorithm
Xu et al. Optimizing sparse matrix vector multiplication using cache blocking method on Fermi GPU
CN106155749A (en) A kind of monitoring plug-in extension method and device
CN106210724B (en) Picture decoding method and device
CN108920274B (en) Performance optimization and device for image processing server side
CN105871945A (en) Image information sending method and device, and waterfall flow layout method and device
CN105760196A (en) Detection method and system for pluggable plug-in program
CN105069015A (en) Web acceleration technology implementation method of domestic platform
CN105389153A (en) Method for applying general integration display technology to multi-system integration
CN111352896B (en) Artificial intelligence accelerator, equipment, chip and data processing method
CN109947450A (en) System file upgrade method, device, mobile terminal and readable storage medium storing program for executing
CN113453073A (en) Image rendering method and device, electronic equipment and storage medium
Wu et al. GPU-based power converter transient simulation with matrix exponential integration and memory management
Carneiro et al. Towards chapel-based exascale tree search algorithms: dealing with multiple GPU accelerators
CN106371808B (en) A kind of method and terminal of parallel computation
CN102033751B (en) Software adaptation method and system for OSD, and multimedia terminal
CN109547723A (en) A kind of game video method for recording, device and terminal
CN102799564A (en) Fast fourier transformation (FFT) parallel method based on multi-core digital signal processor (DSP) platform
CN108960420A (en) Processing method and accelerator

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