CN106547540A - A kind of method for drafting of text button - Google Patents

A kind of method for drafting of text button Download PDF

Info

Publication number
CN106547540A
CN106547540A CN201610889155.4A CN201610889155A CN106547540A CN 106547540 A CN106547540 A CN 106547540A CN 201610889155 A CN201610889155 A CN 201610889155A CN 106547540 A CN106547540 A CN 106547540A
Authority
CN
China
Prior art keywords
picture
paragraph
drafting
segment
stretch section
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
CN201610889155.4A
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.)
Huizhou Desay SV Automotive Co Ltd
Original Assignee
Huizhou Desay SV Automotive 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 Huizhou Desay SV Automotive Co Ltd filed Critical Huizhou Desay SV Automotive Co Ltd
Priority to CN201610889155.4A priority Critical patent/CN106547540A/en
Publication of CN106547540A publication Critical patent/CN106547540A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of method for drafting of text button, a kind of method for drafting of text button, including:The parameter of the drawing area of text is calculated, including is drawn position and is drawn length;First paragraph picture and second segment picture are drawn at the two ends for drawing length, and according to the spacing of first paragraph picture and second segment picture calculating the length being stretched of stretch section picture, then stretch section picture is drawn, the first paragraph picture, second segment picture and the stretch section picture in the middle of being arranged on first paragraph and second segment constitute a complete key shape.The present invention is by being divided into three parts by the key image of rendering text button, according to text drawing area position and the size of dynamic calculation during operation, the position of three part pictures and the size of required stretching when dynamic calculation is drawn, greatly reduce the background picture needs to text button, text button is reduced to storage area, the requirement to internal memory, the speed of service and stability of system is improved.

Description

A kind of method for drafting of text button
Technical field
The present invention relates to computer realm, more particularly to a kind of method for drafting of text button.
Background technology
The graphic plotting function of vehicle mounted guidance main frame is the embedded OS WinCE using Microsoft, its graphic plotting During method rendering text button, different text sizes need different background picture resources, cause background picture resource many, account for It is big with Flash spaces.If the system page needs the text button of loading more, need to load more picture, cause The problems such as system operation is slack-off, internal memory application failure, onboard system collapse.
The content of the invention
Present invention is primarily targeted at providing a kind of method for drafting of text button, it is intended to change existing text button Drafting mode, reduces the occupancy to system resource when text button is drawn.
For achieving the above object, the present invention provides a kind of method for drafting of text button, comprises the following steps:
The parameter of S01, the drawing area of calculating text, including draw position and draw length;
S02, first paragraph picture and second segment picture are drawn at the two ends for drawing length, and according to first paragraph picture and second segment figure The spacing of piece draws stretch section picture calculating the length being stretched of stretch section picture, then, the first paragraph picture, second Section picture and the stretch section picture in the middle of being arranged on first paragraph and second segment constitute a complete key shape.
Preferably, also include before step S01:
The three-stage picture of loading text button, the three-stage picture include first paragraph picture, second segment picture and stretch section Picture.
Preferably, also include before the three-stage picture of the loading text button:
The graphics drawing program of activation system.
Preferably, step S02 is specifically included:
S21, judge whether first paragraph picture loads successfully;It is, then in four angles of drawing area, to choose angle and draw the One section of picture;
S22, judge whether second segment picture loads successfully;It is, then according to drawing position and drawing length, to calculate second segment picture Position, then draw second segment picture;
S23, judge whether stretch section picture loads successfully;It is, then the position of calculating stretch section picture and the length being stretched, so Stretch section picture is drawn afterwards.
Preferably, left side picture of the first paragraph picture for key shape, the right of second segment picture for key shape Picture, in step S21 in four angles of drawing area, chooses an angle and draws first paragraph picture specially in drafting area Draw first paragraph picture in the upper left corner in domain.
Preferably, the system is WinCE file system.
Preferably, the position for stretch section picture being calculated in step S23 is according to drafting position and first paragraph picture What width calculation was obtained.
Preferably, the length being stretched for stretch section picture being calculated in step S23 is according to drafting length, first paragraph What the width calculation of the width and second segment picture of picture was obtained.
Preferably, the length being stretched for stretch section picture being calculated in step S23 is according to drafting position, first paragraph What the position calculation of the width and second segment picture of picture was obtained.
Preferably, it is further comprising the steps of after step S01:
According to the drawing area of text, rendering text.
The present invention by the key image of rendering text button is divided into three parts, according to operation when dynamic calculation text Drawing area position and size, the position of three part pictures and the size of required stretching when dynamic calculation is drawn, using internal memory In the background picture that loaded, complete the drafting of text button;The method for drafting has clearly logic management level, saves Memory headroom and picture load time, perfect can realize that multiple different sizes press the seamless spliced of the drafting of effect, realize The drafting of text button is completed using minimum memory consumption.
Description of the drawings
Fig. 1 is the schematic flow sheet of the method for drafting first embodiment of text button of the present invention;
Fig. 2 is the schematic flow sheet of the method for drafting second embodiment of text button of the present invention;
Fig. 3 is the schematic flow sheet of the method for drafting 3rd embodiment of text button of the present invention;
The realization of the object of the invention, functional characteristics and advantage will be described further in conjunction with the embodiments referring to the drawings.
Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The present invention provides a kind of method for drafting of text button, with reference to Fig. 1, in the first embodiment, text button Method for drafting includes following order execution step:
The parameter of SA1, the drawing area of calculating text, including draw position and draw length;
SA2, first paragraph picture and second segment picture are drawn at the two ends for drawing length, and according to first paragraph picture and second segment figure The spacing of piece draws stretch section picture calculating the length being stretched of stretch section picture, then, the first paragraph picture, second Section picture and the stretch section picture in the middle of being arranged on first paragraph and second segment constitute a complete key shape.
The present embodiment by the key image of rendering text button is divided into 3 parts, by first paragraph picture and second segment figure Piece keeps not stretching, and adapts to the text button of different field by the stretching of stretch section picture, greatly reduce to text by The background picture of key needs, and reduces text button to storage area, the requirement to internal memory, improves the speed of service of system and steady It is qualitative.
With reference to Fig. 2, in a second embodiment, the method for drafting of text button includes performing lower step with order:
The graphics drawing program of SB1, activation system;
The three-stage picture of SB2, loading text button, the three-stage picture include first paragraph picture, second segment picture and drawing Stretch a section picture;
The parameter of SB3, the drawing area of calculating text, including draw position and draw length;
SB4, first paragraph picture and second segment picture are drawn at the two ends for drawing length, and according to first paragraph picture and second segment figure The spacing of piece draws stretch section picture calculating the length being stretched of stretch section picture, then, the first paragraph picture, second Section picture and the stretch section picture in the middle of being arranged on first paragraph and second segment constitute a complete key shape.
In system first time rendering text button, need to first start graphics drawing program, the three-stage of loading text button Picture is that after which, the text button for drawing same type need not enter again for the drafting speed for accelerating text button Row step SB1 and SB2;When different types of text button is drawn, step SB2 need to be re-started, corresponding three are reloaded Segmentation picture carrys out rendering text button.
With reference to Fig. 3, in the third embodiment, the method for drafting of text button includes performing lower step with order:
The graphics drawing program of SC1, activation system;
The three-stage picture of SC2, loading text button, the three-stage picture include first paragraph picture, second segment picture and drawing Stretch a section picture;
The parameter of SC3, the drawing area of calculating text, including draw position and draw length;
SC4, judge whether first paragraph picture loads successfully;It is, then in four angles of drawing area, to choose angle and draw the One section of picture;
SC5, judge whether second segment picture loads successfully;It is, then according to drawing position and drawing length, to calculate second segment picture Position, then draw second segment picture;
SC6, judge whether stretch section picture loads successfully;It is, then the position of calculating stretch section picture and the length being stretched, so Stretch section picture is drawn afterwards.
The graphic plotting at button two ends out, is redrawn the figure in the middle of button, is made by the first drawing area according to text Middle figure is seamlessly connected with the figure of both sides, completes the drafting of a button.If the loading of first paragraph picture is unsuccessful, can Directly carrying out next step, judging whether second segment picture loads successfully, or return to the step of Loading Image, again plus Picture is carried, or returns fail values etc..When second segment picture and unsuccessful stretch section picture loading, with reference to first paragraph picture Processing mode, picture load unsuccessful processing mode and are not limited to above-mentioned several ways, and existing processing mode should all include.
In the fourth embodiment, the method for drafting of text button includes performing lower step with order:
The graphics drawing program of SD1, activation system;
The three-stage picture of SD2, loading text button, the three-stage picture include left section of picture, right section of picture and stretch section Picture;
The parameter of SD3, the drawing area of calculating text, including draw position and draw length;
SD4, judge whether left section of picture loads successfully;It is then to draw left section of picture in the upper left corner of drawing area;
SD5, judge whether right section of picture loads successfully;It is, then according to drawing position and drawing length, to calculate the position of right section of picture Put, then draw right section of picture;
SD6, judge whether stretch section picture loads successfully;It is, then the position of calculating stretch section picture and the length being stretched, so Stretch section picture is drawn afterwards.
The method for drafting of the present embodiment is applied to the text button that length is not waited in the horizontal direction, now stretch section picture With according to needs, having different degrees of stretching in the horizontal direction;The method can also be in the left side of drawing area or lower-left in addition Draw left section of picture in angle;In the same manner, it is also possible to first first draw right section of picture on the right of drawing area, then to draw left section of picture. Picture loads unsuccessful processing mode and refers to 3rd embodiment.
In the 5th embodiment, the method for drafting of text button includes performing lower step with order:
The graphics drawing program of SE1, activation system;
The three-stage picture of SE2, loading text button, the three-stage picture include epimere picture, hypomere picture and stretch section Picture;
The parameter of SE3, the drawing area of calculating text, including draw position and draw length;
SE4, judge whether epimere picture loads successfully;It is then to draw epimere picture in the upper left corner of drawing area;
SE5, judge whether hypomere picture loads successfully;It is, then according to drawing position and drawing length, to calculate the position of hypomere picture Put, then draw hypomere picture;
SE6, judge whether stretch section picture loads successfully;It is, then the position of calculating stretch section picture and the length being stretched, so Stretch section picture is drawn afterwards.
The method for drafting of the present embodiment is applied to the text button that in the vertical direction length is not waited, now stretch section picture With according to needs, in the vertical direction has different degrees of stretching;The method can also be in the top of drawing area or upper right in addition Draw epimere picture in angle;In the same manner, it is also possible to first first draw hypomere picture in the following of drawing area, then to draw epimere picture. Picture loads unsuccessful processing mode and refers to 3rd embodiment.
In above-described embodiment, also include step after the parameter of drawing area of text is calculated:According to the drawing area of text, Rendering text.
Above-mentioned three-stage picture is not to represent there was only three pictures, but is divided into three sections by the change of picture, is actually made With in, first paragraph picture and second segment picture are probably symmetrical situation, during loading, for the data source loading of this section is twice Can;Said system is WinCE file system;The position of stretch section picture can be according to the width gauge for drawing position and first paragraph picture Calculate and obtain;The length being stretched of stretch section picture can be according to drafting length, the width of first paragraph picture and second segment picture Width calculation, or according to draw position, the width of first paragraph picture and second segment picture position calculation out.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using this Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of method for drafting of text button, comprises the following steps:
The parameter of S01, the drawing area of calculating text, including draw position and draw length;
S02, first paragraph picture and second segment picture are drawn at the two ends for drawing length, and according to first paragraph picture and second segment figure The spacing of piece draws stretch section picture calculating the length being stretched of stretch section picture, then, the first paragraph picture, second Section picture and the stretch section picture in the middle of being arranged on first paragraph and second segment constitute a complete key shape.
2. method for drafting as claimed in claim 1, it is characterised in that also include before step S01:
The three-stage picture of loading text button, the three-stage picture include first paragraph picture, second segment picture and stretch section Picture.
3. method for drafting as claimed in claim 2, it is characterised in that before the three-stage picture of the loading text button also Including:
The graphics drawing program of activation system.
4. the method for drafting as described in any one of claim 1-3, it is characterised in that step S02 is specifically included:
S21, judge whether first paragraph picture loads successfully;It is, then in four angles of drawing area, to choose angle and draw the One section of picture;
S22, judge whether second segment picture loads successfully;It is, then according to drawing position and drawing length, to calculate second segment picture Position, then draw second segment picture;
S23, judge whether stretch section picture loads successfully;It is, then the position of calculating stretch section picture and the length being stretched, so Stretch section picture is drawn afterwards.
5. method for drafting as claimed in claim 4, it is characterised in that left side figure of the first paragraph picture for key shape Piece, the right picture of the second segment picture for key shape, in step S21 in four angles of drawing area, choose one Draw first paragraph picture and be specially the upper left corner drafting first paragraph picture in drawing area in angle.
6. method for drafting as claimed in claim 1, it is characterised in that the system is WinCE file system.
7. method for drafting as claimed in claim 4, it is characterised in that the position of stretch section picture is calculated in step S23 It is to be obtained according to the width calculation for drawing position and first paragraph picture.
8. method for drafting as claimed in claim 4, it is characterised in that being drawn for stretch section picture is calculated in step S23 The length stretched is to be obtained according to the width calculation for drawing length, the width of first paragraph picture and second segment picture.
9. method for drafting as claimed in claim 4, it is characterised in that being drawn for stretch section picture is calculated in step S23 The length stretched is to be obtained according to the position calculation for drawing position, the width of first paragraph picture and second segment picture.
10. the method for drafting as described in any one of claim 1-9, it is characterised in that also include after step S01 following Step:
According to the drawing area of text, rendering text.
CN201610889155.4A 2016-10-12 2016-10-12 A kind of method for drafting of text button Pending CN106547540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610889155.4A CN106547540A (en) 2016-10-12 2016-10-12 A kind of method for drafting of text button

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610889155.4A CN106547540A (en) 2016-10-12 2016-10-12 A kind of method for drafting of text button

Publications (1)

Publication Number Publication Date
CN106547540A true CN106547540A (en) 2017-03-29

Family

ID=58368696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610889155.4A Pending CN106547540A (en) 2016-10-12 2016-10-12 A kind of method for drafting of text button

Country Status (1)

Country Link
CN (1) CN106547540A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492205A (en) * 2018-09-12 2019-03-19 广州优视网络科技有限公司 The dynamic drafting method and device of text calculate equipment and readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902535A (en) * 2012-09-18 2013-01-30 深圳市融创天下科技股份有限公司 Picture self-adaption method, system and terminal equipment
CN104123363A (en) * 2014-07-21 2014-10-29 北京奇虎科技有限公司 Method and device for extracting main image of webpage
CN105321192A (en) * 2014-07-31 2016-02-10 惠州市德赛西威汽车电子股份有限公司 Drawing method of variable length and width background of vehicle-mounted entertainment system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902535A (en) * 2012-09-18 2013-01-30 深圳市融创天下科技股份有限公司 Picture self-adaption method, system and terminal equipment
CN104123363A (en) * 2014-07-21 2014-10-29 北京奇虎科技有限公司 Method and device for extracting main image of webpage
CN105321192A (en) * 2014-07-31 2016-02-10 惠州市德赛西威汽车电子股份有限公司 Drawing method of variable length and width background of vehicle-mounted entertainment system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492205A (en) * 2018-09-12 2019-03-19 广州优视网络科技有限公司 The dynamic drafting method and device of text calculate equipment and readable medium
CN109492205B (en) * 2018-09-12 2023-10-10 阿里巴巴(中国)有限公司 Dynamic text drawing method and device, computing equipment and readable medium

Similar Documents

Publication Publication Date Title
JP2017016686A5 (en)
CN111258575B (en) Page layout processing method and device
JP2019507915A5 (en)
RU2579899C1 (en) Document processing using multiple processing flows
WO2020211021A1 (en) Image processing method and device, data transmission method and device, and storage medium
CN106611401B (en) Method and device for storing image in texture memory
JP4568750B2 (en) Drawing apparatus, drawing program, and drawing method
JP2007264988A (en) Graphic drawing device, graphic drawing method, and program
CN106547540A (en) A kind of method for drafting of text button
CN103970445A (en) Display interface mobile type screenshot method, system and device
CN104391896A (en) Plane printed product typesetting method and system based on webpage
JP6171591B2 (en) Image processing apparatus and image processing method
US9202148B2 (en) Image processing apparatus and method for generating stencil data of a stroke based on shape information, connection-point information, and end-point information
US20140152700A1 (en) Method, apparatus and system for determining a merged intermediate representation of a page
DE602004030159D1 (en) ITERATIVE SOLUTION OF SIDE TERMS IN A FONT HINTING LANGUAGE
US9767392B2 (en) Method and system for rendering rectangle drawing objects using one-line raster image data
JP5889401B2 (en) Character drawing apparatus and character drawing method
US20130235057A1 (en) Area-based dependency chain analysis of shaders and command stream
JP2011210160A5 (en) Image processing method, image processing apparatus, and program
US11288778B2 (en) Creation and rasterization of shapes using geometry, style settings, or location
CN101930615A (en) Method and system for regulating bleeding line of pasteup object
US20150288845A1 (en) Image reading apparatus, image reading method, and storage medium
CN105321192B (en) A kind of method for drafting of vehicle entertainment system variable-length and the background of width
CN101923724B (en) Page cutting method
CN103034968A (en) Method for clipping two-dimensional vector graphs

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170329