CN104111839A - Absolute positioning method based on canvas - Google Patents
Absolute positioning method based on canvas Download PDFInfo
- Publication number
- CN104111839A CN104111839A CN201410366178.8A CN201410366178A CN104111839A CN 104111839 A CN104111839 A CN 104111839A CN 201410366178 A CN201410366178 A CN 201410366178A CN 104111839 A CN104111839 A CN 104111839A
- Authority
- CN
- China
- Prior art keywords
- canvas
- target
- data
- painting canvas
- absolute positioning
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000013507 mapping Methods 0.000 claims abstract description 7
- 230000006978 adaptation Effects 0.000 abstract description 3
- 238000010422 painting Methods 0.000 description 53
- 230000004807 localization Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
Landscapes
- Image Generation (AREA)
Abstract
The invention discloses an absolute positioning method based on canvas, which comprises the following steps: A. defining a standard reference canvas; B. recording positioning data of the object based on a layout defined by a standard reference canvas; C. determining the scaling ratio of the canvas according to the mapping of the reference canvas and the target canvas; D. and drawing the target object after the object is scaled by the target canvas according to the scaling ratio. According to the method, the stretching of the object in the canvas and the screen adaptation are realized through the mapping of the standard reference canvas and the target canvas, the method keeps the intuition and simplicity of absolute positioning, and can be well adapted to various screen resolutions, so that the applicability of absolute positioning is enhanced by improving an Android absolute positioning mode.
Description
Technical field
The invention belongs to mobile technology field, be specifically related to a kind of absolute fix method based on painting canvas, be suitable for Android mobile device terminal.
Background technology
In existing Android topology, conventional have a LinearLayout, RelativeLayout, TableLayout, FrameLayout, and easy-to-use absolute fix layout type the most directly perceived has been abandoned by Android, topmost reason is exactly the variation that absolute fix layout can not well adapt to screen resolution.
Summary of the invention
For solving the problems of the technologies described above, the object of this invention is to provide a kind of absolute fix method based on painting canvas.
The technical solution used in the present invention is:
An absolute fix method based on painting canvas, is characterized in that comprising the following steps:
A, definition canonical reference painting canvas;
B, layout based on canonical reference painting canvas definition, record the locator data of object;
C, with reference to the mapping of painting canvas and target painting canvas, determine painting canvas scaling;
D, object are pressed after scaling convergent-divergent at target painting canvas, render target object.
Further, the content of described steps A definition is the specification with reference to painting canvas, the Gao Yukuan that this specification is painting canvas.
Further, in described step B, the locator data of object is Gao Yukuan.
Further, described with reference to painting canvas specification and object locator data formation reference layout template file.
Further, described step C comprises the following steps:
C1, utilize layout templates analytics engine to extract layout templates file;
C2, determine the specification of target painting canvas, this specification is the Gao Yukuan of target painting canvas;
The scaling of C3, calculating target painting canvas relative reference painting canvas;
C4, calculate the layout object locator data at target painting canvas.
Wherein, during described C3 comprises: wide pantograph ratio=target painting canvas width/with reference to painting canvas width; High pantograph ratio=target painting canvas height/with reference to painting canvas height.
In described C4: the wide pantograph ratio=target localization of width data * width data; High pantograph ratio=the target localization of altitude information * altitude information.
Described step D is render target object in target painting canvas according to target localization width data and target localization altitude information, forms final page layout.
Beneficial effect of the present invention:
The present invention is by the mapping of canonical reference painting canvas and target painting canvas, stretching and the screen of realizing object in painting canvas adapt to, this method retains the directly perceived and simple of absolute fix, again can the various screen resolution of fine adaptation, thus improvement Android absolute fix mode strengthens the applicability of absolute fix.
Brief description of the drawings
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described further.
Fig. 1 is fundamental diagram of the present invention;
Fig. 2 is absolute fix method flow diagram of the present invention;
Fig. 3 is target painting canvas positioning flow figure of the present invention;
Fig. 4 is the schematic layout pattern of the specific embodiment of the invention with reference to painting canvas;
Fig. 5 is the schematic layout pattern of specific embodiment of the invention target painting canvas.
Embodiment
Shown in figure 1-Fig. 2, be a kind of absolute fix method based on painting canvas of the present invention, comprise the following steps:
A, definition canonical reference painting canvas;
The content of this step definition is the specification with reference to painting canvas, the Gao Yukuan that this specification is painting canvas.
As Fig. 4, in the upper layout of canonical reference painting canvas (480*720), and layout object only has a Button Login as example;
B, layout based on canonical reference painting canvas definition, record the locator data of object; Wherein, the locator data of this object is Gao Yukuan;
Reference painting canvas specification in above-mentioned A and B and object locator data form reference layout data, layout well after storage layout's data to topology file.
C, with reference to the mapping of painting canvas and target painting canvas, determine painting canvas scaling;
Wherein, C specifically comprises again: as Fig. 3
C1, utilize layout templates analytics engine to extract layout templates file;
C2, determine the specification of target painting canvas, this specification is the Gao Yukuan of target painting canvas;
The scaling of C3, calculating target painting canvas relative reference painting canvas;
Wherein, during described C3 comprises: wide pantograph ratio=target painting canvas width/with reference to painting canvas width; High pantograph ratio=target painting canvas height/with reference to painting canvas height.
C4, calculate the layout object locator data at target painting canvas;
Wherein, the wide pantograph ratio=target localization of width data * width data; High pantograph ratio=the target localization of altitude information * altitude information.
D, object are pressed after scaling convergent-divergent at target painting canvas, and the render target object in target painting canvas according to target localization width data and target localization altitude information, forms final page layout, complete location and present, and see Fig. 5.
As mentioned above, the present invention is by the mapping of canonical reference painting canvas and target painting canvas, stretching and the screen of realizing object in painting canvas adapt to, this method retains the directly perceived and simple of absolute fix, again can the various screen resolutions of fine adaptation, thus improvement Android absolute fix mode strengthen the applicability of absolute fix.
The foregoing is only preferential embodiment of the present invention, the present invention is not limited to above-mentioned embodiment, as long as within the technical scheme that realizes the object of the invention with basic identical means all belongs to protection scope of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410366178.8A CN104111839A (en) | 2014-07-29 | 2014-07-29 | Absolute positioning method based on canvas |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410366178.8A CN104111839A (en) | 2014-07-29 | 2014-07-29 | Absolute positioning method based on canvas |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN104111839A true CN104111839A (en) | 2014-10-22 |
Family
ID=51708639
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410366178.8A Pending CN104111839A (en) | 2014-07-29 | 2014-07-29 | Absolute positioning method based on canvas |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104111839A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105373385A (en) * | 2015-11-23 | 2016-03-02 | 四川长虹电器股份有限公司 | Multi-resolution UI (User Interface) adaption scripting development method of Android application |
| CN108363604A (en) * | 2018-02-06 | 2018-08-03 | 四川虹美智能科技有限公司 | A kind of resolution adaptation method, apparatus and operation system |
| CN113961158A (en) * | 2021-09-08 | 2022-01-21 | 北京房江湖科技有限公司 | Cross-platform painting brush synchronization method and device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6320602B1 (en) * | 1993-04-30 | 2001-11-20 | International Business Machines Corporation | Region layout in a view on a graphical display screen |
| CN103034419A (en) * | 2011-10-10 | 2013-04-10 | 上海图龙信息科技有限公司 | Method for classlessly zooming digital map on mobile equipment |
| CN103530117A (en) * | 2013-09-30 | 2014-01-22 | 山西云途信息技术有限公司 | Method and device for adapting to screens, of different sizes, of mobile terminals |
-
2014
- 2014-07-29 CN CN201410366178.8A patent/CN104111839A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6320602B1 (en) * | 1993-04-30 | 2001-11-20 | International Business Machines Corporation | Region layout in a view on a graphical display screen |
| CN103034419A (en) * | 2011-10-10 | 2013-04-10 | 上海图龙信息科技有限公司 | Method for classlessly zooming digital map on mobile equipment |
| CN103530117A (en) * | 2013-09-30 | 2014-01-22 | 山西云途信息技术有限公司 | Method and device for adapting to screens, of different sizes, of mobile terminals |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105373385A (en) * | 2015-11-23 | 2016-03-02 | 四川长虹电器股份有限公司 | Multi-resolution UI (User Interface) adaption scripting development method of Android application |
| CN108363604A (en) * | 2018-02-06 | 2018-08-03 | 四川虹美智能科技有限公司 | A kind of resolution adaptation method, apparatus and operation system |
| CN113961158A (en) * | 2021-09-08 | 2022-01-21 | 北京房江湖科技有限公司 | Cross-platform painting brush synchronization method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104281847B (en) | A kind of reading method, device and equipment | |
| CN103488339B (en) | A kind of generation method of personalized Chinese-character digital ink | |
| CN101763234B (en) | Method and device for simulating various screen resolutions | |
| CN103745456B (en) | A kind of image partition method and device | |
| JP2019528569A5 (en) | ||
| CN104111839A (en) | Absolute positioning method based on canvas | |
| US9865181B2 (en) | Use of style sets to assist a user in digitizing GIS layers | |
| CN102298575A (en) | Method and system for copying and pasting Word file content with format | |
| CN104408754B (en) | A kind of icon synthetic method | |
| US20190012042A1 (en) | Method and device for producing an electronic signed document | |
| CN108550099A (en) | The method and apparatus of watermark in a kind of removal image | |
| CN103793365A (en) | Method for converting SVG image into Visio image | |
| CN106453517A (en) | Configuration file generation method based on freemarker | |
| CN105550256A (en) | Power grid planning oriented automatic diluting method of geographical wiring diagram | |
| CN103093039B (en) | The engineer applied method of traffic route data is extracted from electronic chart | |
| CN101231633A (en) | A typesetting method and device including nested frame objects | |
| CN104537048B (en) | Integral type water supply network digitalized data produces and switch technology method | |
| CN103218074B (en) | Method and the intelligent terminal of touch screen stroke structure is realized at intelligent terminal | |
| CN101383048A (en) | A method and device for creating an object area on a layout | |
| CN103196455B (en) | The display method of road name, device, server and system | |
| CN111104871B (en) | Form region identification model generation method and device and form positioning method and device | |
| CN106649248A (en) | Single-line text alignment method and translated file processing method of DWG file | |
| CN104134005A (en) | Presetting bit deviation computing method | |
| CN103646065A (en) | Object-oriented business report form module establishing method | |
| CN104217204B (en) | A kind of method and system of the number image recognition uneven for density |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20141022 |
|
| RJ01 | Rejection of invention patent application after publication |