[go: up one dir, main page]

CN104111839A - Absolute positioning method based on canvas - Google Patents

Absolute positioning method based on canvas Download PDF

Info

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
Application number
CN201410366178.8A
Other languages
Chinese (zh)
Inventor
余敬龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Nenglong Education Co ltd
Original Assignee
Guangdong Nenglong Education Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Nenglong Education Co ltd filed Critical Guangdong Nenglong Education Co ltd
Priority to CN201410366178.8A priority Critical patent/CN104111839A/en
Publication of CN104111839A publication Critical patent/CN104111839A/en
Pending legal-status Critical Current

Links

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

A kind of absolute fix method based on painting canvas
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)

1.一种基于画布的绝对定位方法,其特征在于包括以下步骤: 1. an absolute positioning method based on canvas, is characterized in that comprising the following steps: A、定义标准参考画布; A. Define the standard reference canvas; B、基于标准参考画布定义的布局,记录对象的定位数据; B. Based on the layout defined by the standard reference canvas, the positioning data of the object is recorded; C、将参考画布和目标画布的映射,确定画布缩放比例; C. Determine the canvas zoom ratio by referring to the mapping between the canvas and the target canvas; D、对象在目标画布按缩放比例缩放后,绘制目标对象。 D. After the object is scaled according to the scaling ratio on the target canvas, draw the target object. 2.根据权利要求1所述的一种基于画布的绝对定位方法,其特征在于:所述步骤A定义的内容为参考画布的规格,该规格为画布的高与宽。 2. a kind of canvas-based absolute positioning method according to claim 1, is characterized in that: the content defined in described step A is the specification of reference canvas, and this specification is the height and width of canvas. 3.根据权利要求2所述的一种基于画布的绝对定位方法,其特征在于:所述步骤B中,对象的定位数据为高与宽。 3. a kind of canvas-based absolute positioning method according to claim 2, is characterized in that: in described step B, the positioning data of object is height and width. 4.根据权利要求3所述的一种基于画布的绝对定位方法,其特征在于:所述参考画布规格与对象定位数据构成参考布局模板文件。 4. a kind of canvas-based absolute positioning method according to claim 3, is characterized in that: described reference canvas specification and object positioning data constitute reference layout template file. 5.根据权利要求4所述的一种基于画布的绝对定位方法,其特征在于:所述步骤C包括以下步骤: 5. a kind of canvas-based absolute positioning method according to claim 4, is characterized in that: described step C comprises the following steps: C1、利用布局模板解析引擎提取布局模板文件; C1. Using the layout template parsing engine to extract the layout template file; C2、确定目标画布的规格,该规格为目标画布的高与宽; C2. Determine the specification of the target canvas, which is the height and width of the target canvas; C3、计算目标画布相对参考画布的缩放比例; C3. Calculate the scaling ratio of the target canvas relative to the reference canvas; C4、计算布局对象在目标画布的定位数据。 C4. Calculate the positioning data of the layout object on the target canvas. 6.根据权利要求5所述的一种基于画布的绝对定位方法,其特征在于:所述C3包括中:宽缩放比 = 目标画布宽度/参考画布宽度;高缩放比 = 目标画布高度/参考画布高度。 6. A kind of absolute positioning method based on canvas according to claim 5, it is characterized in that: described C3 comprises: wide scaling ratio=target canvas width/reference canvas width; High scaling ratio=target canvas height/reference canvas high. 7.根据权利要求6所述的一种基于画布的绝对定位方法,其特征在于:所述C4中:宽度数据 * 宽缩放比 = 目标定位宽度数据;高度数据 * 高缩放比 = 目标定位高度数据。 7. A kind of absolute positioning method based on canvas according to claim 6, it is characterized in that: among described C4: Width data * wide scaling ratio = target positioning width data; Height data * high scaling ratio = target positioning height data . 8.根据权利要求7所述的一种基于画布的绝对定位方法,其特征在于:所述步骤D根据目标定位宽度数据和目标定位高度数据在目标画布内绘制目标对象,构成最终页面布局。 8. a kind of canvas-based absolute positioning method according to claim 7, is characterized in that: described step D draws target object in target canvas according to target positioning width data and target positioning height data, constitutes final page layout.
CN201410366178.8A 2014-07-29 2014-07-29 Absolute positioning method based on canvas Pending CN104111839A (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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