Summary of the invention
It is difficult to differentiate for the word of display under bright and colourful background colour or the most eye-catching problem, the invention provides one
Plant character displaying method and device, at least to solve the problems referred to above.
According to an aspect of the invention, it is provided a kind of character displaying method, including: obtain in electric terminal and be used for showing literary composition
The background color contrast in the region of word;Calculate the text color contrast mated with background color contrast;Use text color
Contrast display word.
Preferably, before obtaining the background color contrast in region being used for showing word in electric terminal, also include: judge to use
Whether the background color in the region of display word changes during display word;If background color is in display word mistake
Journey changes, then from the display caching of electric terminal, obtains the contrast of background color;If background color is at display literary composition
Do not change during word, then continue to use the last contrast obtaining background color from the display caching of electric terminal.
Preferably, it is judged that include for showing whether the background color in the region of word changes during display word: inspection
Survey whether user is configured the operation of background;If it is, determine that the background color in the region for showing word is at display literary composition
Change during word.
Preferably, obtain in electric terminal for showing that the background color contrast in the region of word includes: use twice rectangle to fold
Computation system calculates background color contrast, and wherein, twice rectangle superposition algorithm includes: for showing that the region of word obtains two
Individual rectangle, and calculate the color contrast of two rectangles respectively;The color contrast of two rectangles is carried out by Fourier transformation
Rectangle superposition, obtains background color contrast.
Preferably, calculate the text color contrast mated with background color contrast to include: by background color contrast according in advance
Definite value negates, and obtains text color contrast.
Preferably, background color contrast is negated according to predetermined value, obtain text color contrast and include: in such a way
Calculate text color contrast: text color contrast is equal to the difference of predetermined value with background color contrast.
According to a further aspect in the invention, it is provided that a kind of character display apparatus, including: the first acquisition module, it is used for obtaining electricity
For showing the background color contrast in the region of word in sub-terminal;Computing module, for calculating and background color contrast
The text color contrast joined;Display module, is used for using text color contrast to show word.
Preferably, said apparatus also includes: judge module, for judging that whether the background color in the region for showing word exists
Change during display word;Second acquisition module, for when the judged result of judge module is for being, from electric terminal
Display caching in obtain the contrast of background color;3rd acquisition module, is used for when the judged result of judge module is no,
Continue to use the last contrast obtaining background color from the display caching of electric terminal.
Preferably, above-mentioned first acquisition module includes: superposition calculation unit, for using twice rectangle superposition algorithm to calculate background
Color contrast, wherein, twice rectangle superposition algorithm includes: for showing that the region of word obtains two rectangles, and difference
Calculate the color contrast of two rectangles;The color contrast of two rectangles is carried out rectangle superposition by Fourier transformation, obtains
Background color contrast.
Preferably, above-mentioned computing module includes: negate unit, for background color contrast being negated according to predetermined value, obtains
Text color contrast.
By the present invention, use the background color contrast in the region obtaining display word, then calculate and contrast with this background color
Spend the text color contrast of coupling and in the way of this word color contrast display word, solve in bright and colourful background
Under color, the word of display is difficult to differentiate or the most eye-catching problem, and then makes the color contrast of font and the background demonstrated more
Clearly, improve user experience.
Detailed description of the invention
Below with reference to accompanying drawing and describe the present invention in detail in conjunction with the embodiments.It should be noted that in the case of not conflicting,
Embodiment in the application and the feature in embodiment can be mutually combined.
In view of at present under bright and colourful background colour the word of display be difficult to differentiate or the most eye-catching problem, the present embodiment
Provide a kind of character displaying method, so that making the face of font and background on the premise of the overall aesthetics not affecting background picture
Color contrast becomes apparent from.Fig. 1 is the flow chart of character displaying method according to embodiments of the present invention, as it is shown in figure 1, the method
Comprise the following steps:
Step S102, obtains in electric terminal for showing the background color contrast in the region of word;
Step S104, calculates the text color contrast mated with this background color contrast;
Step S106, uses this word color contrast to show word.
The present embodiment passes through said method, uses the background color contrast in the region obtaining display word, then calculates and this back of the body
Scape color contrast coupling text color contrast and by this word color contrast display word in the way of, do not changing background
On the premise of picture, make the word demonstrated match with background color, thus solve and show under bright and colourful background colour
Word be difficult to differentiate or the most eye-catching problem, and then make the color contrast of font and the background demonstrated become apparent from, carry
High user experience.
In view of during showing word according to the method for the present embodiment, if being used for showing the background color in the region of word
Change, then the text effects finally demonstrated can be caused the best.So, so that the method for the present embodiment can be suitable for
In the situation that background color during display word changes, for showing the back of the body in the region of word in obtaining electric terminal
Before scape color contrast, it is also possible to including: judge whether the background color in the region for showing word is showing word process
In change;If background color changes during display word, then from the display of electric terminal caches, obtain the back of the body
The contrast of scape color;If background color does not changes during display word, then continue to use last from electric terminal
Display caching obtains the contrast of background color.Can become at the background color in the region of display word in this way
The color contrast making font and the background demonstrated in the case of change becomes apparent from, and expands the scope of application of scheme.
Judge that the mode whether background color in the region for showing word changes during display word has a variety of,
The present embodiment provides the judgment mode that a kind of comparison is easy: whether detection user is configured the operation of background;If it is,
Then determine that the background color in the region for showing word changes during display word.This mode accuracy of judgement and letter
Single easy.
Generally, directly background color to the region for showing word got the background in this region can be calculated
Color contrast, but more accurate for showing the background color contrast in the region of word in order to make in the electric terminal got,
Twice rectangle superposition algorithm can be used to calculate background color contrast.Wherein, twice rectangle superposition algorithm may include that with
Obtain two rectangles in the region of display word, and calculate the color contrast of two rectangles respectively;Color pair by two rectangles
Carry out rectangle superposition than degree by Fourier transformation, obtain background color contrast.Wherein, the position of two rectangles has only to full
The region that two rectangles of foot can intersect and intersect is viewing area, when two rectangles are chosen, and the big I of two rectangles
With the size of respectively display character area 2 times.The background color contrast obtained in this way is more accurate, Jin Erying
The text color contrast calculated by this background color contrast shows the display effect of word more preferably.
The mode calculating the text color contrast mated with background color contrast has a lot, such as, by background color contrast
Negative as text color contrast, or as text color contrast after background color contrast is added with designated value,
The present embodiment provides the mode of the text color contrast that a kind of better calculating mates with background color contrast: will the back of the body
Scape color contrast negates according to predetermined value, obtains text color contrast.Wherein, by background color contrast according to predetermined value
Negate, obtain text color contrast and include: calculate text color contrast in such a way: text color contrast is equal to
Predetermined value and the difference of background color contrast, such as, the maximum arranging contrast is 65535, then text color contrast
=65535-background color contrast.
Corresponding to said method, the present embodiment additionally provides a kind of character display apparatus, and Fig. 2 is literary composition according to embodiments of the present invention
The structured flowchart of word display device, as in figure 2 it is shown, this device includes: the first acquisition module 22, computing module 24, Yi Jixian
Show module 26.Wherein, the first acquisition module 22, for obtaining in electric terminal for showing the background color pair in the region of word
Degree of ratio;Computing module 24, is coupled with the first acquisition module 22, gets for calculating and above-mentioned first acquisition module 22
The text color contrast of background color contrast coupling;Display module 26, is coupled with computing module 24, is used for using above-mentioned
Computing module 24 calculated text color contrast display word.
The present embodiment passes through said apparatus, is obtained the background color contrast in the region of display word by the first acquisition module 22,
Computing module 24 calculates the text color contrast mated with this background color contrast, and display module 26 is with this text color pair
The ratio mode of degree display word, on the premise of not changing background picture, makes the word demonstrated and background color match, from
And the word solving under bright and colourful background colour display is difficult to differentiate or the most eye-catching problem, and then make to demonstrate
The color contrast of font and background becomes apparent from, and improves user experience.
Fig. 3 is the structured flowchart of the preferably character display apparatus of first according to embodiments of the present invention, as it is shown on figure 3, this device is also
Including: judge module 32, for judging whether the background color in the region for showing word becomes during display word
Change;Second acquisition module 34, is coupled with judge module 32 and the first acquisition module 22, for the judgement at judge module 32
When result is for being, from the display caching of electric terminal, obtain the contrast of background color;3rd acquisition module 36, and judges mould
Block 32 and the first acquisition module 22 are coupled, and for when the judged result of judge module 32 is no, continue to use last from electronics
The display caching of terminal obtains the contrast of background color.
Fig. 4 is the structured flowchart of the preferably character display apparatus of second according to embodiments of the present invention, as shown in Figure 4, above-mentioned first
Acquisition module 22 includes: superposition calculation unit 222, for using twice rectangle superposition algorithm to calculate background color contrast, its
In, twice rectangle superposition algorithm may include that for showing that the region of word obtains two rectangles, and two squares of calculating respectively
The color contrast of shape;The color contrast of two rectangles is carried out rectangle superposition by Fourier transformation, obtains background color pair
Degree of ratio.
Fig. 5 is the structured flowchart of the preferred character display apparatus of the 3rd according to embodiments of the present invention, as it is shown in figure 5, above-mentioned calculating
Module 24 includes: negate unit 242, for background color contrast being negated according to predetermined value, obtains text color contrast.
Illustrating below in conjunction with a preferred embodiment, the preferred embodiment combines above-described embodiment and preferred implementation.
Thering is provided a kind of background colour to automatically extract the method shown with font in this preferred embodiment, the method can apply to have aobvious
Show in any electric terminal of device, for example, it is possible to be with LCDs (Liquid Crystal Display, referred to as LCD)
Portable electronic piece terminal, below in conjunction with the accompanying drawings this preferred embodiment is described in detail further.
Fig. 6 is the flow chart of the core algorithm of font display packing according to the preferred embodiment of the invention, as shown in Figure 6, the party
Method comprises the following steps:
Step S601, it is judged that whether background colour changes, if it is, enter step S602, otherwise enters step S603.
Step S602, if background colour changes, such as, user, by arranging the operations such as background, causes the theme back of the body of display
Scape changes, then first obtain twice rectangle superposition value in this region from the display caching of equipment, proceed to step S604.
Wherein, the display caching of the said equipment, refer to that the data that will show export the buffer memory district of display device.
Step S603, if background colour does not changes, i.e. needs background color bottom the character area of display will not show word
Change during body, then in the region that will show word, use twice rectangle superposition algorithm, by background at this twice
The background color contrast of the part of superposition is calculated, and proceeds to step S604, if algorithm superimposed anomaly, this flow process terminates.
Such as, twice above-mentioned rectangle superposition algorithm may is that firstly, for the region needing to show word, obtains two squares
Shape, wherein, the region that the common factor of two rectangles is to be shown;Secondly, respectively color contrast is sought in two rectangular areas;
Then, by Fourier's rectangle superposition, the color contrast value occured simultaneously in two rectangular areas is obtained.
Step S604, negates the background color contrast value calculated, obtain corresponding reduced value (for example, it is possible to
The maximum of contrast is defined as 65535, and interval is 0-65535, if the contrast value obtained is 628, is first scaled
16 systems, for 0x274, negate according to each byte respectively, obtain 0xFC8B, be scaled decimal scale, are 64651), proceed to
Step S605, if negating abnormal, this flow process terminates.
Step S605, showing word when, negates step S604 the reduced value obtained and is set to text color, proceeds to step
Rapid S606, if arranging abnormal, this flow process terminates.
Step S606, refreshes display word, if refreshing abnormal, this flow process terminates.
Cutting viewing area normally used with industry, to compared with the method shown after the local special handling of background theme,
The method that the background colour that this preferred embodiment provides extracts and font shows can automatically extract background colour, and according to the background extracted
Color contrast calculates the color of the word that will show, so that the color contrast of font and background becomes apparent from, to user
Visual experience more attractive in appearance.
Fig. 7 be according to the preferred embodiment of the invention LCD display content schematic diagram, as it is shown in fig. 7, LCD or other
Device display area can be divided into the viewing area that A, B, C, D, E etc. are multiple, the color contrast of each viewing area
May be different, if correctly to show word in the viewing area that A, B, C, D, E etc. are multiple, then need to obtain background
Color contrast.
Fig. 8 is the schematic diagram of LCD display part according to the preferred embodiment of the invention, and as shown in Figure 8, overall LCD shows
Show or the viewing area of other display equipment.Fig. 9 is the schematic diagram of the most each viewing area, as
Shown in Fig. 9, it is many that expression is again divided into A, B, C, D, E etc. in certain region of LCD or other display equipment
Individual region, i.e. be in the single viewing area separated, it split new multiple viewing areas again, progressively refines,
By the superposition of rectangle, the color contrast of the background got will be more accurately reliable.
In sum it can be seen that the present invention solves under bright and colourful background colour the word of display is difficult to differentiate or not
Eye-catching problem, and then make the color contrast of font and the background demonstrated become apparent from, improve user experience.
Obviously, those skilled in the art should be understood that each module of the above-mentioned present invention or each step can be with general calculating
Device realizes, and they can concentrate on single calculating device, or is distributed on the network that multiple calculating device is formed,
Alternatively, they can realize with calculating the executable program code of device, it is thus possible to be stored in storing device
In perform by calculating device, and in some cases, can with the order being different from herein perform shown or described by step
Suddenly, or they are fabricated to respectively each integrated circuit modules, or the multiple modules in them or step are fabricated to single
Integrated circuit modules realizes.So, the present invention is not restricted to the combination of any specific hardware and software.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for those skilled in the art
For, the present invention can have various modifications and variations.All within the spirit and principles in the present invention, any amendment of being made, etc.
With replacement, improvement etc., should be included within the scope of the present invention.