CN108734656A - Scaling method and device - Google Patents
Scaling method and device Download PDFInfo
- Publication number
- CN108734656A CN108734656A CN201710254394.7A CN201710254394A CN108734656A CN 108734656 A CN108734656 A CN 108734656A CN 201710254394 A CN201710254394 A CN 201710254394A CN 108734656 A CN108734656 A CN 108734656A
- Authority
- CN
- China
- Prior art keywords
- scaling
- display element
- operating system
- dpi
- application program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000008447 perception Effects 0.000 claims description 35
- 238000012545 processing Methods 0.000 claims description 33
- 230000008859 change Effects 0.000 claims description 18
- 230000009466 transformation Effects 0.000 claims description 18
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000005194 fractionation Methods 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000006870 function Effects 0.000 description 20
- 230000006854 communication Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006399 behavior Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 230000005484 gravity Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012905 input function Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 239000003973 paint Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4023—Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
The invention discloses a kind of scaling method and devices, belong to field of computer technology.The method includes the scalings that application program obtains operating system, when there are when original display element to be shown in user interface, Zoom display element corresponding with scaling is chosen in the resource file of application program, and is drawn on a user interface and shown Zoom display element corresponding with scaling.The present invention prestores m corresponding with the original display element Zoom display elements with different zoom ratio by resource file, allow the application to the scaling according to original display element and operating system, it is chosen directly in resource file and arrives a Zoom display element corresponding with the scaling, apparent sawtooth and blooming can be had by avoiding the Zoom display element scaled through operating system, ensure that the Zoom display element of selection can clearly be shown on a user interface.
Description
Technical field
The present embodiments relate to field of computer technology, more particularly to a kind of scaling method and device.
Background technology
The display elements of application program include at least one of image, word and control, are with the type of display elements
For image, in the high-resolution epoch of display equipment, high dpi (Dots Per Inch, the picture of per inch is usually arranged in user
Vegetarian refreshments number) to meet the requirement for showing equipment, so that the operating system in the display equipment is treated according to the high dpi of setting
The original image of display carries out corresponding scaling processing.
Currently, the scaling processing of each application program is all by DWM (the Desktop Window in operating system
Manager, Desktop Window Manager) virtualization technology realization scaling processing.A kind of typical scaling method includes:When answering
With, there are when original image to be shown, operating system first draws original image according to original scale 100% in program,
After completing, operating system carries out drawn original image further according to the corresponding scalings of dpi of current setting
Corresponding scaling obtains zoomed image, and shows the zoomed image.
In the above-mentioned methods, it is generally difficult to keep the clear and profile of image border by the zoomed image that scaling obtains
Can there are apparent sawtooth and blooming.
Invention content
In order to solve to pass through in the prior art the obtained zoomed image of scaling be generally difficult to keep the clear of image border and
The clearly demarcated problem of profile, an embodiment of the present invention provides a kind of scaling method and devices.The technical solution is as follows:
In a first aspect, a kind of scaling method is provided, the method includes:
The scaling of operating system is obtained, the scaling is indicated for the contracting of the pixel number dpi of per inch
Put ratio;
When there are when original display element to be shown, being chosen in the resource file of application program in user interface and institute
The corresponding Zoom display element of scaling is stated, the resource file is m corresponding with the original display element for storing
Zoom display element with different zoom ratio, m are positive integer;
It is drawn in the user interface and shows Zoom display element corresponding with the scaling;
Wherein, the original display element is the display elements without scaling, and the Zoom display element is by contracting
It puts and clarity is higher than the display elements of predetermined threshold, the display content of the original display element and the Zoom display element
It is identical.
Second aspect, provides a kind of scaling processing device, and described device includes:
First acquisition module, the scaling for obtaining operating system, the scaling are indicated for per inch
Pixel number dpi scaling;
Choose module, for when in user interface there are when original display element to be shown, in the resource of application program
Zoom display element corresponding with the scaling is chosen in file, the resource file is for storing and the original display
The corresponding m Zoom display element with different zoom ratio of element, m is positive integer;
Display module, for Zoom display member corresponding with the scaling to be drawn and shown in the user interface
Element;
Wherein, the original display element is the display elements without scaling, and the Zoom display element is by contracting
It puts and clarity is higher than the display elements of predetermined threshold, the display content of the original display element and the Zoom display element
It is identical.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
The scaling that operating system is obtained by application program, when there are original display to be shown members in user interface
When plain, Zoom display element corresponding with scaling is chosen in the resource file of application program, and paint on a user interface
It makes and shows Zoom display element corresponding with scaling;Since resource file is corresponding with original display element for storing
The m Zoom display elements with different zoom ratio so that application program can be chosen directly in resource file to be arrived and this
The Zoom display element of the corresponding high-resolution with the scaling of original display element, avoids and contracts through operating system
The Zoom display element put can have apparent sawtooth and blooming, ensure that the Zoom display element of selection
It can clearly show on a user interface, in order to subsequently to the operations such as view or edit of the Zoom display element.
Description of the drawings
Fig. 1 is the structural schematic diagram of the implementation environment involved by scaling method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of scaling method provided by one embodiment of the present invention;
Fig. 3 is the flow chart for the scaling method that another embodiment of the present invention provides;
Fig. 4 is the flow chart for the setting dpi perception values that scaling method provided by one embodiment of the present invention is related to;
Fig. 5 is the principle schematic of scaling method provided by one embodiment of the present invention;
Fig. 6 is the structure chart of scaling processing device provided by one embodiment of the present invention;
Fig. 7 is the structure chart for the scaling processing device that another embodiment of the present invention provides;
Fig. 8 is the structural schematic diagram of terminal provided by one embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
First, to the present embodiments relate to some nouns explain:
Original display element in application program:Without the display elements of scaling.Original display element includes image, text
At least one of word and control.
Zoom display element in application program:It is higher than the display elements of predetermined threshold by scaling and clarity.Scaling
Display elements include at least one of image, word and control.When Zoom display element is corresponding with original display element
When display elements with some scaling, original display element is identical with the display content of Zoom display element.
An embodiment of the present invention provides a kind of scaling method and devices, and display elements are completed by application program itself
Scaling processing, do not need operating system to complete the scaling processing of display elements.Specifically, it is obtained and is operated by application program
The scaling of system, when in user interface there are when original display element to be shown, in the resource file of application program
Zoom display element corresponding with scaling is chosen, and draws on a user interface and shows scaling corresponding with scaling
Display elements;There is different zoom ratio due to being stored with m corresponding with original display element in the resource file of application program
Example Zoom display element so that application program can be chosen directly in resource file arrive it is corresponding with the original display element
A Zoom display element with the scaling, avoiding the Zoom display element scaled through operating system can exist
The problem of apparent sawtooth and blooming, it ensure that the Zoom display element of selection can clearly be shown on a user interface,
In order to subsequently to the operations such as view or edit of the Zoom display element.
Before the embodiment of the present invention is explained, first the application scenarios of the embodiment of the present invention are illustrated.
Fig. 1 shows the structural schematic diagram for the terminal 100 that one embodiment of the invention is provided.The terminal 100 is wrapped on software view
It includes:Operating system 120 and application program 140.
Terminal 100 is the terminal used in ordinary user.Terminal 100 can be smart mobile phone, tablet computer, portable
Computer, desktop computer etc..
Operating system 120 includes:System scales program 122, and system scaling program is being used for for the acquiescence of operating system 120
Original display element is zoomed in and out to the scaling program of processing.
Application program 140 is the application program with display elements scaling processing ability.Optionally, application program 140 to
Dpi perception values 142 are arranged in operating system 120, which is used to indicate the system scaling journey of quiescing system 120
Sequence 122 zooms in and out processing to original display element.
Optionally, application program 140, should by calling first interface 124 to obtain the scaling 144 of operating system 120
Scaling 144 is indicated for the scaling 144 of dpi.Wherein, which connects for what operating system 120 provided
Mouthful, for example the first interface 124 is GetDeviceCaps interfaces.
In general, the system scaling program 122 of 140 quiescing system 120 of application program contracts to original display element
Put processing, obtain the scaling 144 of operating system 120, when in user interface there are when original display element to be shown,
Zoom display element corresponding with scaling 144 is chosen in the resource file 146 of application program 140, and on a user interface
It draws and shows Zoom display element corresponding with scaling 144.Wherein, resource file 146 is for storage and original display
The corresponding m Zoom display element with different zoom ratio 144 of element, m is positive integer.
Referring to FIG. 2, it illustrates the flow charts of scaling method provided by one embodiment of the present invention.The present embodiment
It is illustrated applied to implementation environment shown in figure 1 with the scaling method.The scaling method includes:
Step 201, application program obtains the scaling of operating system, and scaling is indicated for the pantograph ratio of dpi
Example.
Optionally, application program obtains the scaling of operating system in the application program launching, and/or, using journey
Sequence obtains the current pantograph ratio of operating system when receiving operating system transmission dpi change informations, according to dpi change informations
Example, the dpi change informations are for indicating that the current scaling of operating system is reset.
For example, the dpi change informations are carried with WM_DPICHANGE message, sent when application program receives operating system
WM_DPICHANGE message when, determine that the current scaling of operating system is reset, application program is from operating system
In get current scaling.
Optionally, operating system acquiescence is when the pixel number of per inch is 96 (96dpi), the corresponding contractings of the 96dpi
It is 100% to put ratio;Optionally, scaling 150% corresponds to 144dpi, and scaling 200% corresponds to 192dpi.
Step 202, when in user interface there are when original display element to be shown, money of the application program in application program
Zoom display element corresponding with scaling is chosen in source file, resource file is corresponding with original display element for storing
The m Zoom display elements with different zoom ratio, m is positive integer.
Wherein, original display element is the display elements without scaling, and Zoom display element is by scaling and clearly
Degree is higher than the display elements of predetermined threshold, and original display element is identical with the display content of Zoom display element.
For example, original display element is the image X without scaling, Zoom display element includes by image X according to 75%
Image X1, the image X2 and general for being amplified image X according to 125% scaling that scaling is reduced
The image X3 that image X is amplified according to 200% scaling, and the clarity of image X1, image X2 and image X3 are equal
Higher than predetermined threshold.
Optionally, original display element to be shown in user interface is including but not limited to following two:1, when user beats
When opening the user interface of the application program, which needs the image or font jumped out automatically or control;When user triggers
Some operation in user interface, when application response operation image or font or control to be shown.
Optionally, m corresponding with original display element are previously stored in resource file has different zoom ratio
Zoom display element.For example, the value that original display element is image A, m is 3,3 kinds of scalings are respectively 125%, 150%
With 200%.As shown in Table 1,3 corresponding with image A are stored in the resource file of application program has different zoom ratio
The image A2 and scaling that image A1 that Zoom display element, respectively scaling are 125%, scaling are 150%
For 200% image A3.
Table one
According to above-mentioned table one, if the scaling that application program obtains operating system is 150%, exists in user interface and wait for
The original display element of display is image A, then application program chooses figure corresponding with scaling 150% in the resource file
As A2.
Step 203, application program draws and shows Zoom display element corresponding with scaling on a user interface.
For example, application program draws and shows image A2 corresponding with scaling 150% on a user interface.
In conclusion the present embodiment obtains the scaling of operating system by application program, when existing in user interface
When original display element to be shown, it is first that Zoom display corresponding with scaling is chosen in the resource file of application program
Element, and draw on a user interface and show Zoom display element corresponding with scaling;Since resource file is for storing
M corresponding with the original display element Zoom display elements with different zoom ratio so that application program can directly exist
It is chosen in resource file and arrives a Zoom display element with the scaling corresponding with the original display element, avoided
The Zoom display element scaled through operating system can have apparent sawtooth and blooming, ensure that selection
Zoom display element can clearly show on a user interface, in order to follow-up viewing or editing to the Zoom display element
Operation.
Referring to FIG. 3, it illustrates the flow charts of scaling method provided by one embodiment of the present invention.The present embodiment
It is illustrated applied to implementation environment shown in figure 1 with the scaling method.The scaling method includes:
Step 301, application program obtains the version information of operating system.
Optionally, for application program by calling second interface to obtain the version information of operating system, which is behaviour
The interface of system offer is provided;For example, the second interface is GetVersionEx interfaces.
Optionally, information is for identifying the current version of the operating system;For example, version information is windows8.0.
Optionally, windows operating systems are divided into three categories:First type operating system includes version number in windows
Vista (including windows vista) is to the operating system between windows8.0 (including windows8.0), the second generic operation
System includes the operating system that version number is higher than after (including windows8.1), and third type operating system includes that version number is less than
The operating system of windows xp (including windows xp).
Wherein, the version number in first kind version information is below the version number in the second class version information, third class version
Version number in this information is below the version number in first kind version information.
Step 302, application program judges whether the version information obtained belongs to first kind version information or the second class version
Information.
Optionally, it if the version information obtained belongs to first kind version information or the second class version information, thens follow the steps
303;If being not belonging to first kind version information or the second class version information, i.e. version information belongs to third type operating system, then answers
Dpi perception values are not provided with program, terminate process.
Step 303, dpi perception values are arranged to operating system in application program.
Wherein, the system that dpi perception values are used to indicate quiescing system scales program and contracts to original display element
Processing is put, system scaling program is the scaling program for original display element to be zoomed in and out to processing of operating system acquiescence.
Optionally, when dpi perception values are arranged to operating system in application program, operating system is no longer responsible for original display
Element zooms in and out processing, and is responsible for zooming in and out processing to original display element by application program.
Optionally, since version information belongs to first kind version information or the second class version information, the optional packet of dpi perception values
The first value and the second value are included, therefore dpi perception values are set and are divided into the following two kinds set-up mode.
The first set-up mode:When version information belongs to first kind version information, application program setting dpi perception values are
First value, the first value be used for operating system instruction application program is obtained in application program launching operating system currently
Scaling.
Optionally, it includes following steps that application program setting dpi perception values, which are the first value,:1, application program loads
First fileinfo " LoadLibrary (_ T (" user32.dll ")) ";2, application program is determined according to first fileinfo
First functional interface " SetProcessDPIAware interfaces ", first functional interface are that operating system is supplied to application program
Interface;3, application call first functional interface setting dpi perception values are the first value " PROCESS_SYSTEM_DPI_
AWARE”。
Second of set-up mode:When version information belongs to the second class version information, setting dpi perception values take for second
Value, the second value are used to obtain the current pantograph ratio of operating system in application program launching to operating system instruction application program
Example, and application program obtains operation system when receiving the dpi change informations of operating system transmission, and according to dpi change informations
It unites current scaling, dpi change informations are for indicating that the current scaling of operating system is reset.
Optionally, it includes following steps that application program setting dpi perception values, which are the second value,:1, application program loads
Second fileinfo " LoadLibrary (_ T (" Shcore.dll ")) ";2, application program is determined according to second fileinfo
Second functional interface " SetProcessDpiAwareness interfaces ", second functional interface are that operating system is supplied to using journey
The interface of sequence;3, application call second functional interface setting dpi perception values are the second value " PROCESS_PER_
MONITOR_DPI_AWARE”。
As shown in figure 4, in a schematical example, application program judges when obtaining the version number of operating system
Whether the version number is less than or equal to windows xp, if dpi perception values are arranged less than or equal to if, terminates process.If the version
This number be higher than windows xp, then application program judge again the version number whether be less than or equal to windows8.0, if be less than or
It is the first value " PROCESS_SYSTEM_DPI_AWARE " equal to dpi perception values are then arranged;Dpi perception values are set if being higher than
For the second value " PROCESS_PER_MONITOR_DPI_AWARE ".
Step 304, application program obtains the scaling of operating system, and scaling is indicated for the pixel of per inch
The scaling of points dpi.
Optionally, application program obtains the contracting of operating system according to the different values of dpi perception values using corresponding mode
Put ratio.
For example, when application program setting dpi perception values are the first value, application program is obtained in application program launching
The current scaling of operating system.
For another example, when application program setting dpi perception values are the second value, application program is obtained in application program launching
The current scaling of extract operation system, and operating system detects whether dpi change informations " WM_DPICHANGE message " in real time,
If in the presence of if to application program send WM_DPICHANGE message so that application program receive operating system transmission WM_
When DPICHANGE message, determines that the current scaling of operating system is reset, got from operating system current
Scaling.
Step 305, application program judges to whether there is original display element to be shown in current user interface.
Optionally, application program monitors the current user interface of application program in real time, if application program is judged currently
User interface on there are original display element to be shown, then follow the steps 305;If judging to be not present, terminate process.
Step 306, when, there are when original display element to be shown, application program obtains original display member in user interface
First filename of element, the first filename are used for unique mark original display element.
For example, original display element is image A, application program obtains the first filename of image A
“background.png”。
Step 307, application program is advised according to the first filename and scaling of original display element by default conversion
Then generate the second filename.
Wherein, it is the rule for converting the first filename and scaling to the second filename to preset transformation rule, second
Filename is used for unique mark Zoom display element.
Optionally, application program generates the second file according to the first filename and scaling by default transformation rule
Name includes following steps:
1, application program is split the first filename to obtain root name and suffix portion, and root name is for indicating
The title content of original display element, format identification (FID) are used to indicate the Format Type of original display element.
2, application program obtains corresponding with root name default transformation rule, default transformation rule include root name,
The splicing sequence of scaling and suffix portion.
3, root name, scaling and suffix portion are spliced according to splicing sequence, obtain second by application program
Filename.
For example, application program is split the first filename " background.png " to obtain root name
" background " and suffix portion " .png ", application program obtain and the root name according to root name " background "
Corresponding default transformation rule, the splicing content and splicing sequence which includes are " root name+@+pantograph ratio
Example+suffix portion ", then application program is according to splicing sequence, by root name " background ", splicing character "@", scaling
Ratio " 150% " and suffix portion " .png " are spliced, and the second filename " background@150%.png " is obtained.
For another example, the splicing content and splicing sequence which includes be " &&+ scalings+root name+
Suffix portion ", then application program according to the splicing sequence, will splice character " && ", scaling " 150% ", root name
" background " and suffix portion " .png " are spliced, and the second filename " &&150%background.png is obtained ".This
Embodiment is not limited the splicing sequence and connecting method of root name, scaling and suffix portion.
Step 308, application program chooses Zoom display element corresponding with the second filename in resource file.
Optionally, application program searches whether there is Zoom display corresponding with the second filename member in resource file
Element, if in the presence of if resource file second filename is returned into the application program, if there is no resource file by this first
Filename returns to the application program.It is corresponding, if application program receives resource file return when being the second filename,
Obtain the corresponding Zoom display element of second filename;If application program receives resource file, return is the first filename
When, then it represents that the corresponding original display element of first filename does not support the scaling of the dpi.
Optionally, resource file is .rdb (Relational Database, relational database) file.
Exist and the second filename " background@150%.png " for example, application program is found in .rdb files
Corresponding Zoom display element " image A2 ", then resource file second filename is returned into the application program, application program
Obtain Zoom display element " image A2 " corresponding with second filename.
It should be noted that step 307 and step 308 is alternative is implemented as following steps:Application program is according to first
Filename and scaling search corresponding Zoom display element by default correspondence in resource file.
Wherein, corresponding pass of the correspondence between the first filename, scaling and Zoom display element three is preset
System.
For example, as shown in Table 2, the resource file of application program is stored with the first filename, scaling and Zoom display
Correspondence between element three is answered when the first file is entitled " background.png ", and scaling is " 150% "
It is " image A2 " that corresponding Zoom display element is searched in resource file by default correspondence with program.
Table two
First filename | Scaling | Zoom display element |
background.png | 125% | Image A1 |
background.png | 150% | Image A2 |
background.png | 200% | Image A3 |
school.png | 125% | Image B1 |
school.png | 150% | Image B2 |
school.png | 200% | Image B3 |
Step 309, application program draws and shows Zoom display element corresponding with scaling on a user interface.
For example, application program draws and shows image A2 corresponding with scaling 150% on a user interface.
As shown in figure 5, in a schematical example, application program XX obtains the version information of operating system
" windows8.1 " judges that the version information " windows8.1 " belongs to the second type operating system, then application program XX is to behaviour
It is the second value " PROCESS_PER_MONITOR_DPI_AWARE " to make system setting dpi perception values.Application program XX obtains behaviour
The scaling " 150% " for making system, when application program XX monitors that there are original display to be shown members in the user interface
When plain " image A ", application program XX obtains first filename " background.png " of " image A ", according to first file
Name " background.png " and scaling " 150% " generate the second filename by default transformation rule
" background@150%.png ", application program XX choose and the second filename " background@in .rdb files
The corresponding Zoom display elements of 150%.png " " image A2 ".
In conclusion the present embodiment obtains the scaling of operating system by application program, when existing in user interface
When original display element to be shown, it is first that Zoom display corresponding with scaling is chosen in the resource file of application program
Element, and draw on a user interface and show Zoom display element corresponding with scaling;Since resource file is for storing
M corresponding with the original display element Zoom display elements with different zoom ratio so that application program can directly exist
It is chosen in resource file and arrives a Zoom display element with the scaling corresponding with the original display element, avoided
The Zoom display element scaled through operating system can have apparent sawtooth and blooming, ensure that selection
Zoom display element can clearly show on a user interface, in order to follow-up viewing or editing to the Zoom display element
Operation.
The present embodiment is also by application program according to the first filename and scaling of original display element, by default
Transformation rule generates the second filename, and Zoom display element corresponding with the second filename is chosen in resource file;Due to
The Zoom display element stored in resource file is also to be generated according to default transformation rule in name so that application program energy
Enough directly according to the second filename of generation, search whether there is pantograph ratio corresponding with second filename in resource file
Example, avoids application program and needs to prestore the correspondence between the first filename, scaling and Zoom display element three
The case where relationship, saves the memory space of application program.
Also dpi perception values are arranged to operating system by application program in the present embodiment, and dpi perception values, which are used to indicate, to be forbidden grasping
The system scaling program for making system zooms in and out processing to original display element;So that operating system is no longer responsible for original display
Element zooms in and out processing, and perceives the scaling of dpi by application program and be responsible for corresponding scaling processing and work.
Following is apparatus of the present invention embodiment, can be used for executing the method for the present invention embodiment.For apparatus of the present invention reality
Undisclosed details in example is applied, the method for the present invention embodiment is please referred to.
Referring to FIG. 6, it illustrates the structural schematic diagrams of scaling processing device provided by one embodiment of the present invention.The contracting
Putting processing unit can be by special hardware circuit, alternatively, the whole or one of software and hardware being implemented in combination with as the terminal in Fig. 1
Part, the scaling processing device include:First acquisition module chooses module and display module;
First acquisition module 610, for realizing above-mentioned steps 201 or step 304.
Module 620 is chosen, for realizing above-mentioned steps 202.
Display module 630, for realizing above-mentioned steps 203 or step 309.
In the alternative embodiment provided based on embodiment illustrated in fig. 6, as shown in fig. 7, the selection module 620, packet
It includes:Acquiring unit 621, generation unit 622 and selection unit 623;
Acquiring unit 621, for realizing above-mentioned steps 306.
Generation unit 622, for realizing above-mentioned steps 307.
Selection unit 623, for realizing above-mentioned steps 308.
The generation unit 622, including:
It splits subelement 622a, obtain subelement 622b and splicing subelement 622c.
Subelement 622a is split, root name and suffix portion, master file are obtained for being split the first filename
Title content of the name for indicating original display element, format identification (FID) are used to indicate the Format Type of original display element.
Subelement 622b is obtained, for obtaining default transformation rule corresponding with root name, default transformation rule includes
The splicing sequence of root name, scaling and suffix portion.
Splice subelement 622c, for according to splicing sequence, root name, scaling and suffix portion to be spelled
It connects, obtains the second filename.
The device further includes:
Setup module 640, for realizing above-mentioned steps 303.
Second acquisition module 650, for realizing above-mentioned steps 301.
Setup module 640 includes:First setting unit 641 or the second setting unit 642;
First setting unit 641, for when version information belongs to first kind version information, setting dpi perception values are the
One value, the first value be additionally operable to operating system instruction application program is obtained in application program launching operating system currently
Scaling;
Second setting unit 642, for when version information belongs to the second class version information, setting dpi perception values are the
Two values, the second value are used to obtain the current contracting of operating system in application program launching to operating system instruction application program
Ratio is put, and application program obtains behaviour when receiving the dpi change informations of operating system transmission, and according to dpi change informations
Make the current scaling of system, dpi change informations are for indicating that the current scaling of operating system is reset.
Correlative detail is in combination with reference chart 2, Fig. 3, Fig. 4 and embodiment of the method shown in fig. 5.Wherein, the first acquisition module
610 are additionally operable to realize any other implicit or disclosed and relevant function of obtaining step in above method embodiment;Choose mould
Block 620 is additionally operable to realize any other implicit or disclosed and relevant function of selecting step in above method embodiment;Display
Module 630 is additionally operable to realize any other implicit or disclosed in the above method embodiment and display relevant function of step;If
It sets module 640 and is additionally operable to realize any other implicit or disclosed and relevant function of setting steps in above method embodiment;
Second acquisition module 650 is additionally operable to realize any other implicit or disclosed relevant with obtaining step in above method embodiment
Function.
It should be noted that the device that above-described embodiment provides, when realizing its function, only with above-mentioned each function module
It divides and for example, in practical application, can be completed as needed and by above-mentioned function distribution by different function modules,
The internal structure of equipment is divided into different function modules, to complete all or part of the functions described above.In addition,
The apparatus and method embodiment that above-described embodiment provides belongs to same design, and specific implementation process refers to embodiment of the method, this
In repeat no more.
Referring to FIG. 8, it illustrates the block diagram of terminal 800 provided by one embodiment of the present invention, which can run
Putting person's client or subscription client.Specifically:Terminal 800 may include RF (Radio Frequency, radio frequency) circuit
810, include the memory 820, input unit 830, display unit of one or more computer readable storage mediums
840, sensor 850, voicefrequency circuit 860, WiFi (wireless fidelity, Wireless Fidelity) modules 870 including there are one
Or the processor 880 and the components such as power supply 890 of more than one processing core.It will be understood by those skilled in the art that Fig. 8
Shown in device structure do not constitute the restriction to equipment, may include than illustrating more or fewer components, or combination
Certain components or different components arrangement.Wherein:
RF circuits 810 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station
After downlink information receives, one or the processing of more than one processor 880 are transferred to;In addition, the data for being related to uplink are sent to
Base station.In general, RF circuits 810 include but not limited to antenna, at least one amplifier, tuner, one or more oscillators, use
Family identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), duplex
Device etc..In addition, RF circuits 810 can also be communicated with network and other equipment by radio communication.Wireless communication, which can use, appoints
(Global System of Mobile communication, the whole world are moved for one communication standard or agreement, including but not limited to GSM
Dynamic communication system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code
Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple
Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short
Messaging Service, short message service) etc..Memory 820 can be used for storing software program and module.Processor 880
The software program and module of memory 820 are stored in by operation, to perform various functions application and data processing.It deposits
Reservoir 820 can include mainly storing program area and storage data field, wherein storing program area can storage program area, at least one
Application program (such as sound-playing function, image player function etc.) needed for a function etc.;Storage data field can store basis
Terminal 800 uses created data (such as audio data, phone directory etc.) etc..In addition, memory 820 may include high speed
Random access memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or
Other volatile solid-state parts.Correspondingly, memory 820 can also include Memory Controller, to provide processor 880
Access with input unit 830 to memory 820.
Input unit 830 can be used for receiving the number or character information of input, and generate and user setting and function
Control related keyboard, mouse, operating lever, optics or the input of trace ball signal.Specifically, input unit 830 may include touching
Sensitive surfaces 831 and other input equipments 832.Touch sensitive surface 831, also referred to as touch display screen or Trackpad are collected and are used
Family on it or neighbouring touch operation (such as user using any suitable object or attachment such as finger, stylus in touch-sensitive table
Operation on face 831 or near touch sensitive surface 831), and corresponding attachment device is driven according to preset formula.It is optional
, touch sensitive surface 831 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used
The touch orientation at family, and the signal that touch operation is brought is detected, transmit a signal to touch controller;Touch controller is from touch
Touch information is received in detection device, and is converted into contact coordinate, then gives processor 880, and can receive processor 880
The order sent simultaneously is executed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves
Realize touch sensitive surface 831.In addition to touch sensitive surface 831, input unit 830 can also include other input equipments 832.Specifically,
Other input equipments 832 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.),
It is one or more in trace ball, mouse, operating lever etc..
Display unit 840 can be used for showing information input by user or be supplied to user information and equipment 80 it is each
Kind graphical user interface, these graphical user interface can be made of figure, text, icon, video and its arbitrary combination.It is aobvious
Show that unit 840 may include display panel 841, optionally, LCD (Liquid Crystal Display, liquid crystal display may be used
Device), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display panel 841.
Further, touch sensitive surface 831 can be covered on display panel 841, when touch sensitive surface 831 detects on it or nearby
After touch operation, processor 880 is sent to determine the type of touch event, is followed by subsequent processing class of the device 880 according to touch event
Type provides corresponding visual output on display panel 841.Although in fig. 8, touch sensitive surface 831 is to make with display panel 841
Realize input and input function for two independent components, but in some embodiments it is possible to by touch sensitive surface 831 with it is aobvious
Show that panel 841 is integrated and realizes and outputs and inputs function.
Terminal 800 may also include at least one sensor 850, such as optical sensor, motion sensor and other sensings
Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 841, and proximity sensor can close display when terminal 800 is moved in one's ear
Panel 841 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally
Three axis) acceleration size, size and the direction of gravity are can detect that when static, can be used to identify mobile phone posture application (ratio
Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);Extremely
In other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared sensors that terminal 800 can also configure, herein
It repeats no more.
Voicefrequency circuit 860, loud speaker 821, microphone 822 can provide the audio interface between user and terminal 800.Audio
The transformed electric signal of the audio data received can be transferred to loud speaker 821 by circuit 860, and sound is converted to by loud speaker 821
Sound signal exports;On the other hand, the voice signal of collection is converted to electric signal by microphone 822, after being received by voicefrequency circuit 860
Be converted to audio data, then by after the processing of audio data output processor 880, through RF circuits 810 to be sent to another equipment, or
Person exports audio data to memory 820 to be further processed.Voicefrequency circuit 860 is also possible that earphone jack, to carry
For the communication of peripheral hardware earphone and terminal 800.
WiFi belongs to short range wireless transmission technology, and terminal 800 can help user's transceiver electronics by WiFi module 870
Mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 8 is shown
WiFi module 870, but it is understood that, and it is not belonging to must be configured into for terminal 800, completely it can exist as needed
Do not change in the range of the essence of invention and omits.
Processor 880 is the control centre of terminal 800, utilizes each portion of various interfaces and connection whole equipment
Point, by running or execute the software program and/or module that are stored in memory 820, and calls and be stored in memory 820
Interior data execute the various functions and processing data of terminal 800, to carry out integral monitoring to equipment.Optionally, processor
880 may include one or more processing cores;Optionally, processor 880 can integrate application processor and modem processor,
Wherein, the main processing operation system of application processor, user interface and application program etc., modem processor mainly handles nothing
Line communicates.It is understood that above-mentioned modem processor can not also be integrated into processor 880.
Terminal 800 further includes the power supply 890 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity
Management system and processor 880 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system
The functions such as management.Power supply 890 can also include one or more direct current or AC power, recharging system, power supply event
Hinder the random components such as detection circuit, power supply changeover device or inverter, power supply status indicator.
Although being not shown, terminal 800 can also include camera, bluetooth module etc., and details are not described herein.
Terminal 800 further includes having the either more than one program one of them or more than one of memory and one
Program is stored in memory, and is configured to be executed by one or more than one processor so that terminal 800 is able to carry out
The above-mentioned scaling method executed by terminal.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that completely or partially being walked in the scaling method of realization above-described embodiment
Suddenly it can be completed by hardware, relevant hardware can also be instructed to complete by program, the program can be stored in
In a kind of computer readable storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of scaling method, which is characterized in that the method includes:
The scaling of operating system is obtained, the scaling is indicated for the pantograph ratio of the pixel number dpi of per inch
Example;
When there are when original display element to be shown, being chosen and the contracting in the resource file of application program in user interface
The corresponding Zoom display element of ratio is put, the resource file has for storing m corresponding with the original display element
The Zoom display element of different zoom ratio, m are positive integer;
It is drawn in the user interface and shows Zoom display element corresponding with the scaling;
Wherein, the original display element be without scaling display elements, the Zoom display element be by scaling and
Clarity is higher than the display elements of predetermined threshold, the display content phase of the original display element and the Zoom display element
Together.
2. according to the method described in claim 1, it is characterized in that, described when there are original displays to be shown in user interface
When element, Zoom display element corresponding with the scaling is chosen in the resource file of the application program, including:
When, there are when original display element to be shown, obtaining the first file of the original display element in the user interface
Name, first filename is for original display element described in unique mark;
According to first filename of the original display element and the scaling, the is generated by default transformation rule
Two filenames, the default transformation rule are to convert first filename and the scaling to second filename
Rule, second filename is for Zoom display element described in unique mark;
The Zoom display element corresponding with second filename is chosen in the resource file.
3. according to the method described in claim 2, it is characterized in that, first text according to the original display element
Part name and the scaling generate the second filename by default transformation rule, including:
First filename is split to obtain root name and suffix portion, the root name is for indicating the original
The title content of beginning display elements, the format identification (FID) are used to indicate the Format Type of the original display element;
The default transformation rule corresponding with the root name is obtained, the default transformation rule includes the master file
The splicing sequence of name, the scaling and the suffix portion;
According to splicing sequence, the root name, the scaling and the suffix portion are spliced, institute is obtained
State the second filename.
4. according to the method described in claim 1, it is characterized in that, before the scaling for obtaining operating system, also wrap
It includes:
Dpi perception values are set to the operating system, the dpi perception values, which are used to indicate, forbids the system of the operating system to contract
It puts program and processing is zoomed in and out to the original display element;
Wherein, the system scaling program is operating system acquiescence for the original display element to be zoomed in and out place
The scaling program of reason.
5. according to the method described in claim 4, it is characterized in that, the dpi perception values include:First value and second takes
Value, it is described to be arranged before the dpi perception values, further include:
The version information of the operating system is obtained, the version information belongs to first kind version information or the second class version letter
It ceases, the version number in the first kind version information is below the version number in the second class version information;
The setting dpi perception values include:
When the version information belongs to the first kind version information, it is first value, institute that the dpi perception values, which are arranged,
The first value is stated to be additionally operable to indicate that the application program obtains the behaviour in the application program launching to the operating system
Make the current scaling of system;Or,
When the version information belongs to the second class version information, it is second value, institute that the dpi perception values, which are arranged,
The second value is stated for indicating that the application program obtains the operation in the application program launching to the operating system
The current scaling of system, and the application program is when receiving the dpi change informations that the operating system is sent,
And the current scaling of the operating system is obtained according to the dpi change informations, the dpi change informations are used for table
Show that the current scaling of the operating system is reset.
6. a kind of scaling processing device, which is characterized in that described device includes:
First acquisition module, the scaling for obtaining operating system, the scaling are indicated for the picture of per inch
The scaling of vegetarian refreshments number dpi;
Choose module, for when in user interface there are when original display element to be shown, in the resource file of application program
Middle to choose Zoom display element corresponding with the scaling, the resource file is for storing and the original display element
The corresponding m Zoom display elements with different zoom ratio, m is positive integer;
Display module, for Zoom display element corresponding with the scaling to be drawn and shown in the user interface;
Wherein, the original display element be without scaling display elements, the Zoom display element be by scaling and
Clarity is higher than the display elements of predetermined threshold, the display content phase of the original display element and the Zoom display element
Together.
7. device according to claim 6, which is characterized in that the selection module, including:
Acquiring unit, generation unit and selection unit;
The acquiring unit, for when, there are when original display element to be shown, acquisition is described original in the user interface
First filename of display elements, first filename is for original display element described in unique mark;
The generation unit, for according to first filename of the original display element and the scaling, passing through
Default transformation rule generates the second filename, and the default transformation rule is to turn first filename and the scaling
The rule of second filename is turned to, second filename is for Zoom display element described in unique mark;
The selection unit, for choosing the Zoom display member corresponding with second filename in the resource file
Element.
8. device according to claim 7, which is characterized in that the generation unit, including:
It splits subelement, obtain subelement and splicing subelement;
The fractionation subelement obtains root name and suffix portion, the master for being split first filename
Filename is used to indicate the title content of the original display element, and the format identification (FID) is for indicating the original display element
Format Type;
The acquisition subelement, for obtaining the default transformation rule corresponding with the root name, the default conversion
Rule includes the splicing sequence of the root name, the scaling and the suffix portion;
The splicing subelement is used for according to splicing sequence, by the root name, the scaling and the suffix
Part is spliced, and second filename is obtained.
9. device according to claim 6, which is characterized in that described device further includes:
Setup module, for dpi perception values to be arranged to the operating system, the dpi perception values, which are used to indicate, forbids the behaviour
The system scaling program for making system zooms in and out processing to the original display element;
Wherein, the system scaling program is operating system acquiescence for the original display element to be zoomed in and out place
The scaling program of reason.
10. device according to claim 9, which is characterized in that the dpi perception values include:First value and second takes
Value, described device further include:
Second acquisition module, the version information for obtaining the operating system, the version information belong to first kind version letter
Breath or the second class version information, the version number in the first kind version information are below the version in the second class version information
This number;
The setup module includes:First setting unit or the second setting unit;
First setting unit, for the dpi senses when the version information belongs to the first kind version information, to be arranged
Know that value is first value, first value is additionally operable to indicate the application program in the application to the operating system
Program obtains the operating system current scaling when starting;
Second setting unit, for the dpi senses when the version information belongs to the second class version information, to be arranged
Know that value is second value, second value is used to indicate that the application program applies journey described to the operating system
Sequence obtains the operating system current scaling when starting, and the application program is receiving the operating system
When the dpi change informations of transmission, and the current scaling of the operating system is obtained according to the dpi change informations,
The dpi change informations are used to indicate that the current scaling of the operating system to be reset.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710254394.7A CN108734656A (en) | 2017-04-18 | 2017-04-18 | Scaling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710254394.7A CN108734656A (en) | 2017-04-18 | 2017-04-18 | Scaling method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108734656A true CN108734656A (en) | 2018-11-02 |
Family
ID=63924236
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710254394.7A Pending CN108734656A (en) | 2017-04-18 | 2017-04-18 | Scaling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108734656A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112131121A (en) * | 2020-09-27 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Fuzzy detection method and device for user interface, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102023803A (en) * | 2010-12-04 | 2011-04-20 | 鸿富锦精密工业(深圳)有限公司 | Electronic reading device and preview method thereof |
CN103336787A (en) * | 2013-06-05 | 2013-10-02 | 百度在线网络技术(北京)有限公司 | Method and device for zooming webpage |
CN103915072A (en) * | 2014-03-24 | 2014-07-09 | 京东方科技集团股份有限公司 | Display system and driving method thereof |
CN104598131A (en) * | 2015-01-15 | 2015-05-06 | 小米科技有限责任公司 | Method and device for adjusting page display mode |
CN104732486A (en) * | 2015-03-23 | 2015-06-24 | 海信集团有限公司 | Picture display method and device |
US20150316994A1 (en) * | 2013-01-07 | 2015-11-05 | Samsung Electronics Co., Ltd. | Content zooming method and terminal implementing the same |
CN106484693A (en) * | 2015-08-25 | 2017-03-08 | 普天信息技术有限公司 | Map-indication method, picture block storage method and picture display terminal |
-
2017
- 2017-04-18 CN CN201710254394.7A patent/CN108734656A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102023803A (en) * | 2010-12-04 | 2011-04-20 | 鸿富锦精密工业(深圳)有限公司 | Electronic reading device and preview method thereof |
US20150316994A1 (en) * | 2013-01-07 | 2015-11-05 | Samsung Electronics Co., Ltd. | Content zooming method and terminal implementing the same |
CN103336787A (en) * | 2013-06-05 | 2013-10-02 | 百度在线网络技术(北京)有限公司 | Method and device for zooming webpage |
CN103915072A (en) * | 2014-03-24 | 2014-07-09 | 京东方科技集团股份有限公司 | Display system and driving method thereof |
CN104598131A (en) * | 2015-01-15 | 2015-05-06 | 小米科技有限责任公司 | Method and device for adjusting page display mode |
CN104732486A (en) * | 2015-03-23 | 2015-06-24 | 海信集团有限公司 | Picture display method and device |
CN106484693A (en) * | 2015-08-25 | 2017-03-08 | 普天信息技术有限公司 | Map-indication method, picture block storage method and picture display terminal |
Non-Patent Citations (1)
Title |
---|
MARIO_Q: "OpenGL超级宝典笔记——纹理映射Mipmap", 《HTTPS://MY.OSCHINA.NET/SWEETDARK/BLOG/177812》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112131121A (en) * | 2020-09-27 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Fuzzy detection method and device for user interface, electronic equipment and storage medium |
CN112131121B (en) * | 2020-09-27 | 2021-09-28 | 腾讯科技(深圳)有限公司 | Fuzzy detection method and device for user interface, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10956280B2 (en) | Data backup method, electronic device, and storage medium | |
CN109062467B (en) | Split screen application switching method and device, storage medium and electronic equipment | |
US9740671B2 (en) | Method and apparatus of generating a webpage from an original design file comprising layers | |
CN104298491B (en) | Message treatment method and device | |
CN104427074B (en) | A kind of methods, devices and systems for showing incoming information | |
US20170316781A1 (en) | Remote electronic service requesting and processing method, server, and terminal | |
CN104967790B (en) | Method, photo taking, device and mobile terminal | |
US11658932B2 (en) | Message sending method and terminal device | |
US9760998B2 (en) | Video processing method and apparatus | |
CN104571979B (en) | A kind of method and apparatus for realizing split view | |
CN106547844B (en) | A kind for the treatment of method and apparatus of user interface | |
CN103854298A (en) | Method for integrating pictures with two-dimension codes and terminal | |
JP6910300B2 (en) | A method for displaying chat history records and a device for displaying chat history records | |
CN108984064A (en) | Multi-screen display method, device, storage medium and electronic equipment | |
CN108549519A (en) | split screen processing method, device, storage medium and electronic equipment | |
CN103390034A (en) | Image display method, device, terminal and server | |
CN109062468A (en) | Multi-screen display method, device, storage medium and electronic equipment | |
CN109067981A (en) | Split screen application switching method, device, storage medium and electronic equipment | |
CN108958606A (en) | Multi-screen display method, device, storage medium and electronic equipment | |
CN108932094A (en) | Split screen application switching method, device, storage medium and electronic equipment | |
CN108984142A (en) | Multi-screen display method, device, storage medium and electronic equipment | |
JP2021532492A (en) | Character input method and terminal | |
CN112749074A (en) | Test case recommendation method and device | |
CN105095161B (en) | Method and device for displaying rich text information | |
CN111142759B (en) | Information sending method and electronic equipment |
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 |
Application publication date: 20181102 |
|
RJ01 | Rejection of invention patent application after publication |