CN106126140B - A kind of method, apparatus and electronic equipment of rendering type - Google Patents

A kind of method, apparatus and electronic equipment of rendering type Download PDF

Info

Publication number
CN106126140B
CN106126140B CN201610431008.2A CN201610431008A CN106126140B CN 106126140 B CN106126140 B CN 106126140B CN 201610431008 A CN201610431008 A CN 201610431008A CN 106126140 B CN106126140 B CN 106126140B
Authority
CN
China
Prior art keywords
pixel
color
value
rendering
text
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.)
Active
Application number
CN201610431008.2A
Other languages
Chinese (zh)
Other versions
CN106126140A (en
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.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Zhuhai Seal Interest Technology 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 Zhuhai Seal Interest Technology Co Ltd filed Critical Zhuhai Seal Interest Technology Co Ltd
Priority to CN201610431008.2A priority Critical patent/CN106126140B/en
Publication of CN106126140A publication Critical patent/CN106126140A/en
Application granted granted Critical
Publication of CN106126140B publication Critical patent/CN106126140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the present invention discloses the method, apparatus and electronic equipment of a kind of rendering type, is related to information display technique, is able to ascend the rendering effect of text shown in forms, improves the identification degree of text.The described method includes: one blank device independent bit of creation, draws text to be rendered in the blank device independent bit of creation, obtains character bitmap;Obtain the color average of the character bitmap;According to the color average and the color current value of the character bitmap, the color rendering value of the text to be rendered is calculated;The transparency of the text to be rendered is set according to the color average;Using the transparency and the color rendering value of the text to be rendered, the text to be rendered is rendered.The present invention transparent form suitable for showing text.

Description

A kind of method, apparatus and electronic equipment of rendering type
Technical field
The present invention relates to the method, apparatus and electronic equipment of information display technique more particularly to a kind of rendering type.
Background technique
With computer communication and the continuous development of Internet technology, electronic equipment, for example, intelligent mobile phone, a The application such as personal digital assistant, palm PC, laptop is more and more extensive.The content for needing to present on electronic curtain is also got over Come it is abundanter, for example, each application program (APP, the Application) icon, text, setting installed in electronic equipment is presented Prompt information text and note etc. greatly meet the individual demand of different user.
Currently, be presented on the text in electronic equipment screen (forms), generally using graphical device interface (GDI, Graphics Device Interface) or GDI+ drawn, after the drafting for completing text, operating system is according to text The background color of place forms renders the color at the text edge drawn GDI, then, will be in by the text of rendering Present forms.Wherein, GDI is responsible for the information exchange between operating system and drawing application program, handles all drawing applications The images outputting of program, under Windows operating system, user can use the correlation function of GDI offer, easily shield The operation such as output pattern and text (text) on curtain, printer and other output equipments.
But the method for the rendering type, since the text drawn by GDI is device-dependent, so that operating system exists When rendering to the edge for the text drawn by GDI function, the color for the text being rendered is needed according to window where text The background color of body (region) is calculated.In this way, the color for being rendered text may be with the back of forms where the text Scape color is same or similar seemingly, causes the text presented in forms more fuzzy, is not easy to recognize, rendering effect is poor.For example, Transparent form, forms background color be white in the case of, if draw text color be white, pass through operating system Rendering, the color at text edge is rendered into color similar with the white background color of forms, so that the text is transparent Under forms, font more obscures, is not easy to recognize, reduces the application experience that user browses forms.
Summary of the invention
In view of this, the embodiment of the present invention provides the method, apparatus and electronic equipment of a kind of rendering type, it is able to ascend window The rendering effect of text shown in body, improves the identification degree of text, is rendered text in the method for solving existing rendering type The color of word and the background color of forms are same or similar seemingly, cause the text presented in forms to be not easy to recognize, rendering effect The problem of difference.
In a first aspect, the embodiment of the present invention provides a kind of method of rendering type, comprising:
A blank device independent bit is created, draws text to be rendered in the blank device independent bit of creation, Obtain character bitmap;
Obtain the color average of the character bitmap;
According to the color average and the color current value of the character bitmap, the face of the text to be rendered is calculated Color rendering value;
The transparency of the text to be rendered is set according to the color average;
Using the transparency and the color rendering value of the text to be rendered, wash with watercolours is carried out to the text to be rendered Dye.
With reference to first aspect, in the first embodiment of first aspect, the color for obtaining the character bitmap Average value includes:
Obtain the pixel line number and pixel columns that the character bitmap includes;
Each pixel that the character bitmap includes is traversed, the pixel value of each pixel is extracted and is carried out tired Add;
Cumulative pixel value and value and pixel sum ratio is calculated, the color for obtaining the character bitmap is average Value, wherein the pixel sum is the product of the pixel line number and the pixel columns.
The first embodiment with reference to first aspect utilizes following formula meter in second of embodiment of first aspect Calculate the color average:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
With reference to first aspect, the first or second of embodiment of first aspect, in the third implementation of first aspect It is described according to the color average and the color current value of the character bitmap in mode, calculate the text to be rendered Color rendering value include:
Choose the pixel in the character bitmap, obtain respectively the pixel of selection current red color pixel value, Current green colored pixel value and current blue color pixel values;
Successively by the current red color pixel value and the color average, the current green colored pixel value with it is described Color average, and, the current blue color pixel values and the color average are applied to pre-set color rendering Formula obtains the corresponding red color pixel rendering value, green colored pixel rendering value and blue colored pixels of the text to be rendered Rendering value.
With reference to first aspect, the first or second of embodiment of first aspect, in the 4th kind of implementation of first aspect In mode, the color rendering value is calculated using following formula:
In formula,
ThisClkiFor the color rendering value of the i-th primary colors of pixel of the l row k column in character bitmap;
IV is pre-set constant.
With reference to first aspect, the first or second of embodiment of first aspect, in the 5th kind of implementation of first aspect In mode, the method also includes:
The text to be rendered after rendering is presented in forms.
Second aspect, the embodiment of the present invention provide a kind of device of rendering type, comprising: device independent bit creates mould Block, color obtain module, rendering value computing module, transparency setup module and rendering module, wherein
Device independent bit creation module, for creating a blank device independent bit, in the blank equipment of creation Text to be rendered is drawn in unrelated bitmap, obtains character bitmap;
Color obtains module, for obtaining the color average of the character bitmap;
Rendering value computing module, for the color current value according to the color average and the character bitmap, meter Calculate the color rendering value of the text to be rendered;
Transparency setup module, for the transparency of the text to be rendered to be arranged according to the color average;
Rendering module, for the transparency and the color rendering value using the text to be rendered, to described to wash with watercolours Dye text is rendered.
In conjunction with second aspect, in the first embodiment of second aspect, it includes: pixel number that the color, which obtains module, Acquiring unit, Traversal Unit and color average computing unit, wherein
Pixel number acquiring unit, for obtaining the pixel line number and pixel columns that the character bitmap includes;
Traversal Unit, each pixel for including for traversing the character bitmap extract each pixel Pixel value simultaneously adds up;
Color average computing unit is obtained for calculating cumulative pixel value and value and pixel sum ratio The color average of the character bitmap, wherein the pixel sum is the pixel line number and the pixel columns Product.
Following formula meter is utilized in second of embodiment of second aspect in conjunction with the first embodiment of second aspect Calculate the color average:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
In conjunction with the first or second of embodiment of second aspect, second aspect, in the third implementation of second aspect In mode, the rendering value computing module includes: pixel value acquiring unit and rendering value computing unit, wherein
Pixel value acquiring unit obtains the pixel of selection for choosing the pixel in the character bitmap respectively Current red color pixel value, current green colored pixel value and current blue color pixel values;
Rendering value computing unit, for successively by the current red color pixel value and the color average, described work as Preceding green colored pixel value and the color average, and, the current blue color pixel values and the color average application In pre-set color rendering formula, corresponding red color pixel rendering value, the green colored pixel of the text to be rendered are obtained Rendering value and blue colored pixels rendering value.
Following public affairs are utilized in the 5th kind of embodiment of second aspect in conjunction with the 4th kind of embodiment of second aspect Formula calculates the color rendering value:
In formula,
ThisClkiFor the color rendering value of the i-th primary colors of pixel of the l row k column in character bitmap;
IV is pre-set constant.
In conjunction with the first or second of embodiment of second aspect, second aspect, in the 6th kind of implementation of second aspect In mode, described device further include:
Module is presented, for the text to be rendered after rendering to be presented in forms.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes: shell, processor, deposits Reservoir, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, processor and memory setting On circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing and can hold Line program code;Processor is run and executable program code pair by reading the executable program code stored in memory The program answered, the method for executing aforementioned any rendering type.
The method, apparatus and electronic equipment of a kind of rendering type provided in an embodiment of the present invention are set by creating a blank Standby unrelated bitmap, draws text to be rendered in the blank device independent bit of creation, obtains character bitmap;Described in acquisition The color average of character bitmap;According to the color average and the color current value of the character bitmap, described in calculating The color rendering value of text to be rendered;The transparency of the text to be rendered is set according to the color average;Using described The transparency of text to be rendered and the color rendering value, render the text to be rendered, are able to ascend in forms The rendering effect of the text of displaying, improves the identification degree of text, is rendered text in the method for solving existing rendering type Color is same or similar with the background color of forms seemingly, and the text presented in forms is caused to be not easy to recognize, rendering effect difference Problem.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the method flow schematic diagram of one rendering type of the embodiment of the present invention;
Fig. 2 is the method flow schematic diagram of two rendering type of the embodiment of the present invention;
Fig. 3 is the apparatus structure schematic diagram of three rendering type of the embodiment of the present invention;
Fig. 4 is the structural schematic diagram of electronic equipment one embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its Its embodiment, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is the method flow schematic diagram of one rendering type of the embodiment of the present invention, as shown in Figure 1, the side of the present embodiment Method may include:
Step 101, a blank device independent bit is created, is drawn in the blank device independent bit of creation to wash with watercolours Text is contaminated, character bitmap is obtained;
In the present embodiment, it is contemplated that draw text using GDI or GDI+, the color of the text of drafting is related to equipment, example Such as, to present the background color of forms of the text it is related so that operating system the text edge that GDI is drawn color into After row rendering, the color for being rendered text may be same or similar seemingly with the background color of forms where the text, causes in window The text presented in body is more fuzzy, is not easy to recognize.Thus, in the present embodiment, consider using color mode with it is device-independent Device independent bit (DIB, Device Independent Bitmap) carry out Word-Drawing, wherein the color mode of DIB with Equipment is unrelated, possesses corresponding color table, the color of pixel is independently of equipment palette.It, both can be with for example, the DIB of one 256 colors It uses, can also be used under 16 color patterns under true color display pattern.In practical application, since DIB is independent of specific Equipment can be used for permanently saving image.
In the present embodiment, as an alternative embodiment, device independent bit is the picture of bitmap format, for example.bmp schemes Piece.In .bmp picture, image is made of point (pixel), and every bit or pixel can be indicated by multiple color, for example, point or pixel Corresponding color may include 2,4,8,16,24 and 32 colors (color).
In the present embodiment, according to the pattern for the text for needing to present, the corresponding size of blank device independent bit is set, and In blank device independent bit, calls correlation function to draw (input) text to be rendered, the font of text to be rendered is set Attribute, for example, font type, font style, font color and font size, wherein
Font type includes but is not limited to: the Song typeface, imitation Song-Dynasty-Style typeface, regular script, lishu, young circle etc..
Font style includes but is not limited to: normal, italic, overstriking, bold Italic, underscore and strikethrough etc..
Font color includes but is not limited to: red, yellow, blue, orange, black etc..
Font size is for characterizing the corresponding character height of text, including but not limited to: character height, character pitch, right Neat mode, line space etc..
Step 102, the color average of the character bitmap is obtained;
In the present embodiment, as an alternative embodiment, the color average for obtaining the character bitmap includes:
A11 obtains pixel line number and pixel columns that the character bitmap includes;
In the present embodiment, character bitmap is made of pixel, for example, for the character bitmap of a 1024x768, packet The pixel line number contained is 1024 rows, and the pixel columns for including is 768 column.Each pixel can use 2,4,8,16,24 Or one of 32 colors.
A12 traverses each pixel that the character bitmap includes, and the pixel value for extracting each pixel is gone forward side by side Row is cumulative;
In the present embodiment, sequentially each pixel in reading characters bitmap will after the pixel value for extracting the pixel The pixel value of extraction is added with the pixel value of storage, and the pixel value stored with the replacement of obtained pixel value is added, judges the picture Whether vegetarian refreshments is last column pixel of last line in character bitmap, if so, terminating the process of traversal pixel;If It is not that next pixel is read in the way of Column Row.
In the present embodiment, as an alternative embodiment, pixel value is tristimulus values, comprising: red color pixel value (R value), Green colored pixel value (G value) and blue color pixel values (B value).
A13 calculates cumulative pixel value and value and pixel sum ratio, and the color for obtaining the character bitmap is flat Mean value, wherein the pixel sum is the product of the pixel line number and the pixel columns.
In the present embodiment, color average is that red color average pixel value, green color average pixel value and blue color are flat The average value of equal pixel value.
As an alternative embodiment, color average is calculated using following formula:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
In the present embodiment, as an alternative embodiment, pixel value (color) is three primary colors, then n=3.It, can in practical application When i=1 is arranged, ThisAiFor red color average pixel value;When i=2, ThisAiFor green color average pixel value;When i=3, ThisAiFor blue color average pixel value.
Step 103, it according to the color average and the color current value of the character bitmap, calculates described to be rendered The color rendering value of text;
In the present embodiment, color rendering value includes: red color pixel rendering value, green colored pixel rendering value and blue color Pixel rendering value, the corresponding red color pixel rendering value of each pixel, green colored pixel rendering value and blue colored pixels wash with watercolours Dye value.
It is described according to the color average and the color current value of the character bitmap as an alternative embodiment, The color rendering value for calculating the text to be rendered includes:
B21 chooses the pixel in the character bitmap, obtains current beauty's color pixel of the pixel of selection respectively Value, current green colored pixel value and current blue color pixel values;
B22, successively by the current red color pixel value and the color average, the current green colored pixel value with The color average, and, the current blue color pixel values and the color average are applied to pre-set color Formula is rendered, the corresponding red color pixel rendering value, green colored pixel rendering value and blue color of the text to be rendered are obtained Pixel rendering value.
In the present embodiment, as an alternative embodiment, color rendering value is calculated using following color rendering formula:
In formula,
ThisClkiFor the color rendering value of the i-th primary colors of pixel of the l row k column in character bitmap;
IV is pre-set constant.
In the present embodiment, the current red color pixel value of the pixel of selection is Ylki, as an alternative embodiment, IV The index times that value is 2, for example, for include 8 colors pixel, can be set IV=256.
Step 104, the transparency of the text to be rendered is set according to the color average;
In the present embodiment, as an alternative embodiment, the transparency that the text to be rendered can be set is equal to the face Color average value.Certainly, in practical application, the transparency that the text to be rendered also can be set is and the color average phase Associated other values, the embodiment of the present invention are not construed as limiting this.
In the present embodiment, the program code segments for calculating color average and color rendering value are as follows:
In above procedure code segment, Y indicates that the column coordinate of pixel, X indicate the row coordinate of pixel, BMIH.biHeight is Bitmap Height, that is, the pixel columns for including, BMIH.biWidth is bitmap width, that is, the picture for including Vegetarian refreshments line number, * DataPtr are red color average pixel value, and * (DataPtr+1) is green color average pixel value, * (DataPtr+ It 2) is blue color average pixel value, * DataPtr++=(FillB*ThisA) > > 8 is blue colored pixels rendering value, * DataPtr++=(FillG*ThisA) > > 8 is green colored pixel rendering value, * DataPtr++=(FillR*ThisA) > > 8 be red color pixel rendering value, and * DataPtr++=ThisA is the transparency of the text to be rendered.
Step 105, using the transparency of the text to be rendered and the color rendering value, to the text to be rendered It is rendered.
It, can be by the transparency and color wash with watercolours of obtained text to be rendered as an alternative embodiment in the present embodiment Dye value replacement operation system is in the corresponding color value for carrying out text rendering, to render to text;It is also possible to call behaviour The transparency of obtained text to be rendered and color rendering value are set operating system wash with watercolours by the method for making system rendering type Corresponding parametric values when dye.
About transparency and color rendering value is utilized, text is carried out to be rendered into well-known technique, detailed description is omitted here.
The method of one rendering type of the embodiment of the present invention, by creating a blank device independent bit, in the institute of creation It states and draws text to be rendered in blank device independent bit, obtain character bitmap;Obtain the color average of the character bitmap; According to the color average and the color current value of the character bitmap, the color rendering of the text to be rendered is calculated Value;The transparency of the text to be rendered is set according to the color average;Using the transparency of the text to be rendered with And the color rendering value, the text to be rendered is rendered.In this way, being drawn by the method for creation device independent bit Text, since the word attribute drawn by device independent bit is unrelated with equipment, thus, it is possible to control each pixel in text The rendering of point color, no matter so that the text shown in forms can be kept under the window background color of which kind of operating system Consistent visual effect, rendering effect is good, and the text for avoiding presentation is more fuzzy, is not easy the technical issues of recognizing, text is clear It is clear, be easy to user identification, thus effectively promoted user experience.Especially for the text being presented in transparent form, can make Text on transparent form shows same effect under different background colors, allows user can be in different desktop background colors It is lower to obtain consistent experience.
Embodiment two
Fig. 2 is the method flow schematic diagram of two rendering type of the embodiment of the present invention, as shown in Fig. 2, the side of the present embodiment Method may include:
Step 201, a blank device independent bit is created, is drawn in the blank device independent bit of creation to wash with watercolours Text is contaminated, character bitmap is obtained;
In the present embodiment, the process of step 201 is similar with the step 101 of above method embodiment one respectively, herein no longer It repeats.
Step 202, the character bitmap is compressed using run length encoding algorithm, stores the text of compression Bitmap;
In the present embodiment, character bitmap can be stored, can directly be obtained from memory block in subsequent need Take the character bitmap.As an alternative embodiment, can be calculated using run length encoding (RLE, Run Length Encoding) Method compresses character bitmap.
Step 203, the color average of the character bitmap is obtained;
Step 204, it according to the color average and the color current value of the character bitmap, calculates described to be rendered The color rendering value of text;
Step 205, the transparency of the text to be rendered is set according to the color average;
Step 206, using the transparency of the text to be rendered and the color rendering value, to the text to be rendered It is rendered;
In the present embodiment, the process of step 203 to step 206 respectively with the step 102 of above method embodiment one to step Rapid 105 is similar, and details are not described herein again.
Step 207, the text to be rendered after rendering is presented in forms.
The method of two rendering type of the embodiment of the present invention is presented after the text to be rendered after rendering is presented on forms Text same effect is shown under different background colors, family can be used and obtain consistent application experience.
Embodiment three
Fig. 3 is the apparatus structure schematic diagram of three rendering type of the embodiment of the present invention, as shown in figure 3, the dress of the present embodiment Set may include: device independent bit creation module 31, color acquisition module 32, rendering value computing module 33, transparency setting Module 34 and rendering module 35, wherein
Device independent bit creation module 31 is set for creating a blank device independent bit in the blank of creation Text to be rendered is drawn in standby unrelated bitmap, obtains character bitmap;
In the present embodiment, Word-Drawing is carried out using color mode and device-independent device independent bit.
In the present embodiment, according to the pattern for the text for needing to present, the corresponding size of blank device independent bit is set, and In blank device independent bit, calls correlation function to draw (input) text to be rendered, the font of text to be rendered is set Attribute, for example, font type, font style, font color and font size.
Color obtains module 32, for obtaining the color average of the character bitmap;
In the present embodiment, as an alternative embodiment, it includes: pixel number acquiring unit, traversal list that color, which obtains module 32, Member and color average computing unit (not shown), wherein
Pixel number acquiring unit, for obtaining the pixel line number and pixel columns that the character bitmap includes;
In the present embodiment, character bitmap is made of pixel.
In the present embodiment, as an alternative embodiment, pixel value is tristimulus values, comprising: red color pixel value (R value), Green colored pixel value (G value) and blue color pixel values (B value).
Traversal Unit, each pixel for including for traversing the character bitmap extract each pixel Pixel value simultaneously adds up;
Color average computing unit is obtained for calculating cumulative pixel value and value and pixel sum ratio The color average of the character bitmap, wherein the pixel sum is the pixel line number and the pixel columns Product.
In the present embodiment, color average includes: red color average pixel value, green color average pixel value and blue color The average value of average pixel value.
In the embodiment of the present invention, as an alternative embodiment, the color average is calculated using following formula:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
Rendering value computing module 33, for the color current value according to the color average and the character bitmap, Calculate the color rendering value of the text to be rendered;
In the present embodiment, color rendering value includes: red color pixel rendering value, green colored pixel rendering value and blue color Pixel rendering value, the corresponding red color pixel rendering value of each pixel, green colored pixel rendering value and blue colored pixels wash with watercolours Dye value.
In the present embodiment, as an alternative embodiment, rendering value computing module 33 includes: pixel value acquiring unit and wash with watercolours Dye value computing unit (not shown), wherein
Pixel value acquiring unit obtains the pixel of selection for choosing the pixel in the character bitmap respectively Current red color pixel value, current green colored pixel value and current blue color pixel values;
Rendering value computing unit, for successively by the current red color pixel value and the color average, described work as Preceding green colored pixel value and the color average, and, the current blue color pixel values and the color average application In pre-set color rendering formula, corresponding red color pixel rendering value, the green colored pixel of the text to be rendered are obtained Rendering value and blue colored pixels rendering value.
In the present embodiment, as an alternative embodiment, the color rendering value is calculated using following formula:
In formula,
ThisClkiFor the color rendering value of the i-th primary colors of pixel of the l row k column in character bitmap;
IV is pre-set constant.
Transparency setup module 34, for the transparency of the text to be rendered to be arranged according to the color average;
In the present embodiment, as an alternative embodiment, the transparency that the text to be rendered can be set is equal to the face Color average value.Certainly, in practical application, the transparency that the text to be rendered also can be set is and the color average phase Associated other values.
Rendering module 35, for using the text to be rendered transparency and the color rendering value, to it is described to Rendering type is rendered.
It, can be by the transparency and color wash with watercolours of obtained text to be rendered as an alternative embodiment in the present embodiment Dye value replacement operation system is in the corresponding color value for carrying out text rendering, to render to text;It is also possible to call behaviour The transparency of obtained text to be rendered and color rendering value are set operating system wash with watercolours by the method for making system rendering type Corresponding parametric values when dye.
In the present embodiment, as an alternative embodiment, the device further include:
Module 36 is presented, for the text to be rendered after rendering to be presented in forms.
In the present embodiment, as yet another alternative embodiment, the device further include:
Compression module 37 stores compression for compressing using run length encoding algorithm to the character bitmap The character bitmap.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 1 and Fig. 2, realize former Reason is similar with technical effect, and details are not described herein again.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that There is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.
For Installation practice, since it is substantially similar to the method embodiment, so the comparison of description is simple Single, the relevent part can refer to the partial explaination of embodiments of method.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.
In the above-described embodiment, multiple steps or method can be with storages in memory and by suitable instruction execution The software or firmware that system executes are realized.For example, in another embodiment, can be used if realized with hardware Any one of following technology well known in the art or their combination are realized: being had for realizing logic function to data-signal The discrete logic of the logic gates of energy, the specific integrated circuit with suitable combinational logic gate circuit, programmable gate Array (PGA), field programmable gate array (FPGA) etc..
The embodiment of the present invention also provides a kind of electronic equipment, and the electronic equipment includes dress described in aforementioned any embodiment It sets.
Fig. 4 is the structural schematic diagram of electronic equipment one embodiment of the present invention, may be implemented to implement shown in Fig. 1-3 of the present invention The process of example, as shown in figure 4, above-mentioned electronic equipment may include: shell 41, processor 42, memory 43, circuit board 44 and electricity Source circuit 45, wherein circuit board 44 is placed in the space interior that shell 41 surrounds, and processor 42 and memory 43 are arranged in circuit On plate 44;Power circuit 45, for each circuit or the device power supply for above-mentioned electronic equipment;Memory 43 is for storing and can hold Line program code;Processor 42 is run and executable program generation by reading the executable program code stored in memory 43 The corresponding program of code, the method for executing rendering type described in aforementioned any embodiment.
Processor 42 to the specific implementation procedures of above-mentioned steps and processor 42 by operation executable program code come The step of further executing may refer to the description of Fig. 1-3 illustrated embodiment of the present invention, and details are not described herein.
The electronic equipment exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio, Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic equipments with data interaction function.
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
For convenience of description, description apparatus above is to be divided into various units/modules with function to describe respectively.Certainly, exist Implement to realize each unit/module function in the same or multiple software and or hardware when the present invention.
As seen through the above description of the embodiments, those skilled in the art can be understood that this
Invention can be realized by means of software and necessary general hardware platform.Based on this understanding, of the invention Technical solution substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should Computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions use so that One computer equipment (can be personal computer, server or the network equipment etc.) execute each embodiment of the present invention or Method described in certain parts of person's embodiment.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (9)

1. a kind of method of rendering type characterized by comprising
A blank device independent bit is created, text to be rendered is drawn in the blank device independent bit of creation, obtains Character bitmap;
Obtain the color average of the character bitmap;
According to the color average and the color current value of the character bitmap, the color wash with watercolours of the text to be rendered is calculated Dye value;
The transparency of the text to be rendered is set according to the color average;
Using the transparency and the color rendering value of the text to be rendered, the text to be rendered is rendered;
The color average for obtaining the character bitmap includes:
Obtain the pixel line number and pixel columns that the character bitmap includes;
Each pixel that the character bitmap includes is traversed, the pixel value of each pixel is extracted and is added up;
Cumulative pixel value and value and pixel sum ratio is calculated, the color average of the character bitmap is obtained, In, the pixel sum is the product of the pixel line number and the pixel columns;
It is described according to the color average and the color current value of the character bitmap, calculate the face of the text to be rendered Color rendering value includes:
The pixel in the character bitmap is chosen, obtains the current red color pixel value, current of the pixel of selection respectively Green colored pixel value and current blue color pixel values;
Successively by the current red color pixel value and the color average, the current green colored pixel value and the color Average value, and, the current blue color pixel values and the color average are applied to pre-set color rendering formula, Obtain the corresponding red color pixel rendering value, green colored pixel rendering value and blue colored pixels rendering of the text to be rendered Value.
2. the method for rendering type according to claim 1, which is characterized in that it is average to calculate the color using following formula Value:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
3. the method for rendering type according to claim 1, which is characterized in that calculate the color wash with watercolours using following formula Dye value:
In formula,
ThisClkiFor the color rendering value of the i-th primary colors of pixel of the l row k column in character bitmap;
IV is pre-set constant.
4. the method for rendering type according to any one of claims 1 to 3, which is characterized in that the method also includes:
The text to be rendered after rendering is presented in forms.
5. a kind of device of rendering type characterized by comprising device independent bit creation module, color obtain module, wash with watercolours Dye value computing module, transparency setup module and rendering module, wherein
Device independent bit creation module, it is unrelated in the blank equipment of creation for creating a blank device independent bit Text to be rendered is drawn in bitmap, obtains character bitmap;
Color obtains module, for obtaining the color average of the character bitmap;
Rendering value computing module calculates institute for the color current value according to the color average and the character bitmap State the color rendering value of text to be rendered;
Transparency setup module, for the transparency of the text to be rendered to be arranged according to the color average;
Rendering module, for the transparency and the color rendering value using the text to be rendered, to the text to be rendered Word is rendered;
It includes: pixel number acquiring unit, Traversal Unit and color average computing unit that the color, which obtains module, wherein
Pixel number acquiring unit, for obtaining the pixel line number and pixel columns that the character bitmap includes;
Traversal Unit, each pixel for including for traversing the character bitmap extract the pixel of each pixel It is worth and adds up;
Color average computing unit obtains described for calculating cumulative pixel value and value and pixel sum ratio The color average of character bitmap, wherein the pixel sum is multiplying for the pixel line number and the pixel columns Product;
The rendering value computing module includes: pixel value acquiring unit and rendering value computing unit, wherein
Pixel value acquiring unit obtains working as the pixel of selection for choosing the pixel in the character bitmap respectively Preceding red color pixel value, current green colored pixel value and current blue color pixel values;
Rendering value computing unit, for successively will the current red color pixel value and the color average, described currently green Color pixel values and the color average, and, the current blue color pixel values and the color average are applied in advance The color rendering formula being first arranged obtains corresponding red color pixel rendering value, the green colored pixel rendering of the text to be rendered Value and blue colored pixels rendering value.
6. the device of rendering type according to claim 5, which is characterized in that it is average to calculate the color using following formula Value:
In formula,
ThisA is color average;
K is the pixel columns that character bitmap includes;
L is the pixel line number that character bitmap includes;
N is the primary colors number for forming pixel color;
YlkiFor the pixel value of the i-th primary colors of pixel of the l row k column in character bitmap.
7. the device of rendering type according to claim 5, which is characterized in that calculate the color wash with watercolours using following formula Dye value:
In formula,
ThisClkiFor the in character bitmap, the color rendering value of the i-th primary colors of pixel of row k column;
IV is pre-set constant.
8. according to the device of the described in any item rendering types of claim 5 to 7, which is characterized in that described device further include:
Module is presented, for the text to be rendered after rendering to be presented in forms.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes: shell, processor, memory, circuit board and electricity Source circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory setting are on circuit boards;Power supply Circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing executable program code;Processing Device runs program corresponding with executable program code by reading the executable program code stored in memory, for holding The method of the described in any item rendering types of row preceding claims 1-4.
CN201610431008.2A 2016-06-16 2016-06-16 A kind of method, apparatus and electronic equipment of rendering type Active CN106126140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610431008.2A CN106126140B (en) 2016-06-16 2016-06-16 A kind of method, apparatus and electronic equipment of rendering type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610431008.2A CN106126140B (en) 2016-06-16 2016-06-16 A kind of method, apparatus and electronic equipment of rendering type

Publications (2)

Publication Number Publication Date
CN106126140A CN106126140A (en) 2016-11-16
CN106126140B true CN106126140B (en) 2019-07-23

Family

ID=57469648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610431008.2A Active CN106126140B (en) 2016-06-16 2016-06-16 A kind of method, apparatus and electronic equipment of rendering type

Country Status (1)

Country Link
CN (1) CN106126140B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107358637B (en) * 2017-06-28 2020-09-25 广州酷狗计算机科技有限公司 Character drawing method and device, terminal and storage medium
CN111161127B (en) * 2019-12-19 2023-06-30 深圳海拓时代科技有限公司 Picture resource rendering optimization method
CN111191580B (en) * 2019-12-27 2022-03-29 支付宝(杭州)信息技术有限公司 Synthetic rendering method, apparatus, electronic device and medium
CN112395827B (en) * 2020-11-12 2024-06-25 中国人寿保险股份有限公司 Tree structure drawing method and mobile terminal
CN114820877A (en) * 2021-01-28 2022-07-29 北京字跳网络技术有限公司 Method, device and equipment for processing luminous effect of characters and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340635A (en) * 2010-07-14 2012-02-01 Tcl集团股份有限公司 Multimedia playing equipment and method and device for displaying texts in file of multimedia playing equipment
CN104850372A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Page display method and device
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device
CN104978119A (en) * 2014-05-22 2015-10-14 腾讯科技(深圳)有限公司 Information window display method and device, and user terminal
CN105122339A (en) * 2013-03-10 2015-12-02 高通Mems科技公司 Methods and apparatus for color rendering

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340635A (en) * 2010-07-14 2012-02-01 Tcl集团股份有限公司 Multimedia playing equipment and method and device for displaying texts in file of multimedia playing equipment
CN105122339A (en) * 2013-03-10 2015-12-02 高通Mems科技公司 Methods and apparatus for color rendering
CN104850372A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Page display method and device
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device
CN104978119A (en) * 2014-05-22 2015-10-14 腾讯科技(深圳)有限公司 Information window display method and device, and user terminal

Also Published As

Publication number Publication date
CN106126140A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
CN106126140B (en) A kind of method, apparatus and electronic equipment of rendering type
US8832541B2 (en) Method and system to convert visually orientated objects to embedded text
CN101699426A (en) Document format conversion system and method
CN105528935A (en) Writing sequence guiding method and device
CN110276816A (en) Regional color filling method and device, electronic equipment and computer readable storage medium
CN103065338A (en) Method and device providing shadow for foreground image in background image
CN108961361B (en) Method and system for generating special effect text image and computer equipment
CN106156237A (en) Information processing method, information processor and subscriber equipment
CN108763188A (en) Text display method, device, equipment and storage medium
CN109388725A (en) The method and device scanned for by video content
US10120539B2 (en) Method and device for setting user interface
CN107562331A (en) Display method, device and equipment of handwritten characters and storage medium
CN104063359A (en) Implementation method for personalized Chinese character word library
CN102340635A (en) Multimedia playing equipment and method and device for displaying texts in file of multimedia playing equipment
CN106598374B (en) Color transition method and device for interface
CN110297932B (en) Method and device for determining maximum inscribed circle of closed graph in vector diagram and electronic equipment
CN105260345B (en) Method and device for constructing facial characters and electronic equipment
CN106648367A (en) Touch reading method and touch reading device
US7038695B2 (en) User interface display apparatus using texture mapping method
CN110069300A (en) Vision original text generation method, device, medium and electronic equipment
CN103700363A (en) Font generation system for display and font generation method for display
Salim et al. Comparative study of low-cost tools to create effective educational infographics content
CN106709965B (en) Text display method and device based on shared surface
CN115688216A (en) User-defined design method and device of drawing
KR20150024170A (en) A Method and Apparatus For Providing Layout Based On Handwriting Input

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190111

Address after: 519031 Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Applicant after: Zhuhai Leopard Technology Co.,Ltd.

Address before: 100085 East District, Second Floor, 33 Xiaoying West Road, Haidian District, Beijing

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant