The method that a kind of blank is synchronous
Technical field
The invention belongs to networking technology area, relate in particular to the synchronous method of a kind of blank.
Background technology
Along with the development of Internet technology, people's life also changes thereupon, changes information-based life style into by traditional pattern of life gradually.By means of the internet, people just can onlinely see TV, read, make friends, make a phone call, send out mail, see news, and information-based life has become our the indispensable part of living.Certainly, people must could fully experience the facility and information-based live rich and varied of internet by keyboard, mouse, display, headset, the first-class hardware device of shooting.
Display is take up room in the above-mentioned hardware maximum and most important equipment; The big young pathbreaker in its viewing area directly influences the experience of people to the internet; Such as; Use lower resolution displays to read the long slightly passage of length and just need ceaselessly spur scroll bar, this makes to read simply easily originally and becomes very numerous and diverse.In addition, because the display brand is numerous, the enterprises ubiquity uses the situation of different resolution display, and this will cause using same set of system, carry out same operation brings the different visual effect.
Along with Web conference is popularized, some of them very important function such as the synchronous demonstration of document receive people's favor gradually.When carrying out Web conference; The speaker marks the block content on presentation file; If resolution is different; Personnel participating in the meeting's display will can not show same block, can't realize accurately locating the paintbrush vestige, and these all are ubiquitous problems in the application systems such as the existing network teleconference, long-distance education, books reading.
Summary of the invention
The invention provides the synchronous method of a kind of blank, realized accomplishing between the different resolution user that blank is synchronous.
For achieving the above object, technical scheme of the present invention is:
The synchronous method of picture back placed in the middle blank under the different resolution of realizing on a kind of webpage may further comprise the steps:
1) user opens webpage, loads flash, the flash zoom mode is set is convergent-divergent not, and it is upper left alignment that alignment thereof is set;
2) the flash loading needs the picture of demonstration, according to the size of the size of picture and flash picture is set and shows between two parties at blank;
3) control end user after picture shape on the blank, sends the coordinate of figure and the coordinate of picture and arrives all clients;
4) after the client user receives message, obtain figure coordinate and picture coordinate in the message;
5) client recalculates local figure coordinate according to the picture coordinate of this locality, picture coordinate, figure coordinate in the message, and according to the new figure coordinate figure that draws.
In the technique scheme, step 1) comprises following process:
1a) user opens webpage, loads a flash, and the stage.scaleMode that flash is set is StageScaleMode.NO_SCALE;
The stage.align attribute that 1b) flash is set is StageAlign.TOP_LEFT, makes the upper left alignment of stage;
1c) flash connects communication system.
In the technique scheme, step 2) comprise following process:
2a) increase a container as blank, the flash blank that Loads Image, and increase the complete action listener of picture;
After 2b) picture loads and accomplishes; Trigger the complete incident; Flash calculates picture coordinate placed in the middle according to the size of stage and the physical size of picture, and the size of stage is provided with width and is: stageWidth is provided with highly and is: stageHeight; The physical size of picture is provided with width: imageWidth is provided with highly and is: imageHeight.Coordinate Calculation formula placed in the middle is: x horizontal ordinate px=(stageWidth-imageWidth)/2, y ordinate py=(stageHeight-imageHeight)/2;
The x attribute that 2c) picture is set is that (0, px), the y attribute that picture is set is that (0, py), the Math.max here can guarantee that picture shows all the time to Math.max in the visible range to Math.max.
In the technique scheme, step 3) comprises following process:
3a) control end user, figure draws on blank;
3b) flash all coordinate datas and the current picture coordinate placed in the middle that will constitute figure simultaneously sends to all clients through communication system.
In the technique scheme, step 4) comprises following process:
After 4a) client user receives message from communication system, resolve message data;
4b) obtain figure coordinate and picture coordinate in the message, figure x is set, the y coordinate is respectively drawX and drawY, picture x is set, the y coordinate is respectively imageX and imageY, local picture x, y coordinate are set are respectively myImageX and myImageY.
In the technique scheme, step 5) comprises following process:
5a) obtain figure coordinate and picture coordinate in the message, figure x is set, the y coordinate is respectively drawX and drawY, local picture x, y coordinate are set are respectively myImageX and myImageY;
5b) client is converted into local coordinate with the figure coordinate in the message, and reduction formula is: horizontal ordinate localX=drawX+myImageX-imageX, ordinate localY=drawY+myImageY-imageY;
5c) call the flash method and create figure, the x attribute that figure is set is localX, and the y attribute that figure is set is localY.In the technique scheme, communication system described in the step 1) is meant the instant communicating system that can send to one or more users from a user.
The present invention compared with prior art has the following advantages:
(1) can under different resolution, realize the complete unity of the position of the figure that paintbrush is drawn, not have deviation, user experience is good.
(2) in time synchronously, mild, the phenomenon that can not occur pausing.
(3) owing in the position that each client is calculated figure alone, little for the computing pressure of server end.
(4) realize based on webpage fully, need not download any plug-in unit.
(5) can apply to other internet system easily.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is a detail flowchart of the present invention.
Embodiment
Below will and combine embodiment to specify the present invention with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
The synchronous method of picture back placed in the middle blank under the different resolution of realizing on a kind of webpage may further comprise the steps:
1) user opens webpage, loads flash, the flash zoom mode is set is convergent-divergent not, and it is upper left alignment that alignment thereof is set;
2) the flash loading needs the picture of demonstration, according to the size of the size of picture and flash picture is set and shows between two parties at blank;
3) control end user after picture shape on the blank, sends the coordinate of figure and the coordinate of picture and arrives all clients;
4) after the client user receives message, obtain figure coordinate and picture coordinate in the message;
5) client recalculates local figure coordinate according to the picture coordinate of this locality, picture coordinate, figure coordinate in the message, and according to the new figure coordinate figure that draws.
Following further explain method of the present invention:
Referring to Figure of description, the user opens webpage, loads flash, and the scaleMode that flash is set is NO_SCALE, and it is StageAlign.TOP_LEFT that stage.align is set.And increase a container to flash, and as blank, blank its inside that Loads Image; Behind the picture loaded; Trigger the complete incident, the flash program calculates x, the y coordinate figure that can let picture placed in the middle according to the size of the container of the size of stage and picture, and it is Math.max (0 that the coordinate position of picture in container is set; X), Math.max (0, y).The control end user, all coordinate datas and current picture coordinate placed in the middle that the figure that on blank, draws, flash will constitute figure simultaneously send to all clients.Client recalculates local figure coordinate according to the picture coordinate of this locality, picture coordinate, figure coordinate in the message, and according to the new figure coordinate figure that draws.
Fig. 1 is a detail flowchart of the present invention, and detailed step is following:
Step 101: the user opens webpage;
Step 102: load flash, on the flash blank that Shows Picture;
Step 103: blank is set is zoom mode not, it is upper left alignment that alignment thereof is set;
Step 104:, picture is set in blank, shows between two parties according to the size of picture;
Step 105: the control end user, after picture shape on the picture, send the coordinate of figure and the coordinate of picture and arrive all clients;
Step 106: after the client user receives message, obtain figure coordinate and picture coordinate in the message;
Step 107: client recalculates local figure coordinate according to the picture coordinate of this locality, picture coordinate, figure coordinate in the message, and according to the new figure coordinate figure that draws;
Step 108: finish.
Obviously, it is apparent to those skilled in the art that each step of above-mentioned the present invention can realize with the general calculation device; They can concentrate on the single calculation element, perhaps are distributed on the network that a plurality of calculation element forms, alternatively; They can realize with the executable program code of calculation element, thereby, can they be stored in the memory storage and carry out by calculation element; And in some cases; Can carry out step shown or that describe with the order that is different from here, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.