WO2017215247A1 - 窗口边框阴影显示方法及装置 - Google Patents

窗口边框阴影显示方法及装置 Download PDF

Info

Publication number
WO2017215247A1
WO2017215247A1 PCT/CN2016/113224 CN2016113224W WO2017215247A1 WO 2017215247 A1 WO2017215247 A1 WO 2017215247A1 CN 2016113224 W CN2016113224 W CN 2016113224W WO 2017215247 A1 WO2017215247 A1 WO 2017215247A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
slave
main
transparency
pixels
Prior art date
Application number
PCT/CN2016/113224
Other languages
English (en)
French (fr)
Inventor
程遥
Original Assignee
广州视睿电子科技有限公司
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 广州视睿电子科技有限公司 filed Critical 广州视睿电子科技有限公司
Priority to ES16905354T priority Critical patent/ES2890828T3/es
Priority to EP16905354.3A priority patent/EP3470967B1/en
Priority to US16/308,728 priority patent/US10636191B2/en
Publication of WO2017215247A1 publication Critical patent/WO2017215247A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/37Details of the operation on graphic patterns
    • G09G5/377Details of the operation on graphic patterns for mixing or overlaying two or more graphic patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • 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
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/24Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/10Mixing of images, i.e. displayed pixel being the result of an operation, e.g. adding, on the corresponding input pixels
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/12Overlay of images, i.e. displayed pixel being the result of switching between the corresponding input pixels

Definitions

  • the present invention relates to the field of display technologies, and in particular, to a window frame shadow display method and apparatus.
  • the border shadow effect of the window is often achieved by rendering the edge area of the window semi-transparent.
  • the traditional method is through Microsoft 32.
  • the Bit Platform's Application Programming Interface (Win32API) sets the window to a Layered Window and draws a translucent shadow effect on the edge of the window.
  • this method of marking a window as a Layered Window to achieve shadow display of the window border has certain drawbacks: the Layered Window consumes a large amount of memory, and the memory footprint increases as the window area increases; the Layered Window smudges Poor performance, the animation effect implemented in the Layered Window will be more difficult to achieve the desired frame rate than the non-Layered Window in the same situation.
  • a window frame shadow display method comprising the following steps:
  • the main window is a non-Layered Window
  • the slave window is a Layered Window
  • the present invention also provides a window frame shadow display device, the device comprising:
  • a window creation unit for creating a slave window spliced at a border of the main window, the main window being Non-Layered Window, the dependent window is a Layered Window;
  • An adjusting unit configured to adjust a size of the slave window according to a size of the main window, and adjust screen coordinates of the slave window according to screen coordinates of the main window;
  • And calculating a display unit configured to calculate pixel point transparency of the slave window, and display the slave window according to the calculation result.
  • the window frame shadow display method and device of the above window use the display interface of the normal rendering software of the main window, and the subordinate window matched with the main window at the border of the main window realizes the shadow display of the border of the main window, and sets the main window to be non- Layered Window, the slave window is set to Layered Window. Since the main window is a non-Layered Window, the memory usage of the area does not increase with the increase of the main window area, which greatly saves the system memory usage, and the slave window. Although it is a Layered Window, since the area of the dependent window is small relative to the main window when the main window border is displayed, the dependent window has a limited memory footprint, compared to marking the main window as a Layered Window to implement the window.
  • the method of displaying the border shadow still reduces the memory footprint of the system as a whole; in addition, since the main window is a non-Layered Window, it is not affected by the performance of the Layered Window, so the window frame proposed by the present invention Shadow display method and device have better window rendering can.
  • FIG. 1 is a schematic flow chart of a window frame shadow display method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a main window and a subordinate window in one embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a window frame shadow display device according to an embodiment of the present invention.
  • a window frame shadow display method includes the following steps:
  • S100 creates a dependent window spliced at a border of the main window, the main window is a non-Layered Window, and the dependent window is a Layered Window;
  • S200 adjusts a size of the slave window according to a size of the main window, and adjusts screen coordinates of the slave window according to screen coordinates of the main window;
  • S300 calculates pixel point transparency of the slave window, and displays the slave window according to the calculation result.
  • the main window is a window for displaying a display interface of the software normally in the operating system
  • a dependent window is created through the Window API on the basis of a created main window, and the dependent window is spliced at The border of the main window, in order to splicing out the border shadow effect of the main window, wherein the borders of the main window and the subordinate windows are spliced, and the number of subordinate windows spliced with the main window can be determined according to the expected effect of the specific main window border shading.
  • This step further sets the main window to a non-Layered Window, and the subordinate window is set to a Layered Window, where the Layered Window is a window implementation defined in the Windows system, and the Layered Window can be rendered translucent compared to the non-Layered Window. The effect, but it takes up more memory and the rendering performance is not ideal.
  • the Layered Window is a window implementation defined in the Windows system
  • the Layered Window can be rendered translucent compared to the non-Layered Window. The effect, but it takes up more memory and the rendering performance is not ideal.
  • step S200 the size of the dependent window is adjusted according to the size of the main window, and the screen coordinates of the dependent window are adjusted according to the screen coordinates of the main window.
  • the following takes the common main window with four borders, assuming that four subordinate windows spliced at different borders of the main window are created as an example, and step S200 is explained:
  • the size (including the length and/or the width) of each of the dependent windows is respectively adjusted according to the size (including the length and/or the width) of the main window, and specifically, the respective dependent windows are respectively marked as an upper subordinate window, a lower subordinate window,
  • the left slave window and the right slave window as shown in Figure 2, the length and width of the main window are recorded as window.length and window.width, the width of the upper slave window is recorded as radius.top, and the width of the lower slave window is recorded as radius. .bottom, the width of the left-dependent window is recorded as radius.left, and the width of the right-dependent window is recorded as radius.right.
  • the length of the upper slave window spliced at the upper border of the main window is spliced to the lower border of the main window.
  • the subordinate windows at the same length are the same, both are radius.
  • Left+window.length+radius.right the length of the left-dependent window spliced at the left border of the main window is the same as the length of the right-dependent window spliced at the right border of the main window, both radius.top+window.width+radius .bottom, where the widths of each subordinate window radius.top, radius.bottom, radius.left, radius.right can be flexibly set according to the size of the main window and the shadow display effect of the border, as a specific implementation manner.
  • the width of each subordinate window is set to be the same.
  • the screen coordinates of the slave window are adjusted according to the screen coordinates of the main window.
  • the upper left corner of the display screen is the coordinate origin
  • the horizontal right direction is the x-axis positive direction, perpendicular to the x-axis.
  • the lower direction establishes the coordinate system for the positive direction of the y-axis.
  • the screen coordinates of the main window refer to the coordinate position of the upper left corner of the main window in the coordinate system under construction.
  • the screen sitting of the main window is marked as (window.left, window .top), according to the screen coordinates of the main window, the screen coordinates of the slave window can be calculated. For example, taking the upper slave window shown in FIG.
  • the coordinate position of the upper left corner of the upper slave window in the created coordinate system can be based on The screen coordinates of the main window and the size of the slave window are calculated.
  • the coordinate position of the upper left corner of the upper slave window should be (window.left-radius.left, window.top-radius.top), that is, the screen coordinates of the upper slave window are (window.left-radius.left, window.top-radius.top), the screen coordinates of other dependent windows and so on.
  • step S300 the pixel point transparency of the dependent window is calculated, and the dependent window is displayed according to the calculation result.
  • each border of the main window is spliced with a subordinate window, and each subordinate window is respectively marked as a first subordinate window, a second slave window, a third slave window, and a fourth slave window, respectively setting a transparency of the first row of pixels of the first slave window and the third slave window to 1 for the first slave window and the third slave window, and the other rows Pixels are counted down by 1 until the last one
  • the transparency of the row pixel is 0; for the second slave window and the fourth slave window, the transparency of the first column of the second slave window and the fourth slave window is set to 1, and the other column pixels are sequentially started by 1. Decrement calculation until the transparency of the last column of pixels is zero.
  • the pixel of the side of the respective dependent window that is spliced with the main window border ie, the first row of pixels or the first column
  • the transparency of the pixel is set to 1
  • the transparency of the opposite pixel ie, the last row of pixels or the last column of pixels
  • the transparency of other column pixels is successively decremented from 1 to 0.
  • the width of the slave window is radius.left, that is, there is radius.
  • the left column pixel points the transparency of the first column of pixels on the side of the side window of the main window is set to 1 (ie, completely opaque), and each column of pixels after the first column of pixels The transparency is decremented until the transparency of the pixels in the radius.left column is 0 (ie, completely transparent). Except for the pixels in the first column and the pixels in the radius.left column, the transparency of the other columns is translucent.
  • each subordinate window is displayed according to the calculated transparency, that is, the pixels in each subordinate window are rendered differently.
  • the pixels of the transparency, all the slave windows obtained after rendering are spliced together at the border of the main window, and finally the shadow of the border of the main window is displayed.
  • the calculation amount of the pixel dot transparency of the partial slave window can be reduced, thereby improving the processing speed of the window frame shadow display, and further,
  • the window frame shadow display effect can be various, for example, only the shadow of a certain border of the window is displayed, the degree of shadow of each frame is different, and the like, and the user can set according to his own needs or preferences, so for those skilled in the art,
  • the specific calculation method used in the calculation of the pixel point transparency of each subordinate window can be adjusted according to the expectation of the shadow display effect of the window frame.
  • the window frame shadow display method proposed in this embodiment utilizes the display interface of the normal rendering software of the main window, and realizes the border shadow display of the main window by splicing the slave window matching the main window at the border of the main window, and the main window is displayed.
  • the slave window is set to Layered Window, because the main window is a non-Layered Window, the memory usage of the area does not increase with the increase of the main window area, which greatly saves the system's memory footprint, while the slave window is a Layered Window, but because of When the main window border is displayed, the area of the dependent window is relatively small relative to the main window, so the memory usage of the dependent window is limited, compared to the method of marking the main window as a Layered Window to achieve the shadow of the window border.
  • the memory footprint of the system is still reduced as a whole; in addition, since the main window is a non-Layered Window, it is not affected by the performance of the Layered Window, so the window frame shadow display method proposed in this embodiment has better performance. Window rendering performance.
  • the window frame shadow display method further includes the steps of: monitoring the size change of the main window, and adjusting the size of the slave window according to the monitored size change amount.
  • the Window API can be used to monitor the change of the size (including length and width) of the main window.
  • the Window API monitors the length or width of the main window, the subordinates are re-adjusted according to the monitored size change.
  • the size of the window including the length and width), so that the slave window can always be spliced with the main window, so that it can always match the main window.
  • the Window API listens to the length of the main window increases by ⁇
  • the corresponding partial slave window The length also needs to be increased by ⁇ to ensure that the slave window matching the main window is obtained, thereby ensuring that the slave window is stitched at the border of the main window and forming a border shadow of the main window.
  • the length and/or width of the main window changes accordingly, so the shadow display effect of the main window does not change with the scaling of the main window, further The normal display effect of the window border shadow is guaranteed.
  • the window frame shadow display method further includes the steps of: monitoring the screen coordinate change of the main window, and adjusting the screen coordinates of the slave window according to the monitored coordinate change amount.
  • the present embodiment adjusts the screen of the slave window according to the coordinate change amount of the monitored main window by monitoring the event of the screen coordinate change of the main window. Coordinates, for example, the coordinate system is set by the upper left corner of the display screen, the horizontal direction to the right is the x-axis positive direction, and the direction perpendicular to the x-axis is the positive direction of the y-axis.
  • the screen coordinates of the main window are monitored by the Window API.
  • the screen coordinates of the slave window are also Need to adjust, the screen of the slave window sits
  • the target horizontal coordinate needs to increase window.x, and the vertical coordinate needs to increase window.y to ensure that the dependent window can match the main window, thereby ensuring that the dependent window is stitched at the main window border and forming the border shadow of the main window.
  • the screen coordinates of the main window are changed, the screen coordinates of the slave window are changed accordingly, so the shadow shadow display effect of the main window does not change with the change of the position of the main window on the display screen, further The normal display effect of the window border shadow is guaranteed.
  • the window frame shadow display method further includes the following steps: hiding the displayed slave window when the window maximization instruction or the window minimization instruction of the main window is monitored.
  • the event of whether the window maximization instruction or the window minimization instruction of the main window is received is monitored, and when the window maximization instruction of the main window is monitored, the main window will be displayed on the display screen.
  • Full-screen display the border of the main window coincides with the boundary of the display screen, and the border shadow of the main window does not need to be displayed, so when the window maximization instruction of the main window is monitored, the hidden sub-window is hidden, and the sub-window is stopped.
  • the present embodiment is directed to different display states of the main window. When the main window is maximized or minimized, the displayed subordinate window is hidden, that is, the frame shadow of the main window is not displayed, thereby further saving system memory resources.
  • the present invention also provides a window frame shadow display device, which includes a window creation unit 100, an adjustment unit 200, and a calculation display unit 300.
  • a window creation unit 100 a window creation unit 100
  • an adjustment unit 200 a window adjustment unit 200
  • a calculation display unit 300 a window creation unit 300
  • the above respective units and their functions are respectively described below:
  • the window creating unit 100 is configured to create a dependent window spliced at the border of the main window, wherein the main window is a non-Layered Window and the dependent window is a Layered Window.
  • the main window is a window for displaying the display interface of the software normally in the operating system.
  • the window creating unit 100 creates a subordinate window through the Window API, and the subordinate window is stitched in the border of the main window.
  • Unit 100 sets the main window to a Layered Window, a dependent window Set to Layered Window, which is a window implementation defined in Windows system. Compared with non-Layered Window, Layered Window can display translucent effect, but it will take up more memory and rendering performance is not ideal. .
  • the window creation unit 100 when the window creation unit 100 creates a slave window, the window creation unit 100 causes each frame of the main window to be spliced with a slave window, and the window creation unit 100 creates the slave by using the present embodiment.
  • the method of the window minimizes the total number of dependent windows to be created, thereby simplifying the process of displaying the shadow of the main window border, improving the shadow display efficiency of the border, and splicing a dependent window at each border of the main window.
  • the surrounding border of the main window has a shadow display effect, which is more in line with human visual habits.
  • the adjusting unit 200 is configured to adjust the size of the slave window according to the size of the main window, and adjust the screen coordinates of the slave window according to the screen coordinates of the main window.
  • a common slave window having four borders and a hypothetical window creating unit 100 create four slave windows that are spliced at different borders of the main window as an example, and the adjustment unit 200 is explained:
  • the adjustment unit 200 respectively sets the size (including the length and/or the width) of each of the dependent windows according to the size (including the length and/or the width) of the main window, specifically, marking each of the dependent windows as an upper dependent window,
  • the lower slave window, the left slave window, and the right slave window, as shown in Figure 2 the length and width of the main window are recorded as window.length and window.width respectively, and the width of the upper slave window is recorded as radius.top, the lower slave window The width is recorded as radius.bottom, the width of the left subordinate window is recorded as radius.left, and the width of the right subordinate window is recorded as radius.right.
  • the adjustment unit adjusts the size of the subordinate window according to the size of the main window as follows.
  • the length of the upper slave window spliced at the upper border of the main window is the same as the length of the lower slave window spliced at the bottom border of the main window, both radius.left+window.length+radius.right, spliced at the left border of the main window
  • the length of the left slave window is the same as the length of the right slave window stitched at the right border of the main window, both radius.top+window.width+radius.bottom, where each slave window
  • the width radius.top, radius.bottom, radius.left, radius.right can be flexibly set according to the size of the main window and the shadow display effect of the border.
  • the width of the window is unified, and the calculation of the pixel point transparency of the slave window by the calculation display unit 300 can be simplified according to the symmetry of the window, thereby improving the efficiency of the shadow display of the main window frame;
  • the adjustment unit 200 adjusts the screen coordinates of the slave window according to the screen coordinates of the main window.
  • the adjustment method of the screen coordinates of the slave window by the adjustment unit 200 is as follows: in the field of display technology, the upper left corner of the display screen is used as the coordinate origin. The horizontal right direction is the positive direction of the x-axis, and the direction perpendicular to the x-axis is the positive direction of the y-axis.
  • the screen coordinate of the main window refers to the coordinate position of the upper left corner of the main window under the established coordinate system. For example, the screen of the main window is marked as (window.left, window.top), and the screen coordinates of the slave window can be calculated according to the screen coordinates of the main window.
  • the coordinate position of the upper left corner of the upper slave window in the built coordinate system can be calculated according to the screen coordinates of the main window and the size of the dependent window.
  • the coordinate position of the upper left corner of the upper slave window should be (window.left-radius.left, Window.top-radius.top), that is, the screen coordinates of the upper slave window are (window.left-radius.left, window.top-radius.top), the screen coordinates of other slave windows, and so on.
  • the calculation display unit 300 is configured to calculate the pixel point transparency of the slave window, and display the slave window according to the calculation result. After adjusting the size and screen coordinates of the slave window, the calculation display unit 300 needs to calculate the transparency of the pixel points included in the slave window, that is, perform pixel point transparency calculation on the slave window, thereby calculating the transparency of the pixel points of the slave window. Set to achieve the effect of the shadow display of the main window border.
  • the calculation display unit 300 includes a transparency calculation unit, and the transparency calculation unit is configured to calculate transparency of each pixel point included in the slave window. Specifically, each frame of the main window is spliced with a slave window.
  • Each of the slave windows is respectively marked as a first slave window, a second slave window, a third slave window, and a fourth slave window
  • the transparency calculation unit respectively sets the first slave window and The transparency of the first row of pixels of the third slave window is 1, and the other rows of pixels are successively decremented from 1 until the transparency of the last row of pixels is 0
  • the transparency calculation unit The transparency of the first column of pixel points of the second subordinate window and the fourth subordinate window is set to 1, and the other column pixels are successively decremented from 1 until the transparency of the last column of pixels is 0.
  • the transparency calculation unit may combine one of the subordinate windows with the main window frame.
  • the transparency of the side pixel ie, the first row of pixels or the first column of pixels
  • the pixel of the opposite side of the side of the subordinate window that is spliced with the main window frame ie, the last row of pixels or
  • the transparency of the last column of pixels is set to 0, and the transparency of other row pixels or other column pixels is successively decremented from 1 to 0, for example, taking a slave window (left slave window) spliced to the left of the main window as an example.
  • the width of the subordinate window is radius.left, that is, there is a pixel of the radius.left column
  • the transparency calculation unit sets the transparency of the first column of the side of the side of the subordinate window and the border of the main window to be 1 (ie, Fully opaque, and the transparency of each column of pixels after the first column of pixels is successively decreasing until the transparency of the pixels in the radius.left column is 0 (ie, completely transparent), except for the first column of pixels and the radius.
  • the transparency of the other column pixels is translucent except for the pixels in the left column.
  • the transparency calculation unit separately performs pixel point transparency calculation for other subordinate windows; the transparency calculation unit obtains each subordinate window.
  • the calculation display unit 300 displays the respective subordinate windows according to the calculated transparency, that is, the pixel points in the respective subordinate windows are rendered into pixel points having different transparency, and all the subordinate windows obtained after the rendering are spliced together. At the border around the main window, the result of the border shadow of the main window is finally displayed.
  • the window frame shadow display device when the widths of the respective subordinate windows are the same, according to the principle of symmetry, the calculation amount of the transparency of the pixel points of the partial subordinate window by the transparency calculation unit can be reduced, thereby improving the processing speed of the shadow display of the window frame.
  • the window frame shadow display effect can be various, for example, only the shadow of a certain frame of the window is displayed, the degree of shadow of each frame is different, and the like, the user can set according to his own needs or preferences, and thus it is for those skilled in the art.
  • the specific calculation method used by the transparency calculation unit to perform pixel point transparency calculation on each subordinate window can be adjusted according to the expectation of the window frame shadow display effect.
  • the window frame shadow display device of the embodiment uses the display interface of the normal window of the main window to realize the frame shadow display of the main window by splicing the slave window at the main window frame and matching the main window, and the main window is displayed.
  • the slave window is set to Layered Window. Since the main window is non-Layered Window, the memory usage of this area will not increase with the increase of the main window area, which greatly saves the system memory usage.
  • the slave window is a Layered Window, since the area of the slave window is smaller than that of the main window when the main window border is displayed, the memory of the slave window is limited, compared to the main window.
  • the method of porting the Layered Window to achieve the shadow display of the window border still reduces the memory footprint of the system as a whole; in addition, since the main window is a non-Layered Window, it is not affected by the performance of the Layered Window. Therefore, the window frame shadow display device proposed in this embodiment has better window rendering performance.
  • the window frame shadow display device further includes a monitoring unit, and the following describes the monitoring unit and its functions in detail:
  • the listening unit monitors the size change of the main window, and the adjusting unit adjusts the size of the dependent window according to the amount of dimensional change monitored by the listening unit.
  • the listening unit can use the Window API to monitor the change of the size (including length and width) of the main window.
  • the Window API monitors the length or width of the main window
  • the adjusting unit monitors according to the listening unit.
  • the amount of dimensional change resizes the size of the dependent window (including length and width) so that the dependent window can always be spliced with the main window so that it can always match the main window, for example, when the listening unit monitors the length of the main window by ⁇ , Then, the adjusting unit increases the length of the corresponding partial slave window by ⁇ , thereby ensuring that the slave window matching the main window is obtained, thereby ensuring that the slave window is stitched at the main window border and forming a border shadow of the main window.
  • the length and/or width of the main window when the length and/or width of the main window is changed, the length and/or width of the subordinate window changes accordingly, so the shadow display effect of the main window does not change with the scaling of the main window, further The normal display effect of the window border shadow is guaranteed.
  • the monitoring unit also monitors the screen coordinate change of the main window, and the adjusting unit adjusts the screen coordinates of the slave window according to the coordinate change amount monitored by the monitoring unit.
  • the monitoring unit of the present embodiment monitors the coordinates of the main window monitored by the monitoring unit by monitoring the event of the screen coordinate change of the main window.
  • the amount of change adjusts the screen coordinates of the slave window.
  • the coordinate system is established by the upper left corner of the display screen, the positive direction of the horizontal direction is the positive direction of the x-axis, and the direction perpendicular to the x-axis is the positive direction of the y-axis. Window API is monitored.
  • the screen coordinates to the main window are changed from the original (window.left, window.top) to (window.left+window.x, window.top+window.y), in order to ensure that the slave window can be matched in real time with the main window.
  • the screen coordinates of the slave window also need to be changed.
  • the adjustment unit adds the window coordinate of the screen coordinate of the slave window to window.x, and the vertical coordinate increases window.y, thereby ensuring that the slave window can match the main window, thereby ensuring the slave window stitching.
  • the screen coordinates of the main window are changed, the screen coordinates of the slave window are changed accordingly, so the shadow shadow display effect of the main window does not change with the change of the position of the main window on the display screen, further The normal display effect of the window border shadow is guaranteed.
  • the calculation display unit hides the subordinate window.
  • the listening unit monitors whether the window maximization instruction or the window minimization instruction of the main window is received.
  • the main window will be displayed at this time. The screen is displayed full screen, the border of the main window coincides with the boundary of the display screen, and the calculation display unit does not need to display the border shadow of the main window, so when the listening unit monitors the window maximization instruction of the main window, the calculation display unit is hidden.
  • the slave window stops the rendering of the slave window, thereby releasing the system memory resources; when the listener unit listens to the window minimize instruction of the main window, since the main window will no longer display on the screen, no calculation display is required.
  • the unit displays the border shadow of the main window.
  • the calculation display unit hides the slave window and stops rendering the slave window, thereby releasing system memory resources.
  • the present embodiment is directed to different display states of the main window. When the main window is maximized or minimized, the slave window is hidden, that is, the frame shadow of the main window is not displayed, thereby further saving system memory resources.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

一种窗口边框阴影显示方法及装置,该方法包括步骤:创建拼接在主窗口四周边框处的各个从属窗口,所述主窗口为非Layered Window,所述从属窗口均为Layered Window(S100);根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标(S200);计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示(S300)。上述方法通过将用于正常呈现软件的显示界面的主窗口设置为非Layered Window、拼接在主窗口四周边框处的从属窗口设置为Layered Window,不仅利用从属窗口实现主窗口的边框阴影显示效果,而且整体上减小了系统的内存占用。

Description

窗口边框阴影显示方法及装置 技术领域
本发明涉及显示技术领域,特别是涉及一种窗口边框阴影显示方法及装置。
背景技术
目前,在操作系统中,窗口的边框阴影效果往往通过使窗口的边缘区域呈现出半透明的效果来实现,例如在Windows系统中,为了实现窗口的边框阴影显示效果,传统的方法是通过Microsoft 32位平台的应用程序编程接口(Win32API)将窗口设置为Layered Window(分层窗口),并在窗口的边缘区域绘制出半透明的阴影效果。但是,这种将窗口标记为Layered Window以实现窗口边框阴影显示的方法具有一定的弊端:Layered Window会占用大量的内存,并且内存占用量随窗口面积的增加而等比增加;Layered Window的晕染性能较差,在Layered Window中实现的动画效果,会比同等情况下非Layered Window中更难以达到理想的帧率。
发明内容
基于此,有必要针对现有技术中的上述问题,提供一种窗口边框阴影显示方法及装置。
一种窗口边框阴影显示方法,所述方法包括以下步骤:
创建拼接在主窗口边框处的从属窗口,所述主窗口为非Layered Window,所述从属窗口为Layered Window;
根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标;
计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示。
相应地,本发明还提出一种窗口边框阴影显示装置,所述装置包括:
窗口创建单元,用于创建拼接在主窗口边框处的从属窗口,所述主窗口为 非Layered Window,所述从属窗口为Layered Window;
调节单元,用于根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标;
计算显示单元,用于计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示。
上述窗口边框阴影显示方法及装置利用主窗口正常呈现软件的显示界面,以拼接在主窗口边框处的、与主窗口相匹配的从属窗口实现主窗口的边框阴影显示,并将主窗口设置为非Layered Window,从属窗口设置为Layered Window,由于主窗口是非Layered Window,因此该区域的内存占用不会随主窗口面积的增大而等比增加,从而极大地节约了系统的内存占用,而从属窗口虽然是Layered Window,但是由于在实现主窗口边框阴影显示时,从属窗口的面积相对于主窗口面积往往较小,因此从属窗口的内存占用有限,相比于将主窗口标记为Layered Window以实现窗口边框阴影显示的方法而言,仍在整体上减小了系统的内存占用;此外,由于主窗口是非Layered Window,其不会受到Layered Window所带来的性能影响,因此本发明所提出的窗口边框阴影显示方法及装置具有更好的窗口渲染性能。
附图说明
图1为本发明其中一个实施例中窗口边框阴影显示方法的流程示意图;
图2为本发明其中一个实施例中主窗口和从属窗口的示意图;
图3为本发明其中一个实施例中窗口边框阴影显示装置的结构示意图。
具体实施方式
下面将结合附图及较佳实施例对本发明的技术方案进行详细描述。
在其中一个实施例中,参见图1所示,一种窗口边框阴影显示方法,该方法包括以下步骤:
S100创建拼接在主窗口边框处的从属窗口,所述主窗口为非Layered Window,所述从属窗口为Layered Window;
S200根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标;
S300计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示。
具体地,主窗口是用于在操作系统中正常呈现软件的显示界面的窗口,在步骤S100中,在已创建的一个主窗口的基础之上,通过Window API创建从属窗口,且从属窗口拼接在主窗口的边框处,以便拼接出主窗口的边框阴影效果,其中主窗口的哪些边框与从属窗口拼接、与主窗口拼接的从属窗口的数量都可以视具体的主窗口边框阴影显示预期效果而定;本步骤进一步将主窗口设置为非Layered Window,从属窗口设置为Layered Window,其中Layered Window是Windows系统中定义的一种窗口实现方式,与非Layered Window相比,Layered Window可以呈现出半透明的效果,但是会占用更多的内存,且渲染性能不理想。作为一种具体的实施方式,在本步骤创建拼接在主窗口边框处的从属窗口时,主窗口的每一边框均与一个从属窗口相拼接,采用本实施方式所提出的从属窗口的创建方法,最大程度上减小了需创建的从属窗口的总数量,从而简化主窗口边框阴影显示的过程,提高边框阴影显示效率,而且通过在主窗口的每一边框处均拼接一个从属窗口,最终可使得主窗口的四周边框均有阴影显示效果,更符合人的视觉习惯。
在步骤S200中,根据主窗口的尺寸调节从属窗口的尺寸,根据主窗口的屏幕坐标调节从属窗口的屏幕坐标。下面以常见的具有4条边框的主窗口、假设创建4个拼接在主窗口不同边框处的从属窗口为例,对步骤S200加以说明:
一方面,根据主窗口的尺寸(包括长度和/或宽度)分别调节各个从属窗口的尺寸(包括长度和/或宽度),具体地,将各个从属窗口分别标记为上从属窗口、下从属窗口、左从属窗口和右从属窗口,如图2所示,主窗口的长度和宽度分别记为window.length和window.width,上从属窗口的宽度记为radius.top,下从属窗口的宽度记为radius.bottom,左从属窗口的宽度记为radius.left,右从属窗口的宽度记为radius.right,根据图2可知,拼接在主窗口上边框处的上从属窗口的长度与拼接在主窗口下边框处的下从属窗口的长度相同,均为radius. left+window.length+radius.right,拼接在主窗口左边框处的左从属窗口的长度与拼接在主窗口右边框处的右从属窗口的长度相同,均为radius.top+window.width+radius.bottom,其中各个从属窗口的宽度radius.top、radius.bottom、radius.left、radius.right可以根据主窗口的尺寸以及边框阴影显示效果进行灵活地设定,作为其中的一种具体的实施方式,当从属窗口的数量大于一个时,设定各个从属窗口的宽度均相同,以上述4个从属窗口为例,各个从属窗口的宽度均相同,即radius.top=radius.bottom=radius.left=radius.right,将各个从属窗口的宽度统一化,可以根据窗口的对称性来简化对从属窗口的像素点透明度计算,从而提高主窗口边框阴影显示的效率;
另一方面,根据主窗口的屏幕坐标调节从属窗口的屏幕坐标,具体地,在显示技术领域,以显示屏幕左上角为坐标原点,水平向右的方向为x轴正方向,与x轴垂直向下的方向为y轴正方向建立坐标系,主窗口的屏幕坐标指的是主窗口左上角在所建坐标系下的坐标位置,例如,将主窗口的屏幕坐标记为(window.left,window.top),根据主窗口的屏幕坐标可以计算出从属窗口的屏幕坐标,例如,以图2所示的上从属窗口为例,上从属窗口的左上角在所建坐标系下的坐标位置可以根据主窗口的屏幕坐标和从属窗口的尺寸计算得到,上从属窗口的左上角的坐标位置应该为(window.left-radius.left,window.top-radius.top),即上从属窗口的屏幕坐标为(window.left-radius.left,window.top-radius.top),其他从属窗口的屏幕坐标以此类推。
最后,在步骤S300中,计算从属窗口的像素点透明度,并根据计算结果对从属窗口进行显示。在步骤S200对从属窗口的尺寸和屏幕坐标进行调节后,需计算从属窗口包括的像素点的透明度,即对从属窗口进行像素点透明度计算,从而通过对从属窗口的像素点的透明度的计算和设置,实现主窗口边框阴影显示的效果。在对各个从属窗口分别进行像素点透明度计算的过程中,作为其中一种具体的算法,主窗口的每一边框均与一个从属窗口相拼接,将各个从属窗口分别标记为第一从属窗口、第二从属窗口、第三从属窗口和第四从属窗口,对于第一从属窗口和第三从属窗口,分别设定第一从属窗口和第三从属窗口的第一行像素点的透明度为1,其他行像素点由1开始依次递减计算,直至最后一 行像素点的透明度为0;对于第二从属窗口和第四从属窗口,分别设定第二从属窗口和第四从属窗口的第一列像素点的透明度为1,其他列像素点由1开始依次递减计算,直至最后一列像素点的透明度为0。
计算从属窗口的像素点透明度的有多种方法,在其中一种可行的方法中,可以将各个从属窗口中与主窗口边框拼接的一侧的像素点(即第一行像素点或第一列像素点)的透明度设置为1,将各个从属窗口中与主窗口边框拼接的一侧的对侧的像素点(即最后一行像素点或最后一列像素点)的透明度设置为0,其他行像素点或者其他列像素点的透明度均从1至0依次递减获得,例如,以拼接于主窗口左侧的从属窗口(左从属窗口)为例,该从属窗口的宽度为radius.left,即有radius.left列像素点,设定该从属窗口与主窗口的边框拼接的一侧的第一列像素点的透明度都为1(即完全不透明),而在第一列像素点之后的每一列像素点的透明度依次递减,直至第radius.left列像素点的透明度为0(即完全透明),除第一列像素点和第radius.left列像素点外,其他列像素点的透明度均为半透明,同理,对其他从属窗口也分别进行像素点透明度计算;得到各个从属窗口中各个像素点的透明度后,根据计算得到的透明度对各个从属窗口进行显示,即将各个从属窗口中的像素点渲染成具有不同透明度的像素点,渲染后得到的全部从属窗口一起拼接在主窗口的四周边框处,最终得到主窗口的边框阴影显示结果。
在计算从属窗口的像素点透明度时,当各个从属窗口的宽度均相同时,根据对称原则,可减少部分从属窗口的像素点透明度的计算量,从而提高窗口边框阴影显示的处理速度,此外,由于窗口边框阴影显示效果可以多种多样,例如只显示窗口某一边框的阴影、各个边框的阴影程度不一样等,用户可根据自身需求或喜好进行设定,因此对于本领域技术人员而言,对各个从属窗口进行像素点透明度计算时所采用的具体计算方法可以根据对窗口边框阴影显示效果的预期而进行相应的调整。
本实施例所提出的窗口边框阴影显示方法利用主窗口正常呈现软件的显示界面,以拼接在主窗口边框处的、与主窗口相匹配的从属窗口实现主窗口的边框阴影显示,并将主窗口设置为非Layered Window,从属窗口设置为Layered  Window,由于主窗口是非Layered Window,因此该区域的内存占用不会随主窗口面积的增大而等比增加,从而极大地节约了系统的内存占用,而从属窗口虽然是Layered Window,但是由于在实现主窗口边框阴影显示时,从属窗口的面积相对于主窗口面积往往较小,因此从属窗口的内存占用有限,相比于将主窗口标记为Layered Window以实现窗口边框阴影显示的方法而言,仍在整体上减小了系统的内存占用;此外,由于主窗口是非Layered Window,其不会受到Layered Window所带来的性能影响,因此本实施例所提出的窗口边框阴影显示方法具有更好的窗口渲染性能。
作为一种具体的实施方式,窗口边框阴影显示方法还包括以下步骤:监听主窗口的尺寸变化,根据监听到的尺寸变化量调节从属窗口的尺寸。在本实施方式中,可以利用Window API监听主窗口的尺寸(包括长度和宽度)的变化情况,当Window API监听到主窗口的长度或者宽度发生变化时,根据监听到的尺寸变化量重新调节从属窗口的尺寸(包括长度和宽度),使得从属窗口始终能够与主窗口拼接,从而始终能够与主窗口相匹配,例如,当Window API监听到主窗口的长度增加Δ时,则相应的部分从属窗口的长度也需增加Δ,以此保证得到与主窗口相匹配的从属窗口,从而保证从属窗口拼接在主窗口边框处并形成主窗口的边框阴影。通过实施本实施方式,当主窗口的长度和/或宽度发生改变时,从属窗口的长度和/或宽度随之改变,因此主窗口的边框阴影显示效果不会随主窗口的缩放而产生变化,进一步保证了窗口边框阴影的正常显示效果。
作为一种具体的实施方式,窗口边框阴影显示方法还包括以下步骤:监听主窗口的屏幕坐标变化,根据监听到的坐标变化量调节从属窗口的屏幕坐标。当用户改变主窗口在显示屏幕上的位置即改变主窗口的屏幕坐标时,本实施方式通过监听主窗口的屏幕坐标变化这一事件,根据监听到的主窗口的坐标变化量调节从属窗口的屏幕坐标,例如以显示屏幕左上角为坐标原点、水平向右的方向为x轴正方向、与x轴垂直向下的方向为y轴正方向建立坐标系,Window API监听到主窗口的屏幕坐标由原来的(window.left,window.top)变化为(window.left+window.x,window.top+window.y),为了保证能够得到与主窗口实时匹配的从属窗口,从属窗口的屏幕坐标也需要进行调整,从属窗口的屏幕坐 标的横坐标需增加window.x,纵坐标需增加window.y,以此保证从属窗口能够与主窗口相匹配,从而保证从属窗口拼接在主窗口边框处并形成主窗口的边框阴影。通过实施本实施方式,当主窗口的屏幕坐标发生改变时,从属窗口的屏幕坐标随之改变,因此主窗口的边框阴影显示效果不会随主窗口在显示屏幕上的位置的变化而产生变化,进一步保证了窗口边框阴影的正常显示效果。
作为一种具体的实施方式,窗口边框阴影显示方法还包括以下步骤:当监听到主窗口的窗口最大化指令或者窗口最小化指令时,隐藏已显示的从属窗口。在本实施方式中,对是否接收到主窗口的窗口最大化指令或者窗口最小化指令这一事件进行监听,当监听到主窗口的窗口最大化指令时,此时由于主窗口将在显示屏幕上进行全屏显示,主窗口的边框与显示屏幕的边界重合,不需要对主窗口的边框阴影进行显示,因此当监听到主窗口的窗口最大化指令时,隐藏已显示从属窗口,停止对从属窗口的渲染,从而释放系统内存资源;当监听到主窗口的窗口最小化指令时,此时由于主窗口将不再显示屏幕上进行显示,因此也不需要对主窗口的边框阴影进行显示,当监听到主窗口的窗口最小化指令时,隐藏已显示的从属窗口,停止对从属窗口的渲染,从而释放系统内存资源。本实施方式针对主窗口的不同显示状态,当主窗口被最大化或者最小化时,都将已显示的从属窗口进行隐藏,即不对主窗口的边框阴影进行显示,因而进一步节约了系统内存资源。
相应地,本发明还提出一种窗口边框阴影显示装置,该装置包括窗口创建单元100、调节单元200和计算显示单元300,下面对上述各个单元及其功能分别进行介绍:
窗口创建单元100用于创建拼接在主窗口边框处的从属窗口,其中主窗口为非Layered Window,从属窗口为Layered Window。主窗口是用于在操作系统中正常呈现软件的显示界面的窗口,在已创建的一个主窗口的基础之上,窗口创建单元100通过Window API创建从属窗口,且从属窗口拼接在主窗口的边框处,以便拼接出主窗口的边框阴影效果,其中主窗口的哪些边框与从属窗口拼接、与主窗口拼接的从属窗口的数量都可以视具体的主窗口边框阴影显示预期效果而定,同时窗口创建单元100将主窗口设置为Layered Window,从属窗口 设置为Layered Window,其中Layered Window是Windows系统中定义的一种窗口实现方式,与非Layered Window相比,Layered Window可以呈现出半透明的效果,但是会占用更多的内存,且渲染性能不理想。作为一种具体的实施方式,在窗口创建单元100创建从属窗口时,窗口创建单元100使得主窗口的每一边框均与一个从属窗口相拼接,窗口创建单元100采用本实施方式所提出的创建从属窗口的方法,最大程度上减小了需创建的从属窗口的总数量,从而简化主窗口边框阴影显示的过程,提高边框阴影显示效率,而且通过在主窗口的每一边框处均拼接一个从属窗口,最终可使得主窗口的四周边框均有阴影显示效果,更符合人的视觉习惯。
调节单元200用于根据主窗口的尺寸调节从属窗口的尺寸,根据主窗口的屏幕坐标调节从属窗口的屏幕坐标。下面以常见的具有4条边框的主窗口、假设窗口创建单元100创建4个拼接在主窗口不同边框处的从属窗口为例,对调节单元200加以说明:
一方面,调节单元200根据主窗口的尺寸(包括长度和/或宽度)分别设定各个从属窗口的尺寸(包括长度和/或宽度),具体地,将各个从属窗口分别标记为上从属窗口、下从属窗口、左从属窗口和右从属窗口,如图2所示,主窗口的长度和宽度分别记为window.length和window.width,上从属窗口的宽度记为radius.top,下从属窗口的宽度记为radius.bottom,左从属窗口的宽度记为radius.left,右从属窗口的宽度记为radius.right,根据图2可知,调节单元根据主窗口的尺寸调节从属窗口的尺寸的方法如下,拼接在主窗口上边框处的上从属窗口的长度与拼接在主窗口下边框处的下从属窗口的长度相同,均为radius.left+window.length+radius.right,拼接在主窗口左边框处的左从属窗口的长度与拼接在主窗口右边框处的右从属窗口的长度相同,均为radius.top+window.width+radius.bottom,其中各个从属窗口的宽度radius.top、radius.bottom、radius.left、radius.right可以根据主窗口的尺寸以及边框阴影显示效果进行灵活地设定,作为其中的一种具体的实施方式,当从属窗口的数量大于一个时,调节单元200设定各个从属窗口的宽度均相同,以上述4个从属窗口为例,各个从属窗口的宽度均相同,即radius.top=radius.bottom=radius.left=radius.right,将各个从属 窗口的宽度统一化,可以根据窗口的对称性来简化计算显示单元300对从属窗口的像素点透明度计算,从而提高主窗口边框阴影显示的效率;
另一方面,调节单元200根据主窗口的屏幕坐标调节从属窗口的屏幕坐标,具体地,调节单元200对从属窗口的屏幕坐标的调节方法如下:在显示技术领域,以显示屏幕左上角为坐标原点,水平向右的方向为x轴正方向,与x轴垂直向下的方向为y轴正方向建立坐标系,主窗口的屏幕坐标指的是主窗口左上角在所建坐标系下的坐标位置,例如,将主窗口的屏幕坐标记为(window.left,window.top),根据主窗口的屏幕坐标可以计算出从属窗口的屏幕坐标,例如,以图2所示的上从属窗口为例,上从属窗口的左上角在所建坐标系下的坐标位置可以根据主窗口的屏幕坐标和从属窗口的尺寸计算得到,上从属窗口的左上角的坐标位置应该为(window.left-radius.left,window.top-radius.top),即上从属窗口的屏幕坐标为(window.left-radius.left,window.top-radius.top),其他从属窗口的屏幕坐标以此类推。
计算显示单元300用于计算从属窗口的像素点透明度,并根据计算结果对从属窗口进行显示。对从属窗口的尺寸和屏幕坐标进行调节后,计算显示单元300需计算从属窗口包括的像素点的透明度,即对从属窗口进行像素点透明度计算,从而通过对从属窗口的像素点的透明度的计算和设置,实现主窗口边框阴影显示的效果。作为一种具体的实施方式,计算显示单元300包括透明度计算单元,透明度计算单元用于计算从属窗口所包括的各个像素点的透明度,具体地,主窗口的每一边框均与一个从属窗口相拼接,将各个从属窗口分别标记为第一从属窗口、第二从属窗口、第三从属窗口和第四从属窗口,对于第一从属窗口和第三从属窗口,透明度计算单元分别设定第一从属窗口和第三从属窗口的第一行像素点的透明度为1,其他行像素点由1开始依次递减计算,直至最后一行像素点的透明度为0;对于第二从属窗口和第四从属窗口,透明度计算单元分别设定第二从属窗口和第四从属窗口的第一列像素点的透明度为1,其他列像素点由1开始依次递减计算,直至最后一列像素点的透明度为0。
透明度计算单元计算从属窗口的像素点透明度的有多种方法,在其中一种可行的方法中,透明度计算单元可以将各个从属窗口中与主窗口边框拼接的一 侧的像素点(即第一行像素点或第一列像素点)的透明度设置为1,将各个从属窗口中与主窗口边框拼接的一侧的对侧的像素点(即最后一行像素点或最后一列像素点)的透明度设置为0,其他行像素点或者其他列像素点的透明度均从1至0依次递减获得,例如,以拼接于主窗口左侧的从属窗口(左从属窗口)为例,该从属窗口的宽度为radius.left,即有radius.left列像素点,透明度计算单元设定该从属窗口与主窗口的边框拼接的一侧的第一列像素点的透明度都为1(即完全不透明),而在第一列像素点之后的每一列像素点的透明度依次递减,直至第radius.left列像素点的透明度为0(即完全透明),除第一列像素点和第radius.left列像素点外,其他列像素点的透明度均为半透明,同理,透明度计算单元对其他从属窗口也分别进行像素点透明度计算;透明度计算单元得到各个从属窗口中各个像素点的透明度后,计算显示单元300根据计算得到的透明度对各个从属窗口进行显示,即将各个从属窗口中的像素点渲染成具有不同透明度的像素点,渲染后得到的全部从属窗口一起拼接在主窗口的四周边框处,最终得到主窗口的边框阴影显示结果。
在上述窗口边框阴影显示装置中,当各个从属窗口的宽度均相同时,根据对称原则,可减少透明度计算单元对部分从属窗口的像素点透明度的计算量,从而提高窗口边框阴影显示的处理速度,此外,由于窗口边框阴影显示效果可以多种多样,例如只显示窗口某一边框的阴影、各个边框的阴影程度不一样等,用户可根据自身需求或喜好进行设定,因此对于本领域技术人员而言,透明度计算单元对各个从属窗口进行像素点透明度计算时所采用的具体计算方法可以根据对窗口边框阴影显示效果的预期而进行相应的调整。
本实施例所提出的窗口边框阴影显示装置利用主窗口正常呈现软件的显示界面,以拼接在主窗口边框处的、与主窗口相匹配的从属窗口实现主窗口的边框阴影显示,并将主窗口设置为非Layered Window,从属窗口设置为Layered Window,由于主窗口是非Layered Window,因此该区域的内存占用不会随主窗口面积的增大而等比增加,从而极大地节约了系统的内存占用,而从属窗口虽然是Layered Window,但是由于在实现主窗口边框阴影显示时,从属窗口的面积相对于主窗口面积往往较小,因此从属窗口的内存占用有限,相比于将主窗 口标记为Layered Window以实现窗口边框阴影显示的方法而言,仍在整体上减小了系统的内存占用;此外,由于主窗口是非Layered Window,其不会受到Layered Window所带来的性能影响,因此本实施例所提出的窗口边框阴影显示装置具有更好的窗口渲染性能。
作为一种具体的实施方式,窗口边框阴影显示装置还包括监听单元,下面对监听单元及其功能进行详细介绍:
监听单元监听主窗口的尺寸变化,调节单元根据监听单元监听到的尺寸变化量调节从属窗口的尺寸。在本实施方式中,监听单元可以利用Window API监听主窗口的尺寸(包括长度和宽度)的变化情况,当Window API监听到主窗口的长度或者宽度发生变化时,调节单元根据监听单元监听到的尺寸变化量重新调节从属窗口的尺寸(包括长度和宽度),使得从属窗口始终能够与主窗口拼接,从而始终能够与主窗口相匹配,例如,当监听单元监听到主窗口的长度增加Δ时,则调节单元将相应的部分从属窗口的长度也增加Δ,以此保证得到与主窗口相匹配的从属窗口,从而保证从属窗口拼接在主窗口边框处并形成主窗口的边框阴影。通过实施本实施方式,当主窗口的长度和/或宽度发生改变时,从属窗口的长度和/或宽度随之改变,因此主窗口的边框阴影显示效果不会随主窗口的缩放而产生变化,进一步保证了窗口边框阴影的正常显示效果。
此外,监听单元还监听主窗口的屏幕坐标变化,调节单元根据监听单元监听到的坐标变化量调节从属窗口的屏幕坐标。当用户改变主窗口在显示屏幕上的位置即改变主窗口的屏幕坐标时,本实施方式的监听单元通过监听主窗口的屏幕坐标变化这一事件,调节单元根据监听单元监听到的主窗口的坐标变化量调节从属窗口的屏幕坐标,例如以显示屏幕左上角为坐标原点、水平向右的方向为x轴正方向、与x轴垂直向下的方向为y轴正方向建立坐标系,Window API监听到主窗口的屏幕坐标由原来的(window.left,window.top)变化为(window.left+window.x,window.top+window.y),为了保证能够得到与主窗口实时匹配的从属窗口,从属窗口的屏幕坐标也需要改变,调节单元将从属窗口的屏幕坐标的横坐标增加window.x,纵坐标增加window.y,以此保证从属窗口能够与主窗口相匹配,从而保证从属窗口拼接在主窗口边框处并形成主窗口的边 框阴影。通过实施本实施方式,当主窗口的屏幕坐标发生改变时,从属窗口的屏幕坐标随之改变,因此主窗口的边框阴影显示效果不会随主窗口在显示屏幕上的位置的变化而产生变化,进一步保证了窗口边框阴影的正常显示效果。
当监听单元监听到主窗口的窗口最大化指令或者窗口最小化指令时,计算显示单元隐藏从属窗口。在本实施方式中,监听单元对是否接收到主窗口的窗口最大化指令或者窗口最小化指令这一事件进行监听,当监听到主窗口的窗口最大化指令时,此时由于主窗口将在显示屏幕上进行全屏显示,主窗口的边框与显示屏幕的边界重合,计算显示单元不需要对主窗口的边框阴影进行显示,因此当监听单元监听到主窗口的窗口最大化指令时,计算显示单元隐藏从属窗口,停止对从属窗口的渲染,从而释放系统内存资源;当监听单元监听到主窗口的窗口最小化指令时,此时由于主窗口将不再显示屏幕上进行显示,因此也不需要计算显示单元对主窗口的边框阴影进行显示,当监听单元监听到主窗口的窗口最小化指令时,计算显示单元隐藏从属窗口,停止对从属窗口的渲染,从而释放系统内存资源。本实施方式针对主窗口的不同显示状态,当主窗口被最大化或者最小化时,都将从属窗口进行隐藏,即不对主窗口的边框阴影进行显示,从而进一步节约了系统内存资源。
本发明窗口边框阴影显示装置中各个单元其具体功能的实现方法,可以参照上述的窗口边框阴影显示方法实施例中描述的实现方法,此处不再赘述。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种窗口边框阴影显示方法,其特征在于,包括以下步骤:
    创建拼接在主窗口边框处的从属窗口,所述主窗口为非Layered Window,所述从属窗口为Layered Window;
    根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标;
    计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示。
  2. 根据权利要求1所述的窗口边框阴影显示方法,其特征在于,还包括以下步骤:
    监听所述主窗口的尺寸变化,根据监听到的尺寸变化量调节所述从属窗口的尺寸。
  3. 根据权利要求1所述的窗口边框阴影显示方法,其特征在于,还包括以下步骤:
    监听所述主窗口的屏幕坐标变化,根据监听到的坐标变化量调节所述从属窗口的屏幕坐标。
  4. 根据权利要求1所述的窗口边框阴影显示方法,其特征在于,还包括以下步骤:
    当监听到所述主窗口的窗口最大化指令或者窗口最小化指令时,隐藏已显示的所述从属窗口。
  5. 根据权利要求1至4中任一项所述的窗口边框阴影显示方法,其特征在于,
    所述主窗口的每一边框均与一个所述从属窗口相拼接。
  6. 根据权利要求5所述的窗口边框阴影显示方法,其特征在于,计算所述从属窗口的像素点透明度的过程包括:
    将各个所述从属窗口分别标记为第一从属窗口、第二从属窗口、第三从属窗口和第四从属窗口,
    对于所述第一从属窗口和所述第三从属窗口,分别设定所述第一从属窗口 和所述第三从属窗口的第一行像素点的透明度为1,其他行像素点由1开始依次递减计算,直至最后一行像素点的透明度为0;
    对于所述第二从属窗口和所述第四从属窗口,分别设定所述第二从属窗口和所述第四从属窗口的第一列像素点的透明度为1,其他列像素点由1开始依次递减计算,直至最后一列像素点的透明度为0。
  7. 根据权利要求1至4中任一项所述的窗口边框阴影显示方法,其特征在于,
    当所述从属窗口的数量大于一个时,各个所述从属窗口的宽度均相同。
  8. 一种窗口边框阴影显示装置,其特征在于,包括:
    窗口创建单元,用于创建拼接在主窗口边框处的从属窗口,所述主窗口为非Layered Window,所述从属窗口为Layered Window;
    调节单元,用于根据所述主窗口的尺寸调节所述从属窗口的尺寸,根据所述主窗口的屏幕坐标调节所述从属窗口的屏幕坐标;
    计算显示单元,用于计算所述从属窗口的像素点透明度,并根据计算结果对所述从属窗口进行显示。
  9. 根据权利要求8所述的窗口边框阴影显示装置,其特征在于,还包括监听单元,
    所述监听单元监听所述主窗口的尺寸变化,所述调节单元根据所述监听单元监听到的尺寸变化量调节所述从属窗口的尺寸;
    或者
    所述监听单元监听所述主窗口的屏幕坐标变化,所述调节单元根据所述监听单元监听到的坐标变化量调节所述从属窗口的屏幕坐标;
    或者
    当所述监听单元监听到所述主窗口的窗口最大化指令或者窗口最小化指令时,所述计算显示单元隐藏已显示的所述从属窗口。
  10. 根据权利要求8所述的窗口边框阴影显示装置,其特征在于,所述计算显示单元包括透明度计算单元,
    所述主窗口的每一边框均与一个所述从属窗口相拼接,将各个所述从属窗 口分别标记为第一从属窗口、第二从属窗口、第三从属窗口和第四从属窗口,
    对于所述第一从属窗口和所述第三从属窗口,所述透明度计算单元分别设定所述第一从属窗口和所述第三从属窗口的第一行像素点的透明度为1,其他行像素点由1开始依次递减计算,直至最后一行像素点的透明度为0;
    对于所述第二从属窗口和所述第四从属窗口,所述透明度计算单元分别设定所述第二从属窗口和所述第四从属窗口的第一列像素点的透明度为1,其他列像素点由1开始依次递减计算,直至最后一列像素点的透明度为0。
PCT/CN2016/113224 2016-06-12 2016-12-29 窗口边框阴影显示方法及装置 WO2017215247A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
ES16905354T ES2890828T3 (es) 2016-06-12 2016-12-29 Método y dispositivo de visualización de sombra de borde de ventana
EP16905354.3A EP3470967B1 (en) 2016-06-12 2016-12-29 Window border shadow display method and device
US16/308,728 US10636191B2 (en) 2016-06-12 2016-12-29 Method and apparatus of displaying window border shadow

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610417380.8A CN105930037B (zh) 2016-06-12 2016-06-12 窗口边框阴影显示方法及装置
CN201610417380.8 2016-06-12

Publications (1)

Publication Number Publication Date
WO2017215247A1 true WO2017215247A1 (zh) 2017-12-21

Family

ID=56834039

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113224 WO2017215247A1 (zh) 2016-06-12 2016-12-29 窗口边框阴影显示方法及装置

Country Status (5)

Country Link
US (1) US10636191B2 (zh)
EP (1) EP3470967B1 (zh)
CN (1) CN105930037B (zh)
ES (1) ES2890828T3 (zh)
WO (1) WO2017215247A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930037B (zh) 2016-06-12 2018-12-28 广州视睿电子科技有限公司 窗口边框阴影显示方法及装置
CN106814933B (zh) * 2016-12-15 2019-08-13 广州视源电子科技股份有限公司 窗口阴影显示方法及装置
CN110032372A (zh) * 2018-01-11 2019-07-19 武汉斗鱼网络科技有限公司 一种创建窗口边框的方法、装置及计算机设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070139430A1 (en) * 2005-12-21 2007-06-21 Microsoft Corporation Rendering "gadgets" with a browser
US7712046B2 (en) * 2005-08-04 2010-05-04 Microsoft Corporation Virtual magnifying glass with intuitive use enhancements
CN102915349A (zh) * 2012-09-27 2013-02-06 北京奇虎科技有限公司 在浏览器中显示网页的方法及在浏览器中显示的网页组件
CN103473077A (zh) * 2013-09-27 2013-12-25 珠海市君天电子科技有限公司 丰富应用程序主窗口显示界面的方法及装置
CN103631893A (zh) * 2013-11-15 2014-03-12 北京奇虎科技有限公司 一种浏览器控制方法和浏览器
CN105930037A (zh) * 2016-06-12 2016-09-07 广州视睿电子科技有限公司 窗口边框阴影显示方法及装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5388202A (en) * 1990-02-02 1995-02-07 Viacom International Inc. Method and apparatus for generating window borders having pictorial frame elements
US7168048B1 (en) * 1999-03-24 2007-01-23 Microsoft Corporation Method and structure for implementing a layered object windows
US6549218B1 (en) * 1999-03-31 2003-04-15 Microsoft Corporation Dynamic effects for computer display windows
WO2004104982A1 (en) * 2003-05-14 2004-12-02 Collaborative Sciences And Technology, Inc. Persistent portal
US20060031779A1 (en) * 2004-04-15 2006-02-09 Citrix Systems, Inc. Selectively sharing screen data
US20060059432A1 (en) * 2004-09-15 2006-03-16 Matthew Bells User interface having viewing area with non-transparent and semi-transparent regions
US20090319933A1 (en) * 2008-06-21 2009-12-24 Microsoft Corporation Transacted double buffering for graphical user interface rendering
US9804727B2 (en) * 2010-03-09 2017-10-31 Freedom Scientific, Inc. Flexible display of visual content on multiple display devices
US20120042275A1 (en) * 2010-08-10 2012-02-16 Microsoft Corporation Cloning specific windows on a wireless display surface
CN104572271B (zh) * 2015-02-04 2018-04-13 北京瑞星网安技术股份有限公司 多标签页浏览器防假死的方法和系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7712046B2 (en) * 2005-08-04 2010-05-04 Microsoft Corporation Virtual magnifying glass with intuitive use enhancements
US20070139430A1 (en) * 2005-12-21 2007-06-21 Microsoft Corporation Rendering "gadgets" with a browser
CN102915349A (zh) * 2012-09-27 2013-02-06 北京奇虎科技有限公司 在浏览器中显示网页的方法及在浏览器中显示的网页组件
CN103473077A (zh) * 2013-09-27 2013-12-25 珠海市君天电子科技有限公司 丰富应用程序主窗口显示界面的方法及装置
CN103631893A (zh) * 2013-11-15 2014-03-12 北京奇虎科技有限公司 一种浏览器控制方法和浏览器
CN105930037A (zh) * 2016-06-12 2016-09-07 广州视睿电子科技有限公司 窗口边框阴影显示方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3470967A4 *

Also Published As

Publication number Publication date
CN105930037A (zh) 2016-09-07
CN105930037B (zh) 2018-12-28
US10636191B2 (en) 2020-04-28
EP3470967B1 (en) 2021-08-25
EP3470967A1 (en) 2019-04-17
ES2890828T3 (es) 2022-01-24
US20190147634A1 (en) 2019-05-16
EP3470967A4 (en) 2019-10-02

Similar Documents

Publication Publication Date Title
US8464165B2 (en) Multi-way video conferencing user interface
AU2014202127B2 (en) A method and apparatus to reduce display lag using image overlay
CA2558013C (en) Display updates in a windowing system using a programmable graphics processing unit.
WO2017215247A1 (zh) 窗口边框阴影显示方法及装置
EP2765769A1 (en) Image processing method and image processing device
KR102199357B1 (ko) 터치 이벤트들의 레이턴시를 감소시키는 방법 및 그 시스템
CN105869579B (zh) 背光亮度调整方法、装置及显示终端
WO2020001022A1 (zh) 图片展示方法、计算设备及计算机存储介质
EP2927876A1 (en) Generation of display overlay parameters utilizing touch inputs
CN103473077A (zh) 丰富应用程序主窗口显示界面的方法及装置
WO2018107854A1 (zh) 窗口阴影显示方法及装置
JP2015207287A (ja) 映像表示システム
TWI780497B (zh) 顯示系統、顯示方法及顯示器
CN109302629B (zh) 一种用于为图片切换画框的方法及显示终端
CN111010605B (zh) 一种视频画中画窗口的显示方法
CN107426601A (zh) 一种智能电视中ui控件的显示方法及装置
WO2017202110A1 (zh) 用于显示图像的方法、装置和系统
US9959637B2 (en) Method and apparatus for processing border of computer figure to be merged into background image
CN114255230A (zh) 基于人脸特征点的人像下颌线修图方法和装置以及设备
JP5771457B2 (ja) マルチディスプレイシステム
CN106777725B (zh) 微循环图像算法的验证方法及装置
CN101086835A (zh) 一种滚动显示图片的方法及装置
WO2020043109A1 (zh) 一种图片显示方法及装置
CN103885741B (zh) 一种图片显示方法及装置
CN106937104B (zh) 一种图像处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16905354

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2016905354

Country of ref document: EP

Effective date: 20190114