CN114816606B - Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium - Google Patents

Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium Download PDF

Info

Publication number
CN114816606B
CN114816606B CN202110118632.8A CN202110118632A CN114816606B CN 114816606 B CN114816606 B CN 114816606B CN 202110118632 A CN202110118632 A CN 202110118632A CN 114816606 B CN114816606 B CN 114816606B
Authority
CN
China
Prior art keywords
scale
window
adjusted
mark
offset
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
CN202110118632.8A
Other languages
Chinese (zh)
Other versions
CN114816606A (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.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision 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 Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202110118632.8A priority Critical patent/CN114816606B/en
Publication of CN114816606A publication Critical patent/CN114816606A/en
Application granted granted Critical
Publication of CN114816606B publication Critical patent/CN114816606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/048Indexing scheme relating to G06F3/048
    • G06F2203/04806Zoom, i.e. interaction techniques or interactors for controlling the zooming operation

Landscapes

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

Abstract

The disclosure provides a self-adaptive adjustment method and device for a window graduated scale, electronic equipment and a medium, and relates to the technical field of graphic processing. The window comprises a graduated scale, the graduated scale comprises graduated lines, the graduated lines are used for representing the size of any side of the window, and the method comprises the following steps: adjusting the display size of the window according to the window adjusting instruction; determining the number of pixels on either side of the adjusted window; determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels; determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and preset scale mark related parameters; and displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark. According to the scheme, the positions and the scale values of the scale marks are changed along with the display size change of the window, and the scale marks can be always adjusted along with the size of the window, so that a proper number of scale marks can be kept in the window.

Description

Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of graphic processing, in particular to a self-adaptive adjustment method and device of a window graduated scale, electronic equipment and a medium.
Background
With the development of the internet and intelligent terminals, various programs are developed to satisfy the use of people. Specific programs include a program for creating a 3D animation, a program for drawing a picture, and the like, and some programs include a display window for satisfying functions corresponding to the programs. In some display windows, it is necessary to display scale values in the window in order to make it easy and intuitive to see the size of the corresponding data in the window, such as the size of the image material.
In the prior art, when the scale is displayed in the window, the displayed scale cannot be changed along with the change of the window, when the window is smaller, the scale is invisible due to too small size, and when the window is larger, the scale cannot play a role due to too large scale interval.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, there is provided a method for adaptively adjusting a window scale, a window comprising a scale, the scale comprising graduation marks, the graduation marks being used to characterize the size of any side of the window, the method comprising:
adjusting the display size of the window according to the window adjusting instruction;
determining the number of pixels on either side of the adjusted window;
determining a first scaling factor after the graduated scale is adjusted and the offset of the graduated scale based on the pixel number;
determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and preset scale mark related parameters;
and displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
In a second aspect, there is also provided an adaptive adjustment device for a window scale, the device comprising:
the adjusting module is used for adjusting the display size of the window according to the window adjusting instruction;
a pixel acquisition module for determining the number of pixels on either side of the adjusted window;
the parameter determining module is used for determining a first scaling factor after the graduated scale is adjusted and the offset of the graduated scale based on the pixel quantity;
The scale mark determining module is used for determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameter;
and the scale display module is used for displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
In a third aspect, there is also provided an electronic device comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: the adaptive adjustment method of the window scale of the first aspect of the present disclosure is performed.
In a fourth aspect, there is also provided a medium having stored thereon a computer program which when executed by a processor implements the method of adaptive adjustment of a window scale of the first aspect of the present disclosure.
Compared with the prior art, the embodiment of the disclosure provides a self-adaptive adjustment method, a device, electronic equipment and a medium for a window graduated scale, wherein after the display size of a window is adjusted, the number of pixels on any side of the adjusted window is obtained; determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels; and determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters. The positions and the scale values of the scale marks are changed along with the size change of the window, the adjusted scale marks are displayed in the window according to the positions and the scale values of the scale marks, and the scale marks can be always adjusted along with the size of the window, so that a proper number of scale marks are kept in the window, a user can have macroscopic understanding on data, and detail can be mastered.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a schematic flow chart of a method for adaptively adjusting a window scale according to an embodiment of the disclosure;
FIG. 2 is a schematic view of an in-window display scale provided in an embodiment of the present disclosure;
FIG. 3 is a schematic view of the scale lines of the scale within the window as a function of the window provided by embodiments of the present disclosure;
FIG. 4 is a detailed flowchart of step S104 in FIG. 1;
FIG. 5 is a detailed flowchart of step S404 in FIG. 4;
fig. 6 is a schematic structural diagram of an adaptive adjustment device for a window scale according to an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of an electronic device for adaptive adjustment of a window scale according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure provides a self-adaptive adjustment method, device, electronic device and medium for window scale, which aims to solve the above technical problems in the prior art.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
It will be appreciated by those skilled in the art that the "terminal" described in the embodiments of the present disclosure may be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant ), a MID (Mobile Internet Device, mobile internet device), or the like.
Referring to fig. 1, an embodiment of the present disclosure provides an adaptive adjustment method for a window scale, which is applied to an electronic device, where the electronic device may be a terminal. The window comprises a graduated scale, the graduated scale comprises graduated lines, and the graduated lines are used for representing the size of any side of the window. The method comprises the following steps:
Step S101: and adjusting the display size of the window according to the window adjusting instruction.
Referring to fig. 2, the electronic device includes a display device capable of displaying a window. Alternatively, the window may include a drawing window of a drawing tool, a word window, or the like. word is a word processor application from microsoft corporation. The window comprises a graduated scale, the graduated scale comprises graduated lines, and the graduated lines are used for representing the display size of any side of the window.
The window adjustment instructions may be generated by a user manipulating the electronic device, such as by the user panning, zooming, or adjusting a length or width of the window by manipulating the electronic device. The user operates the electronic equipment to adjust the window, and the electronic equipment can receive the window adjusting instruction, so that the size of the window is adjusted according to the window adjusting instruction. In the disclosed embodiments, the window is resized, including but not limited to scaling the window, resizing the window in a first direction X, resizing the window in a second direction Y, and translating the window. It will be appreciated that the window is translated, i.e. the window is resized to zero. The first direction may be perpendicular to the second direction.
Step S102: the number of pixels on either side of the adjusted window is obtained.
The window is displayed on the display screen, the display screen can display pixels with certain length and width, and the window is displayed in the display screen, so that the length and the width of the window occupy certain pixels, and the number of pixels at the edge of the window can be obtained. Any side of the window is a side of the window which is correspondingly displayed by the graduated scale, and can be a long side of the window or a wide side of the window. In the embodiment of the present disclosure, explanation and explanation are made with the long side a of the window extending in the first direction as the target side.
Step S103: and determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels.
In embodiments of the present disclosure, at least one scale may be included, each scale characterizing the size of one edge of the window, respectively.
The first scaling factor after the scale is adjusted, namely the scaling factor when the scale is not scaled relative to the scale. The first scaling factor is greater than 0, may be less than 1, or may be greater than 1. When the first scaling multiple is larger than 1, the scale needs to be enlarged when the relative scale is not scaled, and when the first scaling multiple is larger than 0 and smaller than 1, the scale needs to be reduced when the relative scale is not scaled. When the graduated scale is enlarged, the measuring range of the graduated scale can be enlarged, and when the graduated scale is reduced, the measuring range of the graduated scale can be reduced.
The offset of the graduated scale is the number of pixels of the zero graduation of the graduation mark relative to the preset datum point after the window is adjusted. The specific position of the reference point of the window is not limited, and the preset reference point of the window may be the end point of the edge of the window, which is characterized by the scale, such as the end point of the first edge.
When the scale marks of the scale are displayed, the scale marks are judged and displayed by taking the datum points as the datum points. In the embodiment of the present disclosure, the left end point b of the edge a is taken as a reference point for illustration. If the initial number of pixels of the zero scale of the scale mark relative to the reference point before window adjustment is 10 pixels. The number of initial pixels of the zero scale of the scale mark relative to the reference point before the window adjustment may be described as follows, for example, when the scale is not offset, the initial offset pixel of the zero scale of the scale mark relative to the first direction of the reference point is x1, the zero scale of the scale mark is set as an initial endpoint, the number of offset pixels of the zero scale of the scale mark relative to the initial endpoint, that is, the initial offset is offset, and the number of initial pixels of the zero scale of the scale mark relative to the reference point is x1+offset. The zero scale of the scale mark is offset to the initial end point by an initial offset amount offset, and is offset to the positive direction of the first direction by a negative number, and offset to the negative direction of the first direction by a positive number. When the scale is not offset, the zero scale of the scale is x1 with respect to the initial offset pixel in the first direction of the reference point, and is offset to the positive direction of the first direction by a negative number, and is offset to the negative direction of the first direction by a positive number.
The display size of the window changes, and the number of pixels at the edges of the window may also change. If the window is rectangular, the window includes a first side and a second side. The first side may be a long side of a rectangle and the second side may be a wide side of the rectangle. In the embodiment of the disclosure, the first edge of the window is represented by a scale.
If the display size of the window is changed, the number of pixels on the first side of the window is changed to be 2 times of that of the original pixels, and the number of pixels on the second side of the window is not changed. The first scale factor of the scale and the offset of the scale may also be varied in order for the scale to display the correct dimensions. Specifically, if the size change of the first edge of the window is too small, the scale does not need to be scaled and translated, i.e. the first scaling multiple of the scale and the offset of the scale do not need to be changed, so that the size of the first edge of the window can be displayed. If the scale includes a positive range and a negative range, the window is located in the positive range of the scale before the display size is adjusted, and the size of the window is excessively changed, the scale may need to be enlarged, and the window is located in the positive range and the negative range of the scale at the same time, so that the first scaling multiple of the scale and the offset of the scale need to be changed.
Step S104: and determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters.
The position is the position of each scale mark, and the scale value of the scale mark is the scale value of the scale mark.
Specifically, after the first scaling factor and the offset are determined, the position of the graduated scale can be correspondingly adjusted, namely, the size of the graduated scale is adjusted according to the first scaling factor, and the position of the zero graduation of the graduated scale relative to the datum point is adjusted according to the offset. It will be appreciated that the scale does not have to be adjusted when the first scale factor and offset are unchanged.
When the first scaling factor and the offset change, the size of the graduated scale may not be suitable for display, if the distance between the main graduations is too small to be seen clearly, the distance between the graduated scales is too large, and according to the first scaling factor, the offset and the preset relevant parameters of the graduation marks, the proper positions of the graduation marks and the graduation values corresponding to the graduation marks can be determined.
In the present disclosure, the tick marks may include a first tick mark and a second tick mark, with at least one second tick mark located between two first tick marks. The second graduation line has a narrower width than the second graduation line. In the embodiment of the disclosure, the scale mark of the scale can be adaptively changed along with the adjustment of the size of the window. If the first graduation line can be a centimeter graduation line, the second graduation line can be a millimeter graduation line.
The related parameters of the graduation line comprise a preset scaling base number of the graduation line, a graduation scale and a preset part divided by the first graduation line when the graduation line is not scaled.
The preset scaling base of the scale lines is a critical state of switching between the first scale lines and the second scale lines, namely, the distance between the second scale lines reaches the minimum distance of the first scale lines, the position of the second scale lines is displayed as the first scale lines, and new second scale lines are added between the first scale lines again. Specifically, if the scale is not scaled, 1 first scale line is set for every 100 pixels, the display values of every two adjacent first scale lines differ by 1, 9 second scale lines are set between the two first scale lines, that is, one second scale line is set for every 10 pixels between the first scale lines. If the scale is enlarged by 10 times, setting a first scale line every 1000 pixels, and setting a second scale line every 100 pixels between the first scale lines. If the preset scaling radix of the scale lines is 10, the second scale lines are enlarged by 10 times, in order to enable the density of the scale lines to be proper, no scale exists among the pixels with excessive numbers, the magnification of the scale lines reaches the scaling radix 10, the positions of the second scale lines need to be changed into first scale lines, the second scale lines are added between the first scale lines again, at the moment, 1 first scale line is still arranged every 100 pixels, one second scale line is arranged every 10 pixels, and the display numerical values between every two first scale lines differ by 0.1.
When the scale and the scale line are not scaled, one unit scale is divided into preset parts by the first scale lines, for example, when the scale is not scaled, the pixels between one unit scale are 800 pixels, and when the scale line is not scaled, one unit scale is divided into 8 parts by the first scale lines, and then 100 pixels are included between every two first scale lines.
After the offset is determined, the origin of the scale mark can be determined, and then the position of the scale mark and the numerical value to be displayed by the scale mark can be determined according to the first scaling multiple and the preset scale mark related parameters. Namely, the position and the scale value of the scale line after the scale line is adjusted are determined.
Step S105: and displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
After the positions and the scale values of the scale marks are determined, the adjusted scale marks can be displayed in the window according to the positions and the scale values of the scale marks. It will be appreciated that if the window has a small amplitude of change, the scale mark may be adjusted to a degree of 0, i.e. neither the position nor the scale value is changed.
Referring to fig. 2 and fig. 3 together, fig. 3 is a schematic diagram showing the adjusted scale marks in the window after the window is changed. Wherein the window is scaled down and translated in size, but enlarged on the display interface for clarity of display. The scale marks change according to the size of the window, the scale values on the first scale marks change, and the scale marks keep proper quantity in the window, so that a user can observe the scale marks and the scale values conveniently.
According to the self-adaptive adjustment method of the window graduated scale, after the display size of the window is adjusted, the number of pixels on any side of the adjusted window is obtained; determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels; and determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters. The positions and the scale values of the scale marks are changed along with the size change of the window, the adjusted scale marks are displayed in the window according to the positions and the scale values of the scale marks, and the scale marks can be always adjusted along with the size of the window, so that a proper number of scale marks are kept in the window, a user can have macroscopic understanding on data, and detail can be mastered.
Optionally, one of two endpoints of either side is a reference point, and determining, based on the number of pixels, a first scaling factor after adjusting the scale and an offset of the scale, includes:
and determining a first scaling factor after the scale is adjusted and the offset of the scale based on the number of pixels, the initial number of pixels of the zero scale of the scale mark before the window is adjusted relative to the reference point, the scaling factor of the scale before the window is adjusted, related parameters of the scale and the number of unit pixels corresponding to one unit scale when the scale is not scaled.
The related parameters of the graduated scale comprise the positive measuring range, the negative measuring range and the maximum scaling multiple of the graduated scale. If the positive range of the graduated scale is positive 25 unit graduations, the negative range is negative 25 unit graduations. The maximum scaling factor of the scale, i.e. the maximum scaling factor allowed by the scale, may be, for example, 100.
The first scaling factor after the scale is adjusted and the offset of the scale can be calculated based on the following formula:
when W is smaller than Vmax multiplied by L multiplied by s-x, determining that the first scaling factor is the scaling factor before window adjustment, and determining that the offset of the graduated scale is the offset of the graduated scale before window adjustment; wherein W is the number of pixels, vmax is a positive scale, L is the number of unit pixels corresponding to one unit scale when the scale is not scaled, s is the scaling multiple of the scale before window adjustment, x is the initial number of pixels of the zero scale of the scale before window adjustment relative to the datum point, and the offset is the number of pixels of the zero scale of the scale mark after window adjustment relative to the datum point.
When W < Vmax x L x s-x, the width of the pixel number of the target side is proper, the first scaling multiple of the scale and the offset of the scale are not required to be changed, so that the pixel number of the zero scale of the scale mark after window adjustment relative to the reference point is the same as the pixel number of the zero scale of the scale mark before window adjustment relative to the reference point. The Vmax x L is the pixel length of the scale which can be displayed in the positive range when the scale is not scaled, the Vmax x L x s is the pixel length of the scale which can be displayed in the positive range before the window is adjusted, and the Vmax x L x s-x is the pixel length of the scale which can be displayed in the first direction of the reference point of the window.
When Vmax L X s-X < W < (Vmax-Vmin) X L X s, determining the first scaling factor as the scaling factor before window adjustment, wherein Vmin is a negative range, and calculating the offset X based on the following formula: x=vmax×l×s-W.
When (Vmax-Vmin) x L x s is the pixel length that can be displayed on the scale mark of the scale before window adjustment, vmax x L x s-x < W < (Vmax-Vmin) x L x s, the number of pixels of the window increases, but the number W of pixels on the target side of the window is smaller than the number of pixels that can be displayed on the whole scale of the scale, so that the first scaling factor of the scale does not need to be changed, and the offset of the scale is adjusted.
When (Vmax-Vmin) x L×s < W < (Vmax-Vmin) x L×S, wherein S is the maximum scaling factor of the scale; calculating a first scaling factor based on: s1=w/(Vmax-Vmin) ×l); the offset X is calculated based on the following formula: x=vmax×l×s1-W.
(Vmax-Vmin) x L x S is the maximum measuring range which can be measured and displayed after the graduated scale is subjected to maximum scaling. When (Vmax-Vmin) ×Lxs < W < (Vmax-Vmin) ×LXS, it is explained that the number of pixels of the window becomes larger, but the number of pixels W of the target side of the window is smaller than the number of pixels which can be displayed in the whole measuring range after the scale is enlarged, namely, the first scaling factor and the offset can be calculated based on a formula.
Specifically, if the positive range Vmax of the scale is 30 unit scales, the negative range Vmax of the scale is-30 unit scales, the number of unit pixels L corresponding to one unit scale when the scale is not scaled is 800, the scaling factor S of the scale before window adjustment is 0.5, and the width after window adjustment is 30000, the first scaling factor s1=30000++ ((30- (-30)) ×800) =0.625 can be calculated, the offset x=30X100×0.625-30000= -15000, and the number of pixels of the zero scale of the scale mark after window adjustment relative to the reference point is-15000 pixels, that is, 15000 pixels of the zero scale of the scale mark in the first direction of the reference point is described.
Referring to fig. 4, optionally, determining the position and the scale value of the scale line after adjusting the scale line based on the first scaling factor, the offset, and the preset scale line related parameter includes:
s401: and calculating a second scaling multiple of the scale line when the scale line is adjusted based on the first scaling multiple and a scaling base preset for the scale line.
The second scaling multiple is the scale line phase, i.e. the scaling multiple when the scale line is not scaled relative to the scale line. If the scale line is not scaled, 100 pixels are between two adjacent first scale lines, and if the second scaling multiple is 3, 300 pixels are between two adjacent first scale lines.
In order to make the distribution density of the scale lines suitable, the scale lines are not required to be arranged between a plurality of pixels without scale lines or a plurality of scale lines are required to be arranged between a plurality of pixels, and the second scaling multiple of the scale lines needs to be readjusted so that the second scaling multiple of the scale lines is between 1 and the scaling base. Specifically, the second scaling factor T2 of the tick mark is calculated based on:
when T2 < 1, t2=t1×t n When T2 > T, t2=t1++t n The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is a scaling base, T is greater than 1, T1 is a first scaling multiple, n is a positive integer, and n is a value such that T2 results in 1 < T2 < T. That is, when the first scaling factor T1 < 1, multiplying by T1 by a variable number of T until the result T2 is between 1 and T; at a first scaling factor T1 > T, a different number of T is divided by T1 until the result T2 is between 1 and T. For example, T1 is 0.5 and T is 10, then T1 is multiplied by a T to obtain T2 equal to 5. T2 is between 1 and 10.
S402: and calculating the pixel distance between the two first scale lines after the scale lines are adjusted based on the second scaling multiple and the preset number of parts of the unit scale divided by the first scale lines when the scale and the scale lines are not scaled.
The scaled pixel distance between the two first scale lines is Dpm, and the scaled pixel distance Dpm between the two first scale lines can be calculated based on the following formula:
Dpm=L×T2÷Num。
wherein L is the number of unit pixels corresponding to one unit scale when the scale is not scaled, and Num is the preset number of parts of one unit scale divided by the first scale line when the scale is not scaled and the scale line is not scaled. When the scale and the scale mark are not zoomed, the original state of the scale and the scale mark is the original state of the scale and the scale mark. For example, L is equal to 800, T2 is 5, and Nun is 6, then Dpm is about 666.7.
S403: and calculating the scale distance between the two first scale lines after the scale lines are adjusted based on the preset parts of the scale and the scale base preset by the scale lines when the scale lines are not scaled and the unit scale is divided by the first scale lines.
The scale distance between two first scale lines is Drm, i.e. the scale value of the phase difference between two adjacent first scale lines. The original point of the graduated scale is 0, the graduation value of the first graduation line in the forward direction is Drm, the graduation value of the second graduation line in the forward direction is 2Drm, the graduation value of the third graduation line in the forward direction is 3Drm, and the graduation value of each first graduation line can be determined according to the calculation. The scale distance between the two first scale lines is Drm, and the scale distance Drm between the two first scale lines can be calculated based on the following formula:
Drm=(1÷Num)×T3。
T3 is the ratio of the second scaling factor T2 to the first scaling factor T1.
S404: and determining the position and the scale value of the first scale line after the scale line is adjusted according to the offset, the pixel distance between the two first scale lines after the adjustment and the scale distance between the two first scale lines after the adjustment.
The offset is determined, namely the position of the zero scale of the scale mark can be determined, namely the position and the scale value of the first scale mark can be determined according to the pixel distance after scaling between the two first scale marks and the scale distance between the two first scale marks.
Referring to fig. 5, optionally, determining the position and the scale value of the first scale line after adjusting the scale line according to the offset, the pixel distance between the two adjusted first scale lines, and the scale distance between the two adjusted first scale lines includes:
s501: and determining the position of the first scale mark after the scale mark is adjusted in the window based on the offset and the pixel distance between the two adjusted first scale marks.
And determining the offset, namely determining the position of the zero scale of the scale mark. If the scaled pixel distance between the two first scale lines is L1, the distance zero scale is every L1 pixel, that is, the position of each first scale line, so that the positions of all the first scale lines, including the positions of the first scale lines displayed in the window, can be determined.
S502: the scale value of the first scale line is determined based on the offset and the scale distance between the two first scale lines.
And if the scale distance between the two first scale lines is Drm, displaying the scale value of the 1 st first scale line from the zero scale forward direction as Drm, and displaying the scale value of the n first scale line from the zero scale forward direction as n multiplied by Drm.
Optionally, determining the position and the scale value of the scale line after the scale line is adjusted further includes:
calculating the pixel distance between the two second graduation marks after the graduation marks are adjusted based on the pixel distance between the two adjusted first graduation marks and the preset number of parts divided by the second graduation marks between the two first graduation marks;
and determining the position of the second graduation mark after adjusting the graduation mark based on the position of the first graduation mark after adjusting and the pixel distance between the two second graduation marks after adjusting.
The adjusted pixel distance between the two first graduation lines is L1, the preset number of parts p divided by the second graduation lines between the first graduation lines can be calculated based on the following formula:
L3=L1÷p。
it will be appreciated that the pixel distance between two adjacent second graduations, equal to the distance between a first graduation and an adjacent second graduation, is determined at the location of the first graduation, and that the location of all second graduations can also be determined.
If the distance between each centimeter scale line is 10mm (millimeters) and each two adjacent centimeter scale lines are divided into 10 parts by the millimeter scale line, the distance between each two millimeter scale lines is 10/10=1 mm, and the distance between each centimeter scale line and each adjacent millimeter scale line is 1mm.
Alternatively, when the width of the first scribe line is the first preset width D1, the width D2 of the second scribe line may be calculated based on the following formula:
D2=(D1/(T-1))×(T2-1),
wherein T is a scaling radix, and T2 is a second scaling multiple. The width D1 is not limited, for example, the width of the first scale line D1 may be one pixel number, and the calculated width of the second scale line D2 may be changed according to the change of the second scaling multiple T2 of the scale line, so as to ensure smooth transition between the first scale line and the second scale line in the scaling critical state.
Referring to fig. 6, an embodiment of the disclosure provides an adaptive adjustment device 60 for a window scale, where the adaptive adjustment device for a window scale may implement the adaptive adjustment method for a window scale of the foregoing embodiment, and the adaptive adjustment device 60 for a window scale may include: an adjusting module 601, a side length obtaining module 602, a scale mark determining module 603 and a scale displaying module 604, wherein,
An adjustment module 601, configured to adjust a display size of the window according to a window adjustment instruction;
a pixel acquisition module 602 for determining the number of pixels on either side of the adjusted window;
a parameter determining module 603, configured to determine, based on the number of pixels, a first scaling factor after the scale is adjusted and an offset of the scale;
the scale mark determining module 604 is configured to determine a position and a scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset, and a preset scale mark related parameter;
and the scale display module 605 is configured to display the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
According to the self-adaptive adjusting device of the window graduated scale, after the display size of the window is adjusted, the number of pixels on any side of the adjusted window is obtained; determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels; and determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters. The positions and the scale values of the scale marks are changed along with the size change of the window, the adjusted scale marks are displayed in the window according to the positions and the scale values of the scale marks, and the scale marks can be always adjusted along with the size of the window, so that a proper number of scale marks are kept in the window, a user can have macroscopic understanding on data, and detail can be mastered.
The parameter determining module 603 is specifically configured to determine the first scaling factor after the adjustment of the scale and the offset of the scale based on the number of pixels, the initial number of pixels of the zero scale of the scale line relative to the reference point before the window adjustment, the scaling factor of the scale before the window adjustment, the scale related parameter, and the number of unit pixels corresponding to one unit scale when the scale is not scaled.
The tick mark determining module 604 may include:
the first calculation unit is used for calculating a second scaling multiple of the scale line when the scale line is adjusted based on the first scaling multiple and a scaling base preset by the scale line;
the second calculating unit is used for calculating the pixel distance between the two first scale lines after the scale lines are adjusted based on the second scaling multiple and the preset number of parts, which is divided by the first scale lines, of a unit scale when the scale and the scale lines are not scaled;
the third calculation unit is used for calculating the scale distance between the two first scale lines after the scale lines are adjusted based on the preset parts of the scale marks divided by the first scale lines and the preset scaling base number of the scale lines when the scale bars and the scale lines are not scaled;
And the fourth calculation unit is used for determining the position and the scale value of the first scale line after the adjustment of the scale line according to the offset, the pixel distance between the two adjusted first scale lines and the scale distance between the two adjusted first scale lines.
Wherein the fourth calculation unit may include:
a position determining unit, configured to determine a position of a first scale line in the window after the scale line is adjusted, based on the offset and the adjusted pixel distance between the two first scale lines;
and the scale value determining unit is used for determining the scale value of the first scale line after the scale line is adjusted based on the offset and the scale distance between the two adjusted first scale lines.
Wherein, the tick mark determining module 604 may further include:
a fifth calculating unit, configured to calculate a pixel distance between the two adjusted second graduation marks based on the adjusted pixel distance between the two first graduation marks and a preset number of parts divided by the second graduation marks between the two first graduation marks;
And a sixth calculation unit, configured to determine a position of the second tick mark after adjustment of the tick mark based on the position of the first tick mark after adjustment and a pixel distance between the two second tick marks after adjustment.
Referring to fig. 7, a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in the drawings is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 701 hereinafter, the memory may include at least one of a Read Only Memory (ROM) 702, a Random Access Memory (RAM) 703, and a storage device 708 hereinafter, as specifically shown below:
As shown, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage means 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While an electronic device 700 having various means is shown, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 709, or installed from storage 708, or installed from ROM 702. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 701.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: after the display size of the window is adjusted, the number of pixels on any side of the adjusted window is obtained; determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels; and determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters. The positions and the scale values of the scale marks are changed along with the size change of the window, the adjusted scale marks are displayed in the window according to the positions and the scale values of the scale marks, and the scale marks can be always adjusted along with the size of the window, so that a proper number of scale marks are kept in the window, a user can have macroscopic understanding on data, and detail can be mastered.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not constitute a limitation of the unit itself in some cases, for example, the position determining unit may also be described as a "position calculating unit".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided an adaptive adjustment method of a window scale, including:
adjusting the display size of the window according to the window adjusting instruction;
determining the number of pixels on either side of the adjusted window;
determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels;
determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and preset scale mark related parameters;
and displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
According to one or more embodiments of the present disclosure, one of two end points of either side is a reference point, and determining, based on the number of pixels, a first scaling factor and an offset of the scale after the scale is adjusted, includes:
and determining a first scaling factor after the scale is adjusted and the offset of the scale based on the number of pixels, the initial number of pixels of the zero scale of the scale mark before the window is adjusted relative to the reference point, the scaling factor of the scale before the window is adjusted, related parameters of the scale and the number of unit pixels corresponding to one unit scale when the scale is not scaled.
According to one or more embodiments of the present disclosure, the scale line includes a first scale line, and the scale line related parameter includes a scaling base preset for the scale line, a scale and a preset number of parts divided by the first scale line by a unit scale when the scale line is not scaled;
based on the first scaling multiple, the offset and preset scale mark related parameters, determining the position and the scale value of the scale mark after the scale mark is adjusted comprises the following steps:
calculating a second scaling multiple of the scale line when the scale line is adjusted based on the first scaling multiple and a scaling base preset for the scale line;
calculating the pixel distance between the two first scale lines after the scale lines are adjusted based on the second scaling multiple and the preset parts of one unit scale divided by the first scale lines when the scale and the scale lines are not scaled;
calculating the scale distance between two first scale lines after the scale lines are adjusted based on the preset parts of the scale and the scale base preset by the scale lines when the scale lines are not scaled and the unit scale is divided by the first scale lines;
and determining the position and the scale value of the first scale line after the scale line is adjusted according to the offset, the pixel distance between the two first scale lines after the adjustment and the scale distance between the two first scale lines after the adjustment.
According to one or more embodiments of the present disclosure, determining a position and a scale value of a first scale line after adjustment of the scale line according to an offset, a pixel distance between two first scale lines after adjustment, and a scale distance between two first scale lines after adjustment, includes:
determining the positions of the first scale marks after the scale marks are adjusted in the window based on the offset and the pixel distance between the two adjusted first scale marks;
and determining the scale value of the first scale line after the scale line is adjusted based on the offset and the scale distance between the two adjusted first scale lines.
According to one or more embodiments of the present disclosure, the tick mark further comprises a second tick mark, and the tick mark related parameter further comprises a preset number of parts between the two first tick marks divided by the second tick mark; determining the position and the scale value of the scale line after the scale line is adjusted, and further comprising:
calculating the pixel distance between the two second graduation marks after the graduation marks are adjusted based on the pixel distance between the two adjusted first graduation marks and the preset number of parts divided by the second graduation marks between the two first graduation marks;
and determining the position of the second graduation mark after adjusting the graduation mark based on the position of the first graduation mark after adjusting and the pixel distance between the two second graduation marks after adjusting.
According to one or more embodiments of the present disclosure, there is provided an adaptive adjustment device for a window scale, comprising:
the adjusting module is used for adjusting the display size of the window according to the window adjusting instruction;
a pixel acquisition module for determining the number of pixels on either side of the adjusted window;
the parameter determining module is used for determining a first scaling factor and an offset of the graduated scale after the graduated scale is adjusted based on the number of pixels;
the scale mark determining module is used for determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameters;
the scale display module is used for displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
According to one or more embodiments of the present disclosure, the parameter determining module is specifically configured to determine the first scaling factor after the scale is adjusted and the offset of the scale based on the number of pixels, the initial number of pixels of the zero scale of the scale mark relative to the reference point before the window is adjusted, the scaling factor of the scale before the window is adjusted, the scale related parameter, and the number of unit pixels corresponding to one unit scale when the scale is not scaled
In accordance with one or more embodiments of the present disclosure,
the tick mark determination module 704 may include:
the first calculation unit is used for calculating a second scaling multiple of the scale line when the scale line is adjusted based on the first scaling multiple and a scaling base preset for the scale line;
the second calculating unit is used for calculating the pixel distance between the two first scale lines after the scale lines are adjusted based on the second scaling multiple and the preset parts of the scale marks divided by the first scale lines when the scale marks are not scaled;
the third calculation unit is used for calculating the scale distance between the two first scale lines after the scale lines are adjusted based on the preset parts of the scale and the scale base preset by the scale lines when the scale lines are not scaled and the unit scale is divided into the first scale lines;
and the fourth calculation unit is used for determining the position and the scale value of the first scale line after the scale line is adjusted according to the offset, the pixel distance between the two adjusted first scale lines and the scale distance between the two adjusted first scale lines.
In accordance with one or more embodiments of the present disclosure,
the fourth calculation unit may include:
The position determining unit is used for determining the position of the first scale mark after the scale mark is adjusted in the window based on the offset and the pixel distance between the two adjusted first scale marks;
the scale value determining unit is used for determining the scale value of the first scale line after the scale line is adjusted based on the offset and the scale distance between the two adjusted first scale lines.
In accordance with one or more embodiments of the present disclosure,
the tick mark determining module 704 may further include:
a fifth calculating unit, configured to calculate a pixel distance between the two adjusted second graduation marks based on the adjusted pixel distance between the two first graduation marks and a preset number of parts divided by the second graduation marks between the two first graduation marks;
and the sixth calculation unit is used for determining the position of the second graduation mark after adjusting the graduation mark based on the position of the first graduation mark after adjusting and the pixel distance between the two second graduation marks after adjusting.
According to one or more embodiments of the present disclosure, there is provided an electronic device including:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: the adaptive adjustment method of the window scale according to any of the above embodiments is performed.
According to one or more embodiments of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the adaptive adjustment method of a window scale of any of the above embodiments.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (9)

1. An adaptive adjustment method for a window scale, wherein a window includes a scale, the scale includes scale marks, the scale marks are used for representing the size of any side of the window, the method includes:
adjusting the display size of the window according to the window adjusting instruction;
determining the number of pixels on either side of the adjusted window; one of the two endpoints of either side is a datum point;
determining a first scaling factor after adjusting the graduated scale and an offset of the graduated scale based on the number of pixels, the initial number of pixels of the zero graduation of the graduated scale relative to the reference point before the window adjustment, the scaling factor of the graduated scale before the window adjustment, the related parameters of the graduated scale and the number of unit pixels corresponding to one unit graduation when the graduated scale is not scaled; the related parameters of the graduated scale comprise a positive range and a negative range of the graduated scale and the maximum scaling factor of the graduated scale; calculating a first scaling factor after adjusting the graduated scale and an offset of the graduated scale based on the following formula: when W is smaller than Vmax multiplied by L multiplied by s-x, determining the first scaling multiple as the scaling multiple before window adjustment, and determining the offset of the graduated scale as the offset of the graduated scale before window adjustment; when Vmax L X s-X < W < (Vmax-Vmin) X L X s, determining that the first scaling factor is a scaling factor before the window is adjusted, calculating the offset X based on the following formula: x=vmax×l×s-W; when (Vmax-Vmin) ×L×s < W < (Vmax-Vmin) ×L×S), the first scaling factor is calculated based on the following formula: s1=w/(Vmax-Vmin) ×l), the offset X is calculated based on the following formula: x=vmax×l×s1-W; the method comprises the steps of setting a window scale, wherein W is the number of pixels, vmax is the positive range, L is the number of unit pixels corresponding to one unit scale when the window scale is not scaled, S is the scaling multiple of the window scale before the window is adjusted, x is the initial number of pixels of zero scale of the window scale relative to the datum point before the window is adjusted, the offset is the number of pixels of zero scale of the scale mark relative to the datum point after the window is adjusted, vmin is the negative range, and S is the maximum scaling multiple of the window scale;
Determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and preset scale mark related parameters; the related parameters of the scale marks comprise a preset scaling base number of the scale marks, a scale and preset parts, wherein when the scale marks are not scaled, one unit scale is divided into a first scale mark;
and displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
2. The adaptive adjustment method of a window scale according to claim 1, wherein the scale line comprises a first scale line, and the scale line related parameter comprises a preset scaling base number of the scale line, and a preset number of parts of a unit scale divided by the first scale line when the scale line and the scale line are not scaled;
the determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameter comprises the following steps:
calculating a second scaling multiple of the scale line when the scale line is adjusted based on the first scaling multiple and a scaling base preset for the scale line;
Calculating the pixel distance between the two first scale lines after the scale lines are adjusted based on the second scaling multiple and the preset number of parts, which is divided by the first scale lines, of a unit scale when the scale and the scale lines are not scaled;
calculating the scale distance between the two first scale lines after the scale lines are adjusted based on the preset parts of the scale, which are divided by the first scale lines by one unit scale when the scale and the scale lines are not scaled, and the scale base preset by the scale lines;
and determining the position and the scale value of the first scale line after the scale line is adjusted according to the offset, the pixel distance between the two adjusted first scale lines and the scale distance between the two adjusted first scale lines.
3. The method for adaptively adjusting a window scale according to claim 2, wherein determining the position and the scale value of the adjusted first scale line according to the offset, the pixel distance between the adjusted two first scale lines, and the scale distance between the adjusted two first scale lines comprises:
Determining the position of a first scale line after the scale line is adjusted in the window based on the offset and the pixel distance between the two adjusted first scale lines;
and determining the scale value of the first scale line after the scale line is adjusted based on the offset and the scale distance between the two adjusted first scale lines.
4. The method for adaptively adjusting a window scale according to claim 2, wherein the scale lines further comprise second scale lines, and the scale line related parameter further comprises a preset number of parts divided by the second scale lines between the two first scale lines; the step of determining the position and the scale value of the scale line after the scale line is adjusted, and the step of further comprising:
calculating the pixel distance between the two adjusted second graduation marks based on the pixel distance between the two adjusted first graduation marks and the preset number of parts divided by the second graduation marks between the two first graduation marks;
and determining the position of the second graduation mark after adjusting the graduation mark based on the position of the first graduation mark after adjusting and the pixel distance between the two second graduation marks after adjusting.
5. The method of claim 4, wherein when the width of the first tick mark is a first preset width D1, the method further comprises: calculating the width D2 of the second tick mark based on:
D2=(D1/(T-1))×(T2-1),
wherein T is the scaling radix, and T2 is the second scaling multiple.
6. The method of adaptive adjustment of a window scale according to claim 2, wherein the second scaling factor T2 of the scale line when the scale line is adjusted is calculated based on the following formula:
when T2 < 1, t2=t1×t n When T2 > T, t2=t1++t n The method comprises the steps of carrying out a first treatment on the surface of the Wherein, T is the scaling radix, T is greater than 1, T1 is the first scaling multiple, n is a positive integer, and n is a value such that the result of T2 is 1 < T2 < T;
calculating a scaled pixel distance Dpm between the two first scale lines based on:
dpm=l×t2++num; the Num is a preset part of a unit scale divided by a first scale line when the scale and the scale line are not scaled;
calculating a scale distance Drm between two first scale lines based on the following formula:
drm= (1 +.num) ×t3; the T3 is a ratio of the second scaling factor T2 to the first scaling factor T1.
7. An adaptive adjustment device for a window scale, comprising:
the adjusting module is used for adjusting the display size of the window according to the window adjusting instruction;
a pixel acquisition module for determining the number of pixels on either side of the adjusted window; one of the two endpoints of either side is a datum point;
the parameter determining module is used for determining a first scaling factor after the scale is adjusted and the offset of the scale based on the number of pixels, the initial number of pixels of the zero scale of the scale mark relative to the reference point before the window is adjusted, the scaling factor of the scale before the window is adjusted, the scale related parameter and the number of unit pixels corresponding to one unit scale when the scale is not scaled; the related parameters of the graduated scale comprise a positive range and a negative range of the graduated scale and the maximum scaling factor of the graduated scale; calculating a first scaling factor after adjusting the graduated scale and an offset of the graduated scale based on the following formula: when W is smaller than Vmax multiplied by L multiplied by s-x, determining the first scaling multiple as the scaling multiple before window adjustment, and determining the offset of the graduated scale as the offset of the graduated scale before window adjustment; when Vmax L X s-X < W < (Vmax-Vmin) X L X s, determining that the first scaling factor is a scaling factor before the window is adjusted, calculating the offset X based on the following formula: x=vmax×l×s-W; when (Vmax-Vmin) ×L×s < W < (Vmax-Vmin) ×L×S), the first scaling factor is calculated based on the following formula: s1=w/(Vmax-Vmin) ×l), the offset X is calculated based on the following formula: x=vmax×l×s1-W; the method comprises the steps of setting a window scale, wherein W is the number of pixels, vmax is the positive range, L is the number of unit pixels corresponding to one unit scale when the window scale is not scaled, S is the scaling multiple of the window scale before the window is adjusted, x is the initial number of pixels of zero scale of the window scale relative to the datum point before the window is adjusted, the offset is the number of pixels of zero scale of the scale mark relative to the datum point after the window is adjusted, vmin is the negative range, and S is the maximum scaling multiple of the window scale;
The scale mark determining module is used for determining the position and the scale value of the scale mark after the scale mark is adjusted based on the first scaling multiple, the offset and the preset scale mark related parameter; the related parameters of the scale marks comprise a preset scaling base number of the scale marks, a scale and preset parts, wherein when the scale marks are not scaled, one unit scale is divided into a first scale mark;
and the scale display module is used for displaying the adjusted scale mark in the window according to the position and the scale value of the adjusted scale mark.
8. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: a method of adaptively adjusting a window scale according to any one of claims 1-6.
9. A medium, which is a computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method for adaptive adjustment of a window scale according to any one of claims 1-6.
CN202110118632.8A 2021-01-28 2021-01-28 Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium Active CN114816606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110118632.8A CN114816606B (en) 2021-01-28 2021-01-28 Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110118632.8A CN114816606B (en) 2021-01-28 2021-01-28 Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114816606A CN114816606A (en) 2022-07-29
CN114816606B true CN114816606B (en) 2024-04-02

Family

ID=82526941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110118632.8A Active CN114816606B (en) 2021-01-28 2021-01-28 Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114816606B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140496A (en) * 2007-10-23 2008-03-12 深圳市迅雷网络技术有限公司 Method and device for regulating column frame
CN102244745A (en) * 2010-05-11 2011-11-16 北京四达时代软件技术股份有限公司 Method and device for adjusting image integrity of television
CN104106040A (en) * 2012-02-16 2014-10-15 微软公司 Visual representation of chart scaling
CN104181365A (en) * 2013-05-24 2014-12-03 苏州普源精电科技有限公司 Measurement device with zoom display function
CN108664194A (en) * 2017-03-29 2018-10-16 中兴通讯股份有限公司 Display methods and device
CN110795196A (en) * 2019-10-31 2020-02-14 北京字节跳动网络技术有限公司 Window display method, device, terminal and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058801A1 (en) * 2013-08-23 2015-02-26 General Electric Company Multi-touch inspection tool

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140496A (en) * 2007-10-23 2008-03-12 深圳市迅雷网络技术有限公司 Method and device for regulating column frame
CN102244745A (en) * 2010-05-11 2011-11-16 北京四达时代软件技术股份有限公司 Method and device for adjusting image integrity of television
CN104106040A (en) * 2012-02-16 2014-10-15 微软公司 Visual representation of chart scaling
CN104181365A (en) * 2013-05-24 2014-12-03 苏州普源精电科技有限公司 Measurement device with zoom display function
CN108664194A (en) * 2017-03-29 2018-10-16 中兴通讯股份有限公司 Display methods and device
CN110795196A (en) * 2019-10-31 2020-02-14 北京字节跳动网络技术有限公司 Window display method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN114816606A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
US20100031188A1 (en) Method for zooming image and electronic device using the same
CN111291244B (en) House source information display method, device, terminal and storage medium
CN110647369B (en) Page dynamic display method and device, mobile terminal and storage medium
CN114816606B (en) Self-adaptive adjustment method and device of window graduated scale, electronic equipment and medium
CN109582269B (en) Physical splicing screen display method and device and terminal equipment
CN111857518A (en) Method and device for canceling image editing operation, electronic equipment and medium
CN111831386B (en) Page content display method and device, electronic equipment and computer readable medium
CN113506356B (en) Method and device for drawing area map, readable medium and electronic equipment
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN113253874B (en) Control method and device of display device, terminal and storage medium
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN110618776B (en) Picture scaling method, device, equipment and storage medium
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN113766293B (en) Information display method, device, terminal and storage medium
CN113204557A (en) Electronic form importing method, device, equipment and medium
CN112711457A (en) Method and device for field drawing and electronic equipment
CN111783390B (en) Dimension label adjusting method and device and electronic equipment
CN111563214B (en) Reference line processing method and device
CN114710695B (en) Progress adjustment method, device, electronic equipment, storage medium and program product
CN111311665B (en) Video processing method and device and electronic equipment
CN112395826B (en) Text special effect processing method and device
CN117093105B (en) Label display method, device, equipment and storage medium
CN114327188B (en) Form layout method, form layout device, electronic equipment and computer readable medium
CN111753230B (en) Reference line processing method and device
CN111445405B (en) Human body shoulder and neck processing method and device in picture 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant