CN107481194A - The method of phase inframe photo rotation self adaptive pantographic based on photograph album application - Google Patents
The method of phase inframe photo rotation self adaptive pantographic based on photograph album application Download PDFInfo
- Publication number
- CN107481194A CN107481194A CN201710720823.5A CN201710720823A CN107481194A CN 107481194 A CN107481194 A CN 107481194A CN 201710720823 A CN201710720823 A CN 201710720823A CN 107481194 A CN107481194 A CN 107481194A
- Authority
- CN
- China
- Prior art keywords
- photo
- point
- viewing area
- frame
- central point
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/40—Scaling the whole image or part thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/60—Rotation of a whole image or part thereof
Abstract
The invention discloses a kind of method of the phase inframe photo rotation self adaptive pantographic based on photograph album application, in Arbitrary Rotation photo, the good presentation of photo maximum magnitude in viewing area can be allowed, and occur without the situation of abnormal show;Including setting central point, the coordinate at four angles in viewing area is set, and calculates the coordinate at four angles of photo, calculates the coordinate of central point on photo four edges;Calculate the opposite side line of central point on photo four edges;The angle point of top two of photo frame viewing area is obtained to the intersection point point of opposite side line;Two, the left side angle point of photo frame viewing area is obtained again to the intersection point point of another opposite side line;By calculating pantograph ratio, higher value is taken, the radix of the pantograph ratio final as photo;It can allow the good presentation of photo maximum magnitude in viewing area.Using method of the invention, it is possible to ensureing, when photo rotates, to make photo circumscribed in photo frame viewing area, the main body in photo shows the centre of miscellaneous viewing area.
Description
Technical field
The present invention relates to the method for image scaling, and in particular to a kind of phase inframe photo rotation based on photograph album application is adaptive
The method that should be scaled, belongs to technical field of image processing.
Background technology
Because flash inherently gradually develops from a animation software, therefore, some rich media applications are done with it
It is very handy, there is very strong expressive force.As a animation software, flash has " display object " and " frame " concept.First
" frame " is said, as TV " frame frequency ", represents that the film segments of broadcasting per second (represents per second and renders stage in flash
Number).There is frame, it is possible to which abundant many performances and interaction, adaptive rotation here are also based on frame." display pair is said again
As ":The thing of all displays, all it is display object (DisplayObject) in flash.Then, also show that object holds
Device (DisplayObjectContainer).Show that object container is inherited and show object, a display object container can include
Any other display object.Here photo frame, photo is also all display object container.One photo frame is a Sprite in itself
(being inherited from DisplayObjectContainer), there are three display objects inside it:Prospect, shade, photo container.Wherein,
So-called " shade ", the display object of lower section is exactly shown that a part comes out, this part is just the part of mask regions.By one
Open photo figure and be put into photo frame, actually photo is put into the photo container in photo frame.Photo container is acted on by shade,
The effect finally showed, referring to accompanying drawing 1.
In accompanying drawing 1, put the photo come into and be divided to scaling and do not scale two kinds of situations, do not scale and be put into by original size, four
Week is hidden (or cutting out) beyond photo frame part;Scaling fully supports photo frame (circumscribed) by a certain percentage.In general, the photograph being put into
Piece will zoom in and out, and reach best display effect.It is noted that the effect that scaling reaches is circumscribed rather than inscribe,
It is exactly its edges just close to the edge of photo frame viewing area on inscribe and circumscribed.Referring to accompanying drawing 2.
Such as accompanying drawing 2, a less square photo is put into a larger rectangle photo frame, square photo can quilt
Scaling.If inscribe, then photo frame both ends can blank;It if circumscribed, would not blank, but can all exceed up and down
(part exceeded can be hidden because of shade).Typically circumscribed in real process in order to not blank, then adjustment is shone
The position of piece container, the presentation effect so reached are best.It is described above, rotation is not all considered also.Once photo rotates,
How to allow photo circumscribed in photo frame viewing area, be exactly content of interest in this patent.
The content of the invention
When ensureing that photo rotates it is an object of the invention to provide one kind, make photo circumscribed in photo frame viewing area
Based on photograph album application phase inframe photo rotation self adaptive pantographic method.
What the present invention was realized in:
A kind of method of the phase inframe photo rotation self adaptive pantographic based on photograph album application, in Arbitrary Rotation photo
When, the good presentation of photo maximum magnitude in viewing area can be allowed, and occur without the situation of abnormal show;Including following step
Suddenly:
Step 1: the coordinate PointCenter (x, y) of records center point;Write a Chinese character in simplified form into pc;The central point is both as photo frame
Central point, the central point as photo, photo are rotated around the central point again;
Step 2: the coordinate PhotoFramePoint1 (x, y) at four angles of record photo frame viewing area,
PhotoFramePoint2 (x, y), PhotoFramePoint3 (x, y), PhotoFramePoint4 (x, y), be sequentially upper left,
Upper right, bottom right, lower-left, write a Chinese character in simplified form into pf1, pf2, pf3, pf4;
Step 3: when press mouse carry out dragging rotation when, according to some base attributes of photo, calculate four, photo
The coordinate at angle;According to upper left, upper right, bottom right, lower-left position, write a Chinese character in simplified form into p1, p2, p3, p4 respectively;
Step 4: on the basis of step 3, the coordinate of central point on photo four edges is calculated;According to it is upper, right, under,
Left position, writes a Chinese character in simplified form into cz1, cz2, cz3, cz4 respectively;
Step 5: on the basis of step 4, the opposite side line of central point on photo four edges is calculated;I.e.:Cz1 and
The line that cz3 is formed, the line that line13, cz2 and cz4 are formed, line24;
Step 6: on the basis of step 5, the angle point of top two of photo frame viewing area is obtained to line24 intersection point
The vertical point of point, i.e. pf1, pf2 to line24, is pp1, pp2 respectively;Two, the left side angle point for obtaining photo frame viewing area again arrives
Line13 intersection point point, i.e. pf1, pf4 to line13 vertical point, are pp3, pp4 respectively;
Step 7: on the basis of step 6, obtain pp1, pp2 to the distance of central point, take apart from maximum that
Point, then gone with the original height of photo and the distance seeks ratio, draw a pantograph ratio scaleRate1;Then obtain again pp3,
Pp4 takes that point apart from maximum, is then gone with the original width of photo and the distance seeks ratio, obtained to the distance of central point
Go out a pantograph ratio scaleRate2;
Step 8: on the basis of step 7, value larger in scaleRate1 and scaleRate2 is taken, as photo most
The radix of whole pantograph ratio;
Step 9: the pantograph ratio parameter obtained by step 8 is applied on photo, photo is dragging each frame when rotating
In, all can circumscribed photo frame viewing area;Good interactive experience is reached;
Step 10: after dragging rotates to good angle, mouse is unclamped, completes the operation of rotation photo;Now photo
Also corresponding pantograph ratio is calculated in last frame so that the photo for having adjusted angle is finally presented well in photo frame.
Further scheme is:
Allow the good presentation of photo maximum magnitude in viewing area, refer to ensure photo circumscribed viewing area during rotation.
Using method of the invention, it is possible to ensure, when photo rotates, to make photo circumscribed in photo frame viewing area,
Main body in photo shows the centre of miscellaneous viewing area.
Brief description of the drawings
Accompanying drawing 1. has distinguished photo scaling and has not scaled the photo frame composition schematic diagram of two kinds of results;
The photo inscribe of accompanying drawing 2. and the schematic diagram of circumscribed display;
The schematic diagram that the mouse drag control point of accompanying drawing 3. is rotated;
Photo is not scaled when the photo of accompanying drawing 4. rotates, the schematic diagram of blank occur in two angles;
Photo is not scaled when the photo of accompanying drawing 5. rotates, photo is beyond the more schematic diagram in viewing area;
The photo of accompanying drawing 6. zooms in and out when rotating to photo, and the circumscribed photo frame visible area of blank, photo do not occur in two angles
Domain schematic diagram;
The photo of accompanying drawing 7. zooms in and out when rotating to photo, and photo is without departing from viewing area is more, the circumscribed photo frame of photo
Viewing area schematic diagram;
The picture location of accompanying drawing 8. is aligned, and the main body in photo is shown in the schematic diagram in the centre of viewing area.
Embodiment
The present invention is described in further detail with specific embodiment below in conjunction with the accompanying drawings.
Before this, in order to deepen that for the understanding of the present invention, accompanying drawing is specifically described.
According to Fig. 1, in flash album editors, the composition of a photo frame is divided into 3 parts:Prospect (frame), shade
(viewing area of photo), photo container (bitmap of carrying photo).
According to Fig. 2, scaled after photo is put into photo frame, there are two kinds of scalable manners:Photo inscribe viewing area, photo are circumscribed
Viewing area.
According to Fig. 3, after photo just puts photo frame into, scalable manner when initial is the circumscribed viewing area of photo.Notice photograph
The scenery that piece is clapped in itself has an angle tilt, at this point it is possible to press mouse on rotary knob, dragging rotary knob comes to photo
Rotated.
According to Fig. 4, photo is not scaled when, upon rotating, it may appear that but there is the situation of blank in region.
According to Fig. 5, photo is not scaled when, upon rotating, occur that photo exceeds the situation of viewing area during rotation.
According to Fig. 6 and Fig. 7, photo is scaled when, upon rotating, it can be ensured that the circumscribed viewing area of photo, having reached good is in
Existing effect.The mode specifically scaled is:Mathematical modeling is taken out, with collection geometry and line segment equation, in each frame dynamic calculation,
Solve the pantograph ratio of photo on present frame.
According to Fig. 8, after the photo anglec of rotation is adjusted, the tilted scenery of original photo, water outlet is presented in photo frame
Flat and sea effect.
As accompanying drawing 1, accompanying drawing 2 are seen that the photo of the inside has tilted.If it is desired to adjustment tilts, it is necessary to compares
Piece is rotated.The rotation mode used in this patent is one control point of mouse drag to rotate photo, referring to accompanying drawing 3.
In accompanying drawing 3, black box is exactly the part of phase inframe shade, that is, the final viewing area of photo.There is a shape picture in figure
The button of the button of water droplet, i.e. dragging control rotation;There are a white translucent annulus, the i.e. running track of rotary knob.When
For mouse when being pressed on dragging rotary knob, mouse graph is changed into handgrip, while starts a frame recurrence event (ENTER_
FRAME).Hereafter, in each frame, with the difference of mouse coordinates position, rotary knob can also be transported around central point in orbit
Move the position of respective angles, at the same can dynamic calculation photo pantograph ratio, so as to allow photo in photo frame it is circumscribed.In order to more preferable
Ground illustrates circumscribed, situation about not zoomed in and out in dragging process is first had a look here, such as accompanying drawing 4 and accompanying drawing 5.In accompanying drawing 4, rotation
When going to certain angle, there is blank in two angles;In accompanying drawing 5, when rotating to another angle, photo exceeds viewing area again
It is more.And preferably situation should be such as accompanying drawing 6 and accompanying drawing 7, in any angle, photo can be presented on visible area maximum magnitude
In domain, while ensure that viewing area does not blank Anywhere.
In order to realize this method, it is necessary to build a mathematical modeling, i.e.,:There are two rectangles A and B, possess respectively arbitrarily long
Wide ratio, their central points are identical, and one (A) is fixed, and another (B) rotates around central point, and guarantee B inside is at any time during rotation
Close to A outside (i.e. the circumscribed A of B).
Therefore, firstly the need of the following initial parameter of preparation.
1. the coordinate PointCenter (x, y) of central point.Write a Chinese character in simplified form into pc.
2. the coordinate PhotoFramePoint1 (x, y) at four angles of photo frame viewing area, PhotoFramePoint2 (x,
Y), PhotoFramePoint3 (x, y), PhotoFramePoint4 (x, y), are sequentially upper left, upper right, bottom right, lower-left, write a Chinese character in simplified form
Into pf1, pf2, pf3, pf4.
Then, it is necessary to calculate during each frame rotation:
1) coordinate at four angles of photo.In flash, any display object has some basic property values, such as coordinate
(x, y), angle (rotation), scaleX (scaling in X-coordinate axle), scaleY (scaling in Y-coordinate axle).
By these primary attribute values, the coordinate position at four angles of photo can be calculated.Also according to upper left, upper right, bottom right, a left side
Under position, write a Chinese character in simplified form into p1, p2, p3, p4 respectively.
2) on photo four edges central point coordinate.According to it is upper, right, under, left position, write a Chinese character in simplified form into respectively cz1, cz2,
cz3、cz4。
3) on photo four edges central point opposite side line.I.e.:The line (line13) of cz1 and cz3 formation, cz2 and cz4 shapes
Into line (line24).
4) angle point of top two of photo frame viewing area is obtained to line24 intersection point point (i.e. pf1, pf2 to line24
Hang down point), it is pp1, pp2 respectively.
5) two, the left side angle point of photo frame viewing area is obtained to line13 intersection point point (i.e. pf1, pf4 to line13
Hang down point), it is pp3, pp4 respectively.
6) pp1, pp2 are obtained to the distance of central point, that point apart from maximum is taken, then with the original height of photo
Go and the distance seeks ratio, draw a pantograph ratio scaleRate1.
7) pp3, pp4 are obtained to the distance of central point, that point apart from maximum is taken, then with the original width of photo
Go and the distance seeks ratio, draw a pantograph ratio scaleRate2.
8) value larger in scaleRate1 and scaleRate2, the radix of the pantograph ratio final as photo are taken.
According to the method described above, the pantograph ratio of each photograph frame can be obtained, to meet wanting for the circumscribed photo frame viewing area of photo
Ask.Certainly, except pantograph ratio, also need to calculate each frame calculate photo coordinate (because the coordinate of display object is not central point,
But the upper left corner of display object), but the calculating is relatively easy, it is apparent to those skilled in the art, this
In do not state.
It is exactly the effect in accompanying drawing 8 after final adjustment is complete.As illustrated, after picture location is aligned, while mobile good position
Put, the main body in photo has been indicated in the centre of viewing area.
Although reference be made herein to invention has been described for explanatory embodiment of the invention, and above-described embodiment is only this hair
Bright preferable embodiment, embodiments of the present invention are simultaneously not restricted to the described embodiments, it should be appreciated that people in the art
Member can be designed that a lot of other modifications and embodiment, and these modifications and embodiment will fall in principle disclosed in the present application
Within scope and spirit.
Claims (2)
- A kind of 1. method of the phase inframe photo rotation self adaptive pantographic based on photograph album application, it is characterised in that:In any angle When rotating photo, the good presentation of photo maximum magnitude in viewing area can be allowed, and occur without the situation of abnormal show;Including Following steps:Step 1: the coordinate PointCenter (x, y) of records center point;Write a Chinese character in simplified form into pc;The central point both center as photo frame Point, the central point as photo, photo are rotated around the central point again;Step 2: the coordinate PhotoFramePoint1 (x, y) at four angles of record photo frame viewing area, PhotoFramePoint2 (x, y), PhotoFramePoint3 (x, y), PhotoFramePoint4 (x, y), be sequentially upper left, Upper right, bottom right, lower-left, write a Chinese character in simplified form into pf1, pf2, pf3, pf4;Step 3: when press mouse carry out dragging rotation when, according to some base attributes of photo, calculate four angles of photo Coordinate;According to upper left, upper right, bottom right, lower-left position, write a Chinese character in simplified form into p1, p2, p3, p4 respectively;Step 4: on the basis of step 3, the coordinate of central point on photo four edges is calculated;According to it is upper, right, under, it is left Position, cz1, cz2, cz3, cz4 are write a Chinese character in simplified form into respectively;Step 5: on the basis of step 4, the opposite side line of central point on photo four edges is calculated;I.e.:Cz1 and cz3 shapes Into line, line13, cz2 and cz4 formed line, line24;Step 6: on the basis of step 5, the angle point of top two of photo frame viewing area is obtained to line24 intersection point point, i.e., Pf1, pf2 to line24 vertical point, are pp1, pp2 respectively;Two, the left side angle point of photo frame viewing area is obtained again to line13 Intersection point point, i.e. pf1, pf4 to line13 vertical point, are pp3, pp4 respectively;Step 7: on the basis of step 6, pp1, pp2 are obtained to the distance of central point, takes that point apart from maximum, so Gone afterwards with the original height of photo and the distance seeks ratio, draw a pantograph ratio scaleRate1;Then pp3, pp4 is obtained again to arrive The distance of central point, that point apart from maximum is taken, then gone with the original width of photo and the distance seeks ratio, draw one Pantograph ratio scaleRate2;Step 8: on the basis of step 7, value larger in scaleRate1 and scaleRate2 is taken, final as photo The radix of pantograph ratio;Step 9: the pantograph ratio parameter obtained by step 8 is applied on photo, photo is in each frame when rotating is dragged, all Can circumscribed photo frame viewing area;Good interactive experience is reached;Step 10: after dragging rotates to good angle, mouse is unclamped, completes the operation of rotation photo;Now photo also exists Corresponding pantograph ratio is calculated in last frame so that the photo for having adjusted angle is finally presented well in photo frame.
- 2. the method for the phase inframe photo rotation self adaptive pantographic based on photograph album application, its feature exist according to claim 1 In:Allow the good presentation of photo maximum magnitude in viewing area, refer to ensure photo circumscribed viewing area during rotation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710720823.5A CN107481194B (en) | 2017-08-22 | 2017-08-22 | Photo rotation self-adaptive scaling method in photo frame based on photo album application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710720823.5A CN107481194B (en) | 2017-08-22 | 2017-08-22 | Photo rotation self-adaptive scaling method in photo frame based on photo album application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107481194A true CN107481194A (en) | 2017-12-15 |
CN107481194B CN107481194B (en) | 2020-06-30 |
Family
ID=60601175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710720823.5A Active CN107481194B (en) | 2017-08-22 | 2017-08-22 | Photo rotation self-adaptive scaling method in photo frame based on photo album application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107481194B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110316084A (en) * | 2018-03-30 | 2019-10-11 | 比亚迪股份有限公司 | Navigation Display system, method and vehicle based on vehicle-mounted display terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070233323A1 (en) * | 2006-04-04 | 2007-10-04 | Panduit Corp. | Building automation system controller |
CN101184142A (en) * | 2007-12-21 | 2008-05-21 | 北京海尔集成电路设计有限公司 | Image processing method and image rotatable digital photo frame of implementing the same |
CN101415103A (en) * | 2007-10-19 | 2009-04-22 | 英华达(南京)科技有限公司 | Method for regulating video signal picture |
CN103700099A (en) * | 2013-12-18 | 2014-04-02 | 同济大学 | Rotation and dimension unchanged wide baseline stereo matching method |
CN104881263A (en) * | 2015-05-27 | 2015-09-02 | 天津三星电子有限公司 | Display control method and display equipment |
-
2017
- 2017-08-22 CN CN201710720823.5A patent/CN107481194B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070233323A1 (en) * | 2006-04-04 | 2007-10-04 | Panduit Corp. | Building automation system controller |
CN101415103A (en) * | 2007-10-19 | 2009-04-22 | 英华达(南京)科技有限公司 | Method for regulating video signal picture |
CN101184142A (en) * | 2007-12-21 | 2008-05-21 | 北京海尔集成电路设计有限公司 | Image processing method and image rotatable digital photo frame of implementing the same |
CN103700099A (en) * | 2013-12-18 | 2014-04-02 | 同济大学 | Rotation and dimension unchanged wide baseline stereo matching method |
CN104881263A (en) * | 2015-05-27 | 2015-09-02 | 天津三星电子有限公司 | Display control method and display equipment |
Non-Patent Citations (1)
Title |
---|
殷勤业等: "自适应旋转投影分解法", 《电子学报》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110316084A (en) * | 2018-03-30 | 2019-10-11 | 比亚迪股份有限公司 | Navigation Display system, method and vehicle based on vehicle-mounted display terminal |
Also Published As
Publication number | Publication date |
---|---|
CN107481194B (en) | 2020-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wong et al. | Virtual brush: a model-based synthesis of Chinese calligraphy | |
US8610720B2 (en) | Decomposing an n-sided patch into multiple patches | |
Horry et al. | Tour into the picture: using a spidery mesh interface to make animation from a single image | |
CN102005059B (en) | Image processing apparatus and image processing method | |
US6515659B1 (en) | Method and system for creating realistic smooth three-dimensional depth contours from two-dimensional images | |
DE69732663T2 (en) | METHOD FOR GENERATING AND CHANGING 3D MODELS AND CORRELATION OF SUCH MODELS WITH 2D PICTURES | |
CN108352082B (en) | Techniques to crowd 3D objects into a plane | |
JP4096622B2 (en) | Image processing method and apparatus, program, and recording medium | |
US20070115283A1 (en) | Casting shadows | |
CN103914862A (en) | Pencil sketch simulating method based on edge tangent stream | |
McCrae et al. | Sketch-based path design | |
Zhang et al. | NK-CDS: A creative design system for museum art derivatives | |
CN107481194A (en) | The method of phase inframe photo rotation self adaptive pantographic based on photograph album application | |
EP3168813A1 (en) | A computer-implemented method of displaying an assembly of digitally modeled objects revealing hidden objects | |
Yeh et al. | Double-sided 2.5 D graphics | |
CN102074025B (en) | Image stylized drawing method and device | |
CN112365572B (en) | Rendering method based on surface subdivision and related products thereof | |
CN113781642A (en) | Three-dimensional model multi-level LOD generation method based on face reduction algorithm | |
WO2022003066A1 (en) | User interface | |
Nam et al. | SPACESKETCH: Shape modeling with 3D meshes and control curves in stereoscopic environments | |
CN110264419B (en) | Image style conversion method, system, equipment and medium for realizing oil painting effect | |
CN106340050A (en) | 2.5-dimensional marquee animation generation method | |
CN116740298B (en) | Method for constructing scene real-time map based on three-dimensional engine | |
Garaeva et al. | Comparative analysis of 3D Blender and 3ds Max modeling methods. | |
Gerhard et al. | Mastering Autodesk 3ds Max Design 2010 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |