Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.Generally exist
The component of the embodiment of the present invention described and illustrated in accompanying drawing can be arranged and designed with a variety of configurations herein.Cause
This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below
Scope, but it is merely representative of the selected embodiment of the present invention.Based on embodiments of the invention, those skilled in the art are not doing
The every other embodiment obtained on the premise of going out creative work, belongs to the scope of protection of the invention.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi
It is defined in individual accompanying drawing, then it further need not be defined and explained in subsequent accompanying drawing.Meanwhile, the present invention's
In description, term " first ", " second " etc. are only used for distinguishing description, and it is not intended that indicating or implying relative importance.
Fig. 1 is refer to, Fig. 1 is that the service end 100 that present pre-ferred embodiments are provided communicates with least one client 200
Interaction schematic diagram.Service end 100 can be communicated by network 300 with client 200, to realize service end 100 and client
Data communication or interaction between end 200.Service end 100 can provide the application journey that at least one is applied to various operating systems
The installation kit of sequence 400 is downloaded for client 200.Client 200 is accessed after service end 100 by network 300, can pass through network
300 download the installation kit of the application program 400 of the operating system suitable for the client 200 from service end 100, will apply journey
Sequence 400 is installed in client 200.
In the embodiment of the present invention, service end 100 is web (website) server.Client 200 may be, but not limited to, intelligence
Can mobile phone, PC (personal computer, PC), tablet personal computer, personal digital assistant (personal digital
Assistant, PDA), mobile internet surfing equipment (mobile Internet device, MID) etc..The operating system of client 200
It may be, but not limited to, Android (Android) system, IOS (iPhone operating system) system, Windows
Phone systems, Windows systems etc..Application program 400 can be that any of the offer of service end 100 is available for client 200 certainly
The application program that definition is downloaded and installed, it is preferable that in the present embodiment, application program 400 can be various various comprising picture
Application program.
Fig. 2 is refer to, Fig. 2 shows the block diagram of service end 100 provided in an embodiment of the present invention.Service end 100
Including the first picture processing device 110, first memory 120, the communication unit 140 of first processor 130 and first.
First memory 120, first processor 130 and first communication unit, 140 each elements are direct or indirect each other
Ground is electrically connected with, to realize the transmission or interaction of data.For example, these elements each other can be total by one or more communication
Line or signal wire, which are realized, to be electrically connected with.First picture processing device 110 can be with software or firmware including at least one
(firmware) form is stored in first memory 120 or is solidificated in the operating system of the service end 100
Software function module in (operating system, OS).First processor 130 is used to perform to deposit in first memory 120
The executable module of storage, such as software function module and computer program included by the first picture processing device 110.
Wherein, first memory 120 may be, but not limited to, random access memory (Random Access
Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable
Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only
Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only
Memory, EEPROM) etc..Wherein, first memory 120 is used for storage program, and first processor 130 is receiving execute instruction
Afterwards, described program is performed.First communication unit 140 is used to set up between service end 100 and client 200 by network 300
Communication connection, and for passing through the transceiving data of network 300.
Fig. 3 is refer to, Fig. 3 shows the block diagram of client 200 provided in an embodiment of the present invention.The client
200 include second picture processing unit 210, second memory 220, storage control 230, second processor 240, Peripheral Interface
250th, the second communication unit 260, radio frequency unit 270 and display screen 280.
Second memory 220, storage control 230, second processor 240, Peripheral Interface 250, the second communication unit
260th, radio frequency unit 270 and each element of display screen 280 are directly or indirectly electrically connected with each other, to realize the transmission of data
Or interaction.It is electrically connected with for example, these elements can be realized by one or more communication bus or signal wire each other.Second
Picture processing device 210, which includes at least one, to be stored in second memory 220 in the form of software or firmware (firmware)
In or the software function module that is solidificated in the operating system of client 200 (operating system, OS).Second memory
Application program 400 that client 200 downloads and install from service end 100 that 220 are stored with.Second processor 240 is used to perform
The executable module stored in second memory 220, for example the software function module included by second picture processing unit 210 or
Computer program.
Wherein, second memory 220 may be, but not limited to, random access memory (Random Access
Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable
Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only
Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only
Memory, EEPROM) etc..Wherein, second memory 220 is used for storage program, and second processor 240 is receiving execute instruction
Afterwards, described program is performed, second processor 240 and other access of possible component to second memory 220 can be in storages
Carried out under the control of controller 230.
Second processor 240 can be a kind of IC chip, with signal handling capacity.Above-mentioned second processor
240 can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit
(Network Processor, NP), speech processor and video processor etc.;Can also be digital signal processor, it is special
It is integrated circuit, field programmable gate array or other PLDs, discrete gate or transistor logic, discrete
Nextport hardware component NextPort.It can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.General procedure
Device can be microprocessor or the second processor 240 can also be any conventional processor etc..
Peripheral Interface 250 is used to various input/output devices being coupled to second processor 240 and second memory
220.In certain embodiments, Peripheral Interface 250, second processor 240 and storage control 230 can be in one single chips
Realize.In some other example, they can be realized by independent chip respectively.
Radio frequency unit 270 is used to receiving and sending radio wave signal (such as electromagnetic wave), realizes radio wave and telecommunications
Number mutual conversion, so as to realize the radio communication between client 200 and network 300 or other communication equipments.
Second communication unit 260, which is used to set up by network 300 and service end 100, to be connected, thus realize service end 100 and
Communication connection between client 200.For example, the radio frequency letter that second communication unit 260 can be sent using radio frequency unit 270
Network 300 number is connected to, and then passes through network 300 and is set up with service end 100 and communicate to connect.
Display screen 280 is used for the second picture file after the second picture processing unit 210 through client 200 is handled and entered
Row display.
First embodiment
Fig. 4 is refer to, Fig. 4 shows provided in an embodiment of the present invention applied to the service end communicated to connect each other
100 and during client 200 image processing method flow chart.Image processing method comprises the following steps:
Step S101, obtains the first picture file of client, wherein, the first picture file is the figure based on markup language
Piece file.
In embodiments of the present invention, the first picture file can be pre-stored within the application program for being installed on client 200
It is the picture file of itself of application program 400 under 400 raw catalogues, that is, interface loads institute during the operation of application program 400
The picture needed, service end 100 directly can obtain the first picture file under raw catalogues, the first picture text by network 300
Part may be, but not limited to, based on the mark such as XML, HTML (Hyper Text Marked Language, HTML)
Remember the picture of language,
In embodiments of the present invention, the first picture file may be, but not limited to, the application programs such as UC browsers, wechat
The picture resource used is needed in 400 runnings, such as can be " it is determined that ", control " completion " or be message box, add
The icon of plusing good friend etc..As a kind of embodiment, the first picture file can be the picture file of SVG forms, SVG forms
Picture file is to be based on XML language, a kind of graphical format for describing two-dimension vector graphics.
Step S102, the first picture file is converted to and renders code file, to render code file in client quilt
Color applying drawing is carried out to obtain second picture file to rendering code file during operation, wherein rendering code file by non-marked language
Speech is constituted.
In embodiments of the present invention, can be by that will mark in order to solve the problem of picture file of SVG forms loads slow
Language conversion is the mode of non-markup languages, and the first picture file is converted to and renders document code, for example, can be by SVG lattice
The picture file of formula is converted to the code file being made up of non-markup languages such as Java, C, C++, as a kind of embodiment, reads
After the picture file for getting SVG forms under raw catalogues, the primary SVG resolvers of Android or the SVG increased income are utilized
Resolver, Java code is converted into by xml code, the picture file of SVG forms is converted to render code file after, be bundled to
In application code, application code may be, but not limited to, the installation kit of the application programs such as UC browsers, wechat 400.
Fig. 5 is refer to, the first picture file is the picture file of SVG forms, and step S102 also includes following sub-step:
Sub-step S1021, is changed to the picture file of SVG forms, generates feature code.
In embodiments of the present invention, picture file can be changed by way of code language is changed, such as SVG
The picture file of form is a kind of xml code, xml code first can be converted into abstract syntax tree, then abstract syntax tree is turned
It is changed to the code of Java forms.
, can be by the figure of SVG forms in order to reduce resource and the time spent by code conversion as a kind of embodiment
The characteristic that piece file is different from the picture file of other SVG forms changes generated Java code, wherein, other SVG
The picture file of form refers to the picture file of the converted SVG forms before the first picture file is changed, it possess with
First picture file identical code, then the code of same section change the first picture file when do not need reconvert, only will
Different part conversions, then by the part of conversion complete feature corresponding with the picture file of Code synthesis first of same section
Code.
In embodiments of the present invention, feature code may be, but not limited to, the picture file of a SVG form different from it
The characteristic of the picture file of its SVG form changes generated Java code.
Fig. 6 is refer to, sub-step S1021 also includes following sub-step:
Sub-step S10211, when the picture file of SVG forms is to that should have nine icons to clock, nine figures are resolved to by nine icons note
Attribute information.
In embodiments of the present invention, nine icons note can be customized, for example, can be marked on the picture of SVG forms
Go out a rectangle frame, then this rectangle frame is exactly nine icons note, and it is exactly nine figure content areas that rectangle frame is interior, nine icons note is resolved to
Nine figure attribute informations can be the coordinate value for reading the pixel on picture file where four angles of rectangle frame, the figure attribute of file nine
Nine figure content areas in the message reflection picture file of SVG forms, definition nine figure attribute informations are ninePatch, if
NinePatch=(l40,48t56,57r10,78b0,92), picture size is 92 × 88, then l40, and 48 be left black surround information, table
It is the 40th to the 48th pixel to show vertical direction stretch zones;T56,57 be upper black surround information, represents horizontal direction drawing zone
Domain is the 56th to the 57th pixel;R10,78 be right black surround information, and it is the 10th to the 78th to represent vertical direction content area
Pixel, the 0th to the 10th pixel and the 78th to the 88th pixel are back gauges, do not show content;B0,92 be that lower black surround is believed
Breath, it is the 0th to the 92nd pixel to represent horizontal direction content area.
Sub-step S10212, first code file is converted to by the picture file of SVG forms.
In embodiments of the present invention, first code file may be, but not limited to, the figure for the SVG forms remembered with nine icons
In piece file, other image contents in addition to nine figure content areas are changed, the Java code generated, that is,
Say, other Picture sections in the picture file of SVG forms in addition to nine icons are remembered can be changed generated Java
Code.
Sub-step S10213, nine figure attribute informations is added in first code file, to obtain feature code.
In embodiments of the present invention, the left side in nine figure attribute informations/upper black surround information is parsed and needed when generating stretching
The logical code of calculating, right/lower black surround is parsed and corresponding content back gauge code is generated, and by the logical code and content side
It is added to away from code in first code file, you can obtain feature code.
Sub-step S1022, obtains the same type primitive attribute of the picture file of SVG forms.
In embodiments of the present invention, the same type primitive attribute of picture file can be obtained according to XML tree construction, together
Type primitive attribute may be, but not limited to, the color attribute of pel, the shape attribute of pel, gradient attributes of pel etc..
Sub-step S1023, calculates the property value of same type primitive attribute, and property value constitutes attribute array, and by attribute number
Group is added in feature code.
In embodiments of the present invention, the property value of same type primitive attribute may be, but not limited to, pel color attribute,
The color of the value of the shape attribute of pel etc., such as some pel is red, then the rgb value of its property value namely red is
(1,0,0), for shape of pel etc., then needs to read the coordinate value of the pixel of pel profile.
Sub-step S1024, feature code set is used the SVG Code Templates pre-set, and generation renders code file, its
In, render code file and be made up of Java code.
As a kind of embodiment, because the document code that renders of conversion is most a java class, a portion at last
Content is public, in order to improve the efficiency of code conversion, can pre-define SVG Code Templates, and SVG Code Templates can be with
It is, but is not limited to multiple common code parts for rendering code file, the part end to end of such as java class, generation renders code
During file, it is only necessary to the feature code of the picture file of SVG forms is write into SVG Code Templates, you can obtain final output
Java code.SVG Code Templates include common templates and nine artwork plates, and common templates are used to export the SVG for not having nine icons to remember
The picture file of form renders document code, and nine artwork plates are used for the picture file for exporting the SVG forms for having nine icons to remember
Render document code.
In embodiments of the present invention, the picture file of SVG forms is multiple, and the picture file of multiple SVG forms is given birth to respectively
Code file is rendered into multiple correspondingly.
Sub-step S1025, multiple code files that render are stored in preassigned Resource TOC.
In embodiments of the present invention, render code file by each first and be each packaged, then will be many after encapsulation
The individual code file that renders is stored in preassigned Resource TOC, then the Resource TOC is bundled to the installation of application program 400
Bao Zhong, while each render code file by encapsulation, therefore be able to can so be obscured, Resource TOC with reduced code
The Resource TOC that application program 400 is specified is referred to, for example, the Resource TOC that UC browsers are specified, only can be bundled to UC and browse
In the installation kit of device.
It should be noted that the picture file of SVG forms is converted to and renders after code file that size is still very small, do
Code simplifies even also smaller than the picture file of SVG form, therefore can reduce the size of installation kit, is replaced in actual items
The picture files of 134 SVG forms, picture resource size reduces about 75%.
In embodiments of the present invention, except multiple code files that render are stored in preassigned Resource TOC, also need
To draw and render the rendering objects of code file and cache into rendering objects pond, rendering objects may be, but not limited to, matrix,
Rectangle, paintbrush, path etc., corresponding rendering objects pond may be, but not limited to, matrix object pond, rectangular object pond, paintbrush pair
As pond, path objects pond etc., rendering objects and rendering objects pond are corresponded, due to each drafting needs for rendering code file
Several matrix objects, rectangular object, paintbrush object, path objects etc., and every kind of rendering objects usage quantity with rendering
The content of code file is relevant, if allowing each code file that renders to hold corresponding rendering objects, so has certain interior
Deposit expense and frequently create the performance loss of rendering objects, in order to be multiplexed internal memory as far as possible, set up rendering objects cache pool machine
System, instantiates a number of rendering objects and is put into cache pool in advance, when execution renders the drafting of code file, wherein using
Rendering objects be taken from rendering objects pond, only when rendering, code file is more complicated and rendering objects that need to use exceed
Ability dynamic creation corresponding rendering objects during rendering objects pond.
It should be noted that in embodiments of the present invention, due to being provided with rendering objects caching mechanism, being available for all render
Code file be multiplexed, so be converted to render the EMS memory occupation after code file than dynamic analysis SVG polar plots also it is few very
It is many, for example, the internal memory of a SVG polar plot about 0.8k, and the internal memory of a grid map is directly proportional to picture size, icon ranks
General ten to tens k, big figure rank even hundreds of k.
Sub-step S1026, obtains multiple corresponding storage address for rendering code file in Resource TOC, and this is more
The individual corresponding storage address of code file that renders is added in the address mapping table pre-set.
As a kind of embodiment, some is rendered into code file and is stored in after Resource TOC, Resource TOC can generate one
Individual this renders the storage address of code file, and the storage address is read out, and is stored in the address mapping table pre-set.
Step S103, downloads from service end and renders code file, wherein, render code file and turned by the first picture file
Change, the first picture file is the picture file based on markup language, renders code file and is made up of non-markup languages.
In embodiments of the present invention, when some client 200 need install application program 400, or be installed on some visitor
When the application program 400 at family end 200 needs to update, the client 200 contains from the download package of service end 100 renders code file
The installation kit of application program 400, and installed.
Step S104, response user operation, operation render code file, to render code file carry out color applying drawing with
To second picture file.
In embodiments of the present invention, the mode of response user operation may be, but not limited to, is installed on visitor when user clicks on
During the icon of the application program 400 at family end 200 so that when including the application code operation for rendering code file, then transport
Row renders code file, carries out color applying drawing to rendering code file to obtain second picture file, user's operation can answered
Run with program 400 so that produced when needing to use the interface of SVG pictures to load, be used as a kind of embodiment, second picture text
Part can be the picture shown on the display screen 280 of client 200.
Fig. 7 is refer to, sub-step S104 also includes following sub-step:
Sub-step S1041, it is corresponding that response user operates any one obtained in address mapping table to render code file
Storage address.
In embodiments of the present invention, user can be worked as and click on some installation application program 400 so that the application program 400
Application code operation when, obtain address mapping table in any one render the corresponding storage address of code file.
It should be noted that in embodiments of the present invention, code text is rendered due to the picture file of SVG forms being converted to
Part so that can directly draw second picture file without any I/O operation during loading, and grid map needs to be IO behaviour during operation
Make reading resource, if nine figures also need to parse nine figure information, so the image processing method loading velocity that the present invention is provided
It is faster than grid map a lot, in actual items, gradation data statistics shows that loading velocity compares grid first for second picture file
Figure is fast more than 8 times, non-first because grid map and second picture file have caching, remains basically stable.
Sub-step S1042, according to any one render the corresponding storage address of code file obtained in Resource TOC with
The storage address is corresponding to render code file.
Sub-step S1043, when render code file need modification primitive attribute when, perform attribute modification operation.
In embodiments of the present invention, if same icon has been multiplexed repeatedly, need to change primitive attribute, when modification wash with watercolours
When contaminating the primitive attribute in code file, adjacent and property value identical pel is gathered together, " layer " is defined as, and increase
Plus figure layer modification interface, if, it is necessary to batch modification is adjacent and during property value identical primitive attribute in actual use scene,
The color attribute that interface can rapidly change each pel in " layer " is changed by figure layer, so as to simplify the primitive attribute of this scene
Modification, realizes the primitive attribute for quickly changing multiple pels.
It should be noted that the modification of property value, which may be, but not limited to, is rendering modification before the code file seat of honour is rendered,
Or changed in the random time section in render process, as long as refreshing view after can ensure that modification property value, in addition, by
When being converted into rendering code file storage by the picture file of SVG forms and arriving Resource TOC, it can use and of the same name render generation
Code file, during the primitive attribute rendered in code file in order to avoid modification one, has influence on and other of the same name renders code text
Part, when carrying out attribute modification operation, it is necessary to first copy portion and render the corresponding object picture of code file and carry out attribute again and repair
Change.Further, since primitive attribute can be changed, if the picture file of multiple similar SVG forms be pel color or
When special efficacy is different, it is possible to be multiplexed same picture, only different primitive attributes need to be changed.
Fig. 8 is refer to, sub-step S1043 also includes following sub-step:
Sub-step S10431, response user's operation, operation renders code file, obtains attribute array.
In embodiments of the present invention, attribute array may be, but not limited to, background pel or non-background pel member color,
The property value of shape etc., the array constituted.
Sub-step S10432, modifies to the property value of the same type primitive attribute in attribute array.
In embodiments of the present invention, after the property value of modification primitive attribute, then its primitive attribute accordingly changes, for example, will
The rgb value of some pel is revised as (1,1,0) from (1,0,0), then the color of the pel will be changed into yellow from red accordingly.
In addition, when the property value of multiple adjacent same type primitive attributes in attribute array is identical, setting the plurality of same type figure
Meta-attribute is pel set, and batch of multiple same type primitive attribute property values is realized by changing the property value of the pel set
Amount modification.The background pel of such as some picture is yellow, there is 3 adjacent pels in non-background pel, respectively pel 1,
Pel 2 and pel 3, and the color of pel 1, pel 2 and pel 3 is red, then can make pel 1, pel 2 and pel 3
For a figure layer, when the color of pel 1, pel 2 and pel 3 is required to be revised as blueness, only interface need to be changed by figure layer
Property value is revised as (0,0,1) from (1,0,0), just may be such that the color of pel 1, pel 2 and pel 3 becomes au bleu.
Sub-step S1044, when rendering code file including nine figure attribute informations, determines to treat wash with watercolours according to nine figure attribute informations
Nine figure content areas in the second picture file of dye.
In embodiments of the present invention, nine figure content areas may be, but not limited to, by vertical direction stretch zones l back gauge
Value and horizontal direction stretch zones t back gauge value determined by stretch zones, and vertical direction content back gauge r back gauge value and
Content area determined by horizontal direction content back gauge b back gauge value.
Sub-step S1045, operation renders code file, and second picture text is obtained to rendering code file progress color applying drawing
Part.
Fig. 9 is refer to, sub-step S1045 also includes following sub-step:
Sub-step S10451, obtains zoom factor.
In embodiments of the present invention, zoom factor is set according to the resolution ratio of client 200, can be by replicating
Display codes under android system view catalogues obtain the resolution ratio of client 200, the setting standard of zoom factor
When being so that second picture file is shown in client 200, amplify undistorted.
Sub-step S10452, according to zoom factor, determines the apex coordinate of second picture file to be rendered.
In embodiments of the present invention, the apex coordinate of second picture file to be rendered may be, but not limited to, scaling system
The product of number and the former apex coordinate of second picture file, in other words, reads render second picture text in code file first
The apex coordinate of part, the apex coordinate that zoom factor is exactly second picture file to be rendered is multiplied by with the apex coordinate, now
Apex coordinate be scaled later apex coordinate.
Figure 10 is refer to, sub-step S10452 also includes following sub-step:
Sub-step S104521, when second picture file to be rendered includes nine figure content areas, calculates nine figure contents
The coordinate of representative points of the region after nine figure stretched operations.
In embodiments of the present invention, representative points of the nine figure content areas after nine figure stretched operations for (PathX,
PathY), and
PathX=OrgPathX+ (DawableW-OrgW) * LeftTopBWS/TopBWS;
PathY=OrgPathY+ (DawableH-OrgH) * TopLeftBWS/LeftBWS;
Wherein, the apex coordinate of nine figure content areas when OrgPathX/Y is non-stretched, DrawableW/H is client
The width of control on 200, it is the dynamic access when client 200 is run, when OrgW/H is non-stretched in nine figures
Hold peak width/height, the total proportion of black surround on nine figure content areas when TopBWS is non-stretched, nine when LeftBWS is non-stretched
The total proportion of the left black surround of figure content area, the total proportion of black surround on nine figure content areas of summit left when LeftTopBW is non-stretched,
The total proportion of the left black surround of nine figure content areas when TopLeftBWS is non-stretched above summit.
By above-mentioned computing, the coordinate of representative points of the nine figure content areas after nine figure stretched operations just can be calculated,
The coordinate of usual representative points will not fall in upper/left black surround, and feelings in upper/left black surround are fallen if there is the coordinate of representative points
Condition, then also need to carry out following amendment:
PathXTopBL=OrgPathX-CurTopBLeftX;
PathYLeftBL=OrgPathY-CurLeftBTopY;
FixPathX=PathX+ (DawableW-OrgW) * (CurTopBW/TopBWS) * (PathXTopBL/
CurTopBL);
FixPathY=PathY+ (DawableH-OrgH) * (CurLeftBW/LeftBWS) * (PathYLeftBL/
CurLeftBL);
Wherein, FixPathX/Y is the coordinate modification end value of representative points, nine figure contents when CurTopBL is non-stretched
Black surround length on region, nine figure content areas left black surround length when CurLeftBL is non-stretched, CurTopBLeftX is non-stretched
Black surround left end point x coordinate on Shi Jiutu content areas, nine figure content areas left black surround upper end when CurLeftBTopY is non-stretched
Point y-coordinate, PathXTopBL is length of the representative points x coordinate on upper black surround, and PathYLeftBL is representative points y-coordinate
Length on left black surround, CurTopBW black surround proportions on nine figures where representative points x, CurLeftBW is target Path
The left black surround proportion of nine figures where the y of summit, Path is figure path.
Sub-step S104522, is stretched according to the second picture file that the coordinate pair of representative points is to be rendered.
In embodiments of the present invention, representative points are the pixel coordinate points after nine figure stretched operations, render second picture text
Part also needs to calculate the screen apex coordinate corresponding to the representative points, and screen summit is multiplying for representative points and picture element density coefficient
Product, picture element density coefficient is relevant with the resolution ratio of client 200.
Sub-step S104523, according to zoom factor, it is determined that the second picture file to be rendered after nine figure stretched operations
Graphics vertex coordinate.
Sub-step S10453, based on apex coordinate, operation renders code file and obtains second picture file.
In embodiments of the present invention, according to the apex coordinate after scaling, to render code file carry out color applying drawing with
To second picture file, due to being that first scaling summit is drawn again, therefore second picture file can be undistorted after amplification.
The image processing method that first embodiment of the invention is provided, first, the picture file of multiple SVG forms is turned respectively
Be changed to it is multiple it is one-to-one render code file, and render code file by each and be each packaged, realize code essence
Letter, can effectively reduce the size of committed memory;Second, during conversion renders code file, introduce SVG code moulds
Plate, the common code part for rendering code file is repeatedly multiplexed, the speed for turning code is improved;3rd, there is provided wash with watercolours
Target cache mechanism is contaminated, will be drawn and rendered the rendering objects of code file and cache into rendering objects pond, is available for all rendering generation
Code file multiplexing, improves rendering efficiency;4th, the property value for calculating same type primitive attribute constitutes attribute array, can when rendering
Primitive attribute is changed with dynamic, height multiplexing picture resource strengthens the flexibility of picture, while solving the problems, such as resource redundancy;
5th, drawn again by first scaling apex coordinate picture picture render mode solve second picture file amplification it is undistorted
The problem of, and remembered by self-defined nine icon of picture file to SVG forms and realize its parsing to solve branch of the SVG to nine figures
Hold;It is fast, complicated with loading velocity compared with existing traversal XML mode of the tree construction to parse SVG picture file information
The high advantage of picture rendering efficiency.
Second embodiment
Figure 11 is refer to, Figure 11 shows the square frame signal of the first picture processing device 110 provided in an embodiment of the present invention
Figure.First picture processing device 110 includes picture acquisition module 111 and file modular converter 112.
Picture acquisition module 111, the first picture file for obtaining client, wherein, the first picture file be based on
The picture file of markup language.
In embodiments of the present invention, picture acquisition module 111 can be used for performing step S101.
File modular converter 112, code file is rendered for the first picture file to be converted to, to render code file
Color applying drawing is carried out to obtain second picture file to rendering code file when client is run, wherein rendering code file
It is made up of non-markup languages.
In embodiments of the present invention, file modular converter 112 can be used for performing step S102.
It refer to Figure 12, Figure 12 is the square frame of file modular converter 112 in the first picture processing device 110 shown in Figure 11
Schematic diagram.File modular converter 112 includes file conversion unit 1121, code generating unit 1122, primitive attribute acquiring unit
1123rd, computing unit 1124, file storage unit 1125 and address storaging unit 1126.
File conversion unit 1121, is changed for the picture file to SVG forms, generates feature code.
In embodiments of the present invention, file conversion unit 1121 can be used for performing sub-step S1021.
Figure 13 is refer to, Figure 13 shows for the square frame of file conversion unit 1121 in the file modular converter 112 shown in Figure 12
It is intended to.File conversion unit 1121 includes the first sub- execution unit 11211, the second sub- of execution unit 11212 and the 3rd and performed
Unit 11213.
First sub- execution unit 11211, for the picture file when SVG forms to that should there are nine icons to clock, by nine icons
Note resolves to nine figure attribute informations.
In embodiments of the present invention, the first sub- execution unit 11211 can be used for performing sub-step S10211.
Second sub- execution unit 11212, for the picture file of SVG forms to be converted into first code file.
In embodiments of the present invention, the second sub- execution unit 11212 can be used for performing sub-step S10212.
3rd sub- execution unit 11213, for nine figure attribute informations to be added in first code file, to obtain feature
Code.
In embodiments of the present invention, the 3rd sub- execution unit 11213 can be used for performing sub-step S10213.
Code generating unit 1122, the same type primitive attribute of the picture file for obtaining SVG forms.
In embodiments of the present invention, code generating unit 1122 can be used for performing sub-step S1022.
Primitive attribute acquiring unit 1123, the property value for calculating same type primitive attribute, property value constitutes attribute number
Group, and attribute array is added in feature code.
In embodiments of the present invention, primitive attribute acquiring unit 1123 can be used for performing sub-step S1023.
Computing unit 1124, for feature code set to be used to the SVG Code Templates pre-set, generation renders code text
Part, wherein, render code file and be made up of Java code.
In embodiments of the present invention, computing unit 1124 can be used for performing sub-step S1024.
File storage unit 1125, for multiple code files that render to be stored in preassigned Resource TOC.
In embodiments of the present invention, file storage unit 1125 can be used for performing sub-step S1025.
Address storaging unit 1126, for obtaining multiple corresponding storages for rendering code file in Resource TOC
Location, and the plurality of corresponding storage address of code file that renders is added in the address mapping table pre-set.
In embodiments of the present invention, address storaging unit 1126 can be used for performing sub-step S1026.
Figure 14 is refer to, Figure 14 shows the square frame signal of second picture processing unit 210 provided in an embodiment of the present invention
Figure.Second picture processing unit 210 includes file download module 211 and picture rendering module 212.
File download module 211, code file is rendered for being downloaded from service end, wherein, code file is rendered by the
One picture file is converted, and the first picture file is the picture file based on markup language, renders code file by non-marked
Language is constituted.
In embodiments of the present invention, file download module 211 can be used for performing step S103.
Picture rendering module 212, for responding user's operation, operation renders code file, is carried out to rendering code file
Color applying drawing is to obtain second picture file.
In embodiments of the present invention, picture rendering module 212 can be used for performing step S104.
It refer to Figure 15, Figure 15 is the square frame of picture rendering module 212 in second picture processing unit 210 shown in Figure 14
Schematic diagram.Picture rendering module 212 includes address loading unit 2121, Code obtaining unit 2122, modification unit 2123, region
Determining unit 2124 and picture rendering unit 2125.
Address loading unit 2121, operates any one obtained in address mapping table to render code text for responding user
The corresponding storage address of part.
In embodiments of the present invention, address loading unit 2121 can be used for performing sub-step S1041.
Code obtaining unit 2122, for rendering the corresponding storage address of code file in Resource TOC according to any one
Middle acquisition is corresponding with the storage address to render code file.
In embodiments of the present invention, Code obtaining unit 2122 can be used for performing sub-step S1042.
Change unit 2123, for when render code file need modification primitive attribute when, perform attribute modification operation behaviour
Make.
In embodiments of the present invention, modification unit 2123 can be used for performing sub-step S1043.
It refer to Figure 16, Figure 16 is the block diagram that unit 2123 is changed in the picture rendering module 212 shown in Figure 15.
Changing unit 2123 includes the 4th sub- execution unit 21232 of sub- execution unit 21231 and the 5th.
4th sub- execution unit 21231, for responding user's operation, operation renders code file, obtains attribute array.
In embodiments of the present invention, the 4th sub- execution unit 21231 can be used for performing sub-step S10431.
5th sub- execution unit 21232, modifies for the property value to the same type primitive attribute in attribute array.
In embodiments of the present invention, the 5th sub- execution unit 21232 can be used for performing sub-step S10432.
Area determination unit 2124, for when rendering code file including nine figure attribute informations, being believed according to nine figure attributes
Breath determines nine figure content areas in second picture file to be rendered.
In embodiments of the present invention, area determination unit 2124 can be used for performing sub-step S1044.
Picture rendering unit 2125, code file is rendered for running, and is obtained to rendering code file progress color applying drawing
Second picture file.
In embodiments of the present invention, picture rendering unit 2125 can be used for performing sub-step S1045.
Figure 17 is refer to, Figure 17 shows for the square frame of picture rendering unit 2125 in the picture rendering module 212 shown in Figure 17
It is intended to.Picture rendering unit 2125 includes the 6th sub- execution unit 21251, the 7th sub- of execution unit 21252 and the 8th and performed
Unit 21253.
6th sub- execution unit 21251, for obtaining zoom factor.
In embodiments of the present invention, the 6th sub- execution unit 21251 can be used for performing sub-step S10451.
7th sub- execution unit 21252, for according to zoom factor, determining that the summit of second picture file to be rendered is sat
Mark.
In embodiments of the present invention, the 7th sub- execution unit 21252 can be used for performing sub-step S10452.
It refer to Figure 18, Figure 18 is the side of the 7th sub- execution unit 21252 in picture rendering unit 2125 shown in Figure 17
Frame schematic diagram.7th sub- execution unit 21252 includes coordinate calculating unit 212521, draw unit 212522 and coordinate and determines list
Member 212523.
Coordinate calculating unit 212521, for when second picture file to be rendered includes nine figure content areas, counting
Calculate the coordinate of representative points of the nine figure content areas after nine figure stretched operations.
In embodiments of the present invention, coordinate calculating unit 212521 can be used for performing sub-step S104521.
Draw unit 212522, the second picture file to be rendered for the coordinate pair according to representative points is stretched.
In embodiments of the present invention, draw unit 212522 can be used for performing sub-step S104522.
Coordinate determining unit 212523, for according to zoom factor, it is determined that to be rendered after nine figure stretched operations
The graphics vertex coordinate of two picture files.
In embodiments of the present invention, coordinate determining unit 212523 can be used for performing sub-step S104523.
8th sub- execution unit 21253, for based on apex coordinate, operation to render code file and obtains second picture text
Part.
In embodiments of the present invention, the 8th sub- execution unit 21253 can be used for performing sub-step S10453.
In summary, the present invention is provided a kind of image processing method, device, service end and client, service end are obtained
First picture file of client, wherein, the first picture file be the picture file based on markup language, and by the first picture text
Part, which is converted to, renders code file, to rendering code file render and paint when client is run rendering code file
System is made up of with obtaining second picture file wherein rendering code file non-markup languages;Client is downloaded from service end and rendered
Code file, wherein, render code file and converted by the first picture file, the first picture file is based on markup language
Picture file, render code file and be made up of non-markup languages;Client end response user operates, and operation renders code file,
Color applying drawing is carried out to obtain second picture file to rendering code file.Compared with existing grid map, can effectively it reduce
The size of committed memory, while picture amplification is undistorted, SVG picture files letter is parsed with existing traversal XML tree construction
The mode of breath is compared, with loading velocity it is fast, can locally change and render order, support that nine figures, complicated picture rendering efficiency are high
Advantage.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can also pass through
Other modes are realized.Device embodiment described above is only schematical, for example, flow chart and block diagram in accompanying drawing
Show according to the device of multiple embodiments of the present invention, the architectural framework in the cards of method and computer program product,
Function and operation.At this point, each square frame in flow chart or block diagram can represent the one of a module, program segment or code
Part a, part for the module, program segment or code is used to realize holding for defined logic function comprising one or more
Row instruction.It should also be noted that in some implementations as replacement, the function of being marked in square frame can also with different from
The order marked in accompanying drawing occurs.For example, two continuous square frames can essentially be performed substantially in parallel, they are sometimes
It can perform in the opposite order, this is depending on involved function.It is also noted that every in block diagram and/or flow chart
The combination of individual square frame and block diagram and/or the square frame in flow chart, can use the special base for performing defined function or action
Realize, or can be realized with the combination of specialized hardware and computer instruction in the system of hardware.
In addition, each functional module in each embodiment of the invention can integrate to form an independent portion
Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized using in the form of software function module and is used as independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially in other words
The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are to cause a computer equipment (can be individual
People's computer, server, or network equipment etc.) perform all or part of step of each of the invention embodiment methods described.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.Need
Illustrate, herein, such as first and second or the like relational terms be used merely to by an entity or operation with
Another entity or operation make a distinction, and not necessarily require or imply between these entities or operation there is any this reality
The relation or order on border.Moreover, term " comprising ", "comprising" or its any other variant are intended to the bag of nonexcludability
Contain, so that process, method, article or equipment including a series of key elements are not only including those key elements, but also including
Other key elements being not expressly set out, or also include for this process, method, article or the intrinsic key element of equipment.
In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including the key element
Process, method, article or equipment in also there is other identical element.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.It should be noted that:Similar label and letter exists
Similar terms is represented in following accompanying drawing, therefore, once being defined in a certain Xiang Yi accompanying drawing, is then not required in subsequent accompanying drawing
It is further defined and explained.