CN108255488B - Method and device for creating window frame and computer equipment - Google Patents

Method and device for creating window frame and computer equipment Download PDF

Info

Publication number
CN108255488B
CN108255488B CN201810027610.9A CN201810027610A CN108255488B CN 108255488 B CN108255488 B CN 108255488B CN 201810027610 A CN201810027610 A CN 201810027610A CN 108255488 B CN108255488 B CN 108255488B
Authority
CN
China
Prior art keywords
window
frame
drawing area
parameter
display window
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
CN201810027610.9A
Other languages
Chinese (zh)
Other versions
CN108255488A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810027610.9A priority Critical patent/CN108255488B/en
Publication of CN108255488A publication Critical patent/CN108255488A/en
Application granted granted Critical
Publication of CN108255488B publication Critical patent/CN108255488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a method, a device and computer equipment for creating a window frame, which are applied to a live broadcast platform, wherein the method comprises the following steps: setting a current window as a frameless window according to the received window attribute; acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle; setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter; constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frame respectively by using the frame gradual change brush; and updating the drawn frame display window.

Description

Method and device for creating window frame and computer equipment
Technical Field
The invention belongs to the technical field of webpage window manufacturing, and particularly relates to a method and a device for creating a window frame, a calculation method and a calculation device.
Background
The web page of the live platform is composed of a plurality of windows, for example, the online live area of the live platform includes a plurality of small windows, generally speaking, each small window is rectangular, and the edges or intersections of the windows or a blank is left between the windows. However, when the windows intersect, the intersection is overlapped, and the overlapped part is sharp, so that the display effect of the windows is poor.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method, a device, a calculation device and a device for creating a window frame, which are used for solving the technical problem that in the prior art, in the window display process of a live broadcast platform, the windows are not attractive due to the fact that the intersection parts of the windows are overlapped and the overlapped parts are suddenly displayed.
The embodiment of the invention provides a method for creating a window frame, which is applied to a live broadcast platform and comprises the following steps:
setting a current window as a frameless window according to the received window attribute;
acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
setting a second window parameter of the frame display window according to the first window parameter of the current window;
displaying the border display window based on the second window parameter;
constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and updating the drawn frame display window.
In the foregoing solution, the setting a second window parameter of the border display window according to the first window parameter of the current window includes:
acquiring a left pixel left, a right pixel right, an upper pixel top, a lower pixel bottom and a SHADOW display width SHADOW _ MARGIN of the current window;
determining the width of the frame display window according to a formula int width, right, rect, left + SHADOW _ region 2;
determining the height of the frame display window according to a formula int height, bottom-bottom, top + SHADOW _ region, 2; wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom and SHADOW display width SHADOW _ MARGIN of the current window; the second window parameter includes: the frame displays the width and height of the window.
In the foregoing solution, the constructing the drawing area of each vertex angle of the frame display window by using a preset rendering object includes:
creating a DIB independent bitmap structure;
creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file;
adding the bitmap handle to a pre-established Device object (DC);
creating a graphics device interface rendering object, adding the DC to the rendering object;
constructing a first drawing area by using the rendering object;
adding drawing directions of all vertex angles in the drawing area;
respectively drawing edge straight lines of all vertex angles;
cutting the first drawing area to obtain a second drawing area;
and adding a vertex angle with a preset shape and a preset size in the second drawing area.
In the foregoing solution, the method for constructing the drawing area gradient brush of the frame display window by using a preset rendering object includes:
acquiring a first middle color parameter fadeInColor of the drawing area gradient brush;
acquiring a first edge surrounding color parameter fadeOutcolor of the drawing area gradient brush;
and respectively setting a first alpha value of a first alpha channel of the fadeInColor and a second alpha value of a second alpha channel of the fadeOutColor according to the required gradient effect.
In the above scheme, the frame gradual change brush for constructing the frame display window by using the preset rendering object includes:
acquiring a second intermediate color parameter fadeInColor of the frame gradient paintbrush;
acquiring a surrounding color parameter fadeOutcolor of a second edge of the frame gradient paintbrush;
respectively setting a third alpha value of a third alpha channel of the fadeinColor and a fourth alpha value of a fourth alpha channel of the fadeiOutColor according to a required gradient effect;
and setting a drawing area matrix of the frame gradual change paintbrush according to the required frame size.
In the foregoing solution, after updating the frame display window after the secondary drawing, the method further includes:
monitoring message parameters in a message queue by using a message circulation function, and judging whether the message parameters are changed;
and under the condition that the message parameters are changed, calling a window callback function to process the message parameters.
The invention also provides a device for creating the window frame, which comprises:
the first setting unit is used for setting the current window as a frameless window according to the received window attribute;
the second setting unit is used for acquiring the window handle of the current window and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
the third setting unit is used for setting a second window parameter of the frame display window according to the first window parameter of the current window;
the display unit is used for displaying the frame display window based on the second window parameter;
the construction unit is used for constructing each vertex angle drawing area, the drawing area gradient brush and the frame gradient brush of the frame display window by using a preset rendering object;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and the updating unit is used for updating the drawn frame display window.
In the foregoing solution, the third setting unit is specifically configured to:
acquiring a left pixel left, a right pixel right, an upper pixel top, a lower pixel bottom and a SHADOW display width SHADOW _ MARGIN of the current window;
determining the width of the frame display window according to a formula int width, right, rect, left + SHADOW _ region 2;
determining the height of the frame display window according to a formula int height, bottom-bottom, top + SHADOW _ region, 2; wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom and SHADOW display width SHADOW _ MARGIN of the current window; the second window parameter includes: the frame displays the width and height of the window.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
setting a current window as a frameless window according to the received window attribute;
acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
setting a second window parameter of the frame display window according to the first window parameter of the current window;
displaying the border display window based on the second window parameter;
constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and updating the drawn frame display window.
The present invention also provides a computer device for creating a window border, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein,
the memory stores program instructions executable by the processor, the processor being capable of performing the method as described in any one of the above.
The invention provides a method, a device and computer equipment for creating a window frame, which are applied to a live broadcast platform, wherein the method comprises the following steps: setting a current window as a frameless window according to the received window attribute; acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle; setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter; constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush; updating the drawn frame display window; therefore, the drawing area gradient brush and the frame gradient brush are built, the drawing area gradient brush is used for drawing each vertex angle of the frame display window, the frame gradient brush is used for drawing each frame of the frame display window, the frame of the frame display window presents a gradient effect, the current window presents a gradient effect, the situation that the overlapped part of the windows is too steep is avoided, and the attractiveness of the window is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for creating a window frame according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for creating a window frame according to a second embodiment of the present invention;
fig. 3 is a schematic overall structural diagram of a computer device for creating a window frame according to a third embodiment of the present invention.
Detailed Description
In order to solve the technical problem that in the prior art, the windows are displayed unattractive due to the fact that the intersection of the windows are overlapped and the display is abrupt in the window display process, the embodiment of the invention provides a method, a device and computer equipment for creating a window frame, which are applied to a live broadcast platform, wherein the method comprises the following steps: setting a current window as a frameless window according to the received window attribute; acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle; setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter; constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush; and updating the drawn frame display window.
The technical solution of the present invention is further described in detail by the accompanying drawings and the specific embodiments.
Example one
The present embodiment provides a method for creating a window frame, which is applied to a live broadcast platform, and as shown in fig. 1, the method includes:
s101, setting a current window as a frameless window according to the received window attribute;
in this step, in order to avoid using the frame of the current window, the current window needs to be set to be frameless.
In general, when the window attribute is borderless, then the current window is set to a borderless window according to the received window attribute. Here, this embodiment is explained taking a QT window as an example.
S102, acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
then acquiring a window handle of the current window, registering a frame display window, and setting the current window as a parent window of the frame display window based on the window handle; specifically, the window handle of the current window is transferred to the border display window, so that the current window can be set as the parent window of the border display window.
S103, setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter;
in this step, before setting the second window parameter of the frame display window according to the first window parameter of the current window, a window callback function of the current window needs to be obtained, so that each message parameter can be monitored in the window operation process.
After a window callback function of a current window is acquired, setting a second window parameter of the frame display window according to a first window parameter of the current window;
specifically, a left pixel left, a right pixel right, an upper pixel top, a lower pixel bottom and a SHADOW display width SHADOW _ MARGIN of the current window are obtained;
determining the width int width of the frame display window according to a formula (1);
int width=rect.right-rect.left+SHADOW_MARGIN*2 (1)
determining the height int height of the frame display window according to a formula (2);
int height=rect.bottom-rect.top+SHADOW_MARGIN*2 (2)
wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom and SHADOW display width SHADOW _ MARGIN of the current window; the second window parameter includes: the frame displays the width and height of the window. Of course, the second window parameter further includes: the method comprises the following steps of expanding a window, pointing to a pointer of a registered class name, pointing to a pointer of a window name, the style of the window, the horizontal position of the window and the vertical position of the window; these parameters may be used by default.
And after the second window parameter is determined, based on the second window parameter, calling a window display function of the system to display the frame display window.
S104, constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object;
after a window display function of the system is called to display the frame display window, constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; the method comprises the following specific steps:
firstly, building each vertex angle drawing area of the frame display window by using a preset rendering object, wherein the method comprises the following steps:
creating a DIB independent bitmap structure; creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file; the bitmap handle is added to the pre-established device object DC to enable filling of the drawn pixel data into the DIB independent bitmap structure at the time of drawing.
Rendering an object by using the graphic Device Interface (GDI +, Graphics Device Interface plus) to construct a first rendering area; and adding the drawing direction of each vertex angle in the drawing area. The first drawing area is a GDI + drawing area, and the implementation code of the drawing direction with the addition of each vertex angle is as follows:
Status AddArc(IN INT x,IN INT y,IN INT width,IN INT height,IN REAL startAngle,IN REAL sweepAngle)
the x and the y are coordinates of a vertex angle, and the width and the height are respectively the width and the height of the vertex angle; the region formed by x, y, width and height is a rectangular region (the size of a vertex angle) of an angle, startAngle is an angle starting point, and sweet Angle is a sweeping angle; for example, when the drawing direction of the upper left corner is determined, startAngle is set to 180, and sweepAngle is set to 90.
After the drawing direction of the vertex angle is determined, respectively drawing the edge straight lines of all the vertex angles; cutting the first drawing area to obtain a second drawing area; and adding a vertex angle with a preset shape and a preset size in the second drawing area. The top corner rows in this embodiment are elliptical.
Then, a preset rendering object is utilized to construct the gradual change drawing brush of the drawing area of the frame display window, and the method comprises the following steps:
acquiring a first middle color parameter fadeInColor of the drawing area gradient brush;
acquiring a first edge surrounding color parameter fadeOutcolor of the drawing area gradient brush;
and respectively setting a first alpha value of a first alpha channel of the fadeInColor and a second alpha value of a second alpha channel of the fadeOutColor according to the required gradient effect.
Correspondingly, the frame gradual change brush for constructing the frame display window by using the preset rendering object comprises:
acquiring a second intermediate color parameter fadeInColor of the frame gradient paintbrush; acquiring a surrounding color parameter fadeOutcolor of a second edge of the frame gradient paintbrush; respectively setting a third alpha value of a third alpha channel of the fadeinColor and a fourth alpha value of a fourth alpha channel of the fadeiOutColor according to a required gradient effect; and setting a drawing area matrix of the frame gradual change paintbrush according to the required frame size.
S105, respectively drawing each vertex angle drawing area by using the drawing area gradual change brush, and respectively drawing each frame by using the frame gradual change brush;
and after the drawing area gradient brush and the frame gradient brush are built, drawing the vertex angle drawing areas respectively by using the drawing area gradient brush, and drawing each frame respectively by using the frame gradient brush.
Specifically, a GDI + filling function is called, the drawing area and the drawing area gradient brush are used as vertex angle drawing parameters of the GDI + filling function, and all vertex angles are drawn.
And calling a GDI + filling function, and using the drawing area matrix and the frame gradient brush as frame drawing parameters of the GDI + filling function to draw each frame.
And S106, updating the drawn frame display window.
And after the drawing is finished, updating the drawn frame display window, and placing the frame window below the current window. Thus, the frame of the current window is the gradual change effect.
Further, after updating the drawn frame display window, the method further includes:
monitoring message parameters in a message queue by using a message circulation function, and judging whether the message parameters are changed; and under the condition that the message parameters are changed, calling a window callback function to process the message parameters.
Specifically, a window movement message parameter WM _ MOVE is monitored, and when the current window movement changes the position of the border window, the callback function processes the message parameter, so that the border window is always centered with respect to the current window. And;
monitoring a window SIZE message parameter WM _ WM _ SIZE; when the window size of the current window is changed, the callback function processes the message parameter so as to correspondingly change the size of the frame window; and;
monitoring window hiding message parameter WM _ WM _ SIZE; when the current window is hidden, the callback function processes the message parameter to exception the current window; and
monitoring an updated picture message parameter WM _ PAINT of a window; and when the current window is updated, calling the primary drawing, secondary drawing and updating methods to update the picture of the current window.
Therefore, the dynamic state of the current window can be detected in real time, and the frame window is adjusted in real time.
Example two
Corresponding to the first embodiment, this embodiment provides an apparatus for creating a window frame, as shown in fig. 2, the apparatus includes: a first setting unit 21, a second setting unit 22, a third setting unit 23, a display unit 24, and a drawing unit 25; wherein,
in order to avoid using the border of the current window, the current window needs to be set to be borderless. In general, when the window attribute is borderless, the first setting unit 21 sets the current window to a borderless window according to the received window attribute.
The second setting unit 22 is configured to obtain a window handle of the current window, register a frame display window, and set the current window as a parent window of the frame display window based on the window handle; specifically, the window handle of the current window is transferred to the border display window, so that the current window can be set as the parent window of the border display window.
Here, before setting the second window parameter of the frame display window according to the first window parameter of the current window, the obtaining unit 26 needs to obtain the window callback function of the current window, so as to monitor each message parameter during the window operation process.
After acquiring the window callback function of the current window, the third setting unit 23 sets the second window parameter of the frame display window according to the first window parameter of the current window;
specifically, the third setting unit 23 obtains the left pixel left, the right pixel right, the upper pixel top, the lower pixel bottom, and the width SHADOW _ MARGIN of the SHADOW display of the current window;
determining the width int width of the frame display window according to a formula (1);
int width=rect.right-rect.left+SHADOW_MARGIN*2 (1)
determining the height int height of the frame display window according to a formula (2);
int height=rect.bottom-rect.top+SHADOW_MARGIN*2 (2)
wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom and SHADOW display width SHADOW _ MARGIN of the current window; the second window parameter includes: the frame displays the width and height of the window. Of course, the second window parameter further includes: the method comprises the following steps of expanding a window, pointing to a pointer of a registered class name, pointing to a pointer of a window name, the style of the window, the horizontal position of the window and the vertical position of the window; these parameters may be used by default.
After the second window parameter is determined, the display unit 24 is configured to call a window display function of the system to display the frame display window based on the second window parameter.
The drawing unit 25 constructs each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; the method comprises the following specific steps:
the drawing unit 25 first constructs each vertex angle drawing area of the frame display window by using a preset rendering object, including:
creating a DIB independent bitmap structure; creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file; the bitmap handle is added to the pre-established device object DC to enable filling of the drawn pixel data into the DIB independent bitmap structure at the time of drawing.
Constructing a first drawing area by using the graphic device interface GDI + rendering object; and adding the drawing direction of each vertex angle in the drawing area. The first drawing area is a GDI + drawing area, and the implementation code of the drawing direction with the addition of each vertex angle is as follows:
Status AddArc(IN INT x,IN INT y,IN INT width,IN INT height,IN REAL startAngle,IN REAL sweepAngle)
the x and the y are coordinates of a vertex angle, and the width and the height are respectively the width and the height of the vertex angle; the region formed by x, y, width and height is a rectangular region (the size of a vertex angle) of an angle, startAngle is an angle starting point, and sweet Angle is a sweeping angle; for example, when the drawing direction of the upper left corner is determined, startAngle is set to 180, and sweepAngle is set to 90.
After the drawing direction of the vertex angle is determined, the drawing unit 25 draws the edge straight lines of each vertex angle respectively; cutting the first drawing area to obtain a second drawing area; and adding a vertex angle with a preset shape and a preset size in the second drawing area. The top corner rows in this embodiment are elliptical.
The drawing unit 25 then constructs a drawing area gradient brush of the frame display window by using a preset rendering object, including:
acquiring a first middle color parameter fadeInColor of the drawing area gradient brush;
acquiring a first edge surrounding color parameter fadeOutcolor of the drawing area gradient brush;
and respectively setting a first alpha value of a first alpha channel of the fadeInColor and a second alpha value of a second alpha channel of the fadeOutColor according to the required gradient effect.
Accordingly, the drawing unit 25 constructs a frame gradient brush of the frame display window by using a preset rendering object, including:
acquiring a second intermediate color parameter fadeInColor of the frame gradient paintbrush; acquiring a surrounding color parameter fadeOutcolor of a second edge of the frame gradient paintbrush; respectively setting a third alpha value of a third alpha channel of the fadeinColor and a fourth alpha value of a fourth alpha channel of the fadeiOutColor according to a required gradient effect; and setting a drawing area matrix of the frame gradual change paintbrush according to the required frame size.
After the drawing area gradient brush and the frame gradient brush are constructed, the drawing unit 25 further needs to draw each vertex angle drawing area by using the drawing area gradient brush, and draw the frame by using the frame gradient brush.
Specifically, the drawing unit 25 calls a GDI + fill function and draws the drawing area and the drawing area gradient brush as vertex angle drawing parameters of the GDI + fill function, thereby drawing each vertex angle.
And calling a GDI + filling function, and using the drawing area matrix and the frame gradient brush as frame drawing parameters of the GDI + filling function to draw each frame.
And after the drawing is finished, updating the drawn frame display window, and placing the frame window below the current window. Thus, the frame of the current window is the gradual change effect.
Therefore, after the frame display window is updated, the frame display window is a gradually-changed window, and a gradually-changed effect can be presented at the intersection of the window frames.
Here, after updating the frame display window after the second rendering, the monitoring unit 27 is configured to:
monitoring message parameters in a message queue by using a message circulation function, and judging whether the message parameters are changed; and under the condition that the message parameters are changed, calling a window callback function to process the message parameters.
Specifically, a window movement message parameter WM _ MOVE is monitored, and when the current window movement changes the position of the border window, the callback function processes the message parameter, so that the border window is always centered with respect to the current window. And;
monitoring a window SIZE message parameter WM _ WM _ SIZE; when the window size of the current window is changed, the callback function processes the message parameter so as to correspondingly change the size of the frame window; and;
monitoring window hiding message parameter WM _ WM _ SIZE; when the current window is hidden, the callback function processes the message parameter to exception the current window; and
monitoring an updated picture message parameter WM _ PAINT of a window; and when the current window is updated, calling the primary drawing, secondary drawing and updating methods to update the picture of the current window.
Thus, the dynamic state of the current window can be detected in real time, and the frame window is adjusted in real time
EXAMPLE III
The present embodiment further provides a computer device for creating a window frame, as shown in fig. 3, the computer device includes: radio Frequency (RF) circuitry 310, memory 320, input unit 330, display unit 340, audio circuitry 350, WiFi module 360, processor 370, and power supply 380. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 3 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The following describes the components of the computer device in detail with reference to fig. 3:
RF circuitry 310 may be used for receiving and transmitting signals, and in particular, for receiving downlink information from base stations and processing the received downlink information to processor 370. In general, the RF circuit 310 includes, but is not limited to, at least one Amplifier, transceiver, coupler, Low Noise Amplifier (LNA), duplexer, and the like.
The memory 320 may be used to store software programs and modules, and the processor 370 may execute various functional applications of the computer device and data processing by operating the software programs and modules stored in the memory 320. The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 320 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 330 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. Specifically, the input unit 330 may include a keyboard 331 and other input devices 332. The keyboard 331 can collect the input operation of the user thereon and drive the corresponding connection device according to a preset program. The keyboard 331 collects the output information and sends it to the processor 370. The input unit 330 may include other input devices 332 in addition to the keyboard 331. In particular, other input devices 332 may include, but are not limited to, one or more of a touch panel, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 340 may be used to display information input by a user or information provided to the user and various menus of the computer device. The Display unit 340 may include a Display panel 341, and optionally, the Display panel 341 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the keyboard 331 may cover the display panel 341, and when the keyboard 331 detects a touch operation on or near the keyboard 331, the keyboard 331 transmits the touch event to the processor 370 to determine the type of the touch event, and then the processor 370 provides a corresponding visual output on the display panel 341 according to the type of the input event. Although the keyboard 331 and the display panel 341 are shown in fig. 3 as two separate components to implement input and output functions of the computer device, in some embodiments, the keyboard 331 and the display panel 341 may be integrated to implement input and output functions of the computer device.
Audio circuitry 350, speaker 351, microphone 352 may provide an audio interface between a user and a computer device. The audio circuit 350 may transmit the electrical signal converted from the received audio data to the speaker 351, and the electrical signal is converted into a sound signal by the speaker 351 and output;
WiFi belongs to short-distance wireless transmission technology, and computer equipment can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 360, and provides wireless broadband internet access for the user. Although fig. 3 shows the WiFi module 360, it is understood that it does not belong to the essential constitution of the computer device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 370 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, performs various functions of the computer device and processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory 320, thereby monitoring the computer device as a whole. Alternatively, processor 370 may include one or more processing units; preferably, the processor 370 may be integrated with an application processor, wherein the application processor primarily handles operating systems, user interfaces, application programs, and the like.
The computer device also includes a power supply 380 (such as a power adapter) for powering the various components, which may preferably be logically connected to the processor 370 through a power management system.
The method, the device and the computer equipment for creating the window frame provided by the embodiment of the invention have the beneficial effects that at least:
the embodiment of the invention provides a method and a device for creating a window frame and computer equipment, which are applied to a live broadcast platform, wherein the method comprises the following steps: setting a current window as a frameless window according to the received window attribute; acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle; setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter; constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush; updating the drawn frame display window; therefore, the drawing area gradient brush and the frame gradient brush are built, the drawing area gradient brush is used for drawing each vertex angle of the frame display window, the frame gradient brush is used for drawing each frame of the frame display window, the frame of the frame display window presents a gradient effect, the current window presents a gradient effect, the situation that the windows are intersected and too steep is avoided, and the attractiveness of the window is improved.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on a computer-readable storage medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website, or provided on a carrier signal, or provided in any other form; the program when executed by a processor implements the steps of: setting a current window as a frameless window according to the received window attribute; acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle; setting a second window parameter of the frame display window according to the first window parameter of the current window; displaying the border display window based on the second window parameter; constructing each vertex angle drawing area, a drawing area gradient brush and a frame gradient brush of the frame display window by using a preset rendering object; drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush; and updating the drawn frame display window.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.

Claims (9)

1. A method for creating a window frame is applied to a live platform, and the method comprises the following steps:
setting a current window as a frameless window according to the received window attribute;
acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
setting a second window parameter of the frame display window according to the first window parameter of the current window, wherein the second window parameter comprises: the width and height of the frame display window, the expansion style of the window, a pointer pointing to a registered class name, a pointer pointing to a window name, the style of the window, the horizontal position of the window and the vertical position of the window;
displaying the border display window based on the second window parameter;
the method comprises the following steps of constructing each vertex angle drawing area, a drawing area gradual change brush and a frame gradual change brush of the frame display window by using a preset rendering object, wherein the step of constructing each vertex angle drawing area of the frame display window by using the preset rendering object comprises the following steps of: creating a DIB independent bitmap structure; creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file; adding the bitmap handle to a pre-established device object DC; creating a graphics device interface rendering object, adding the DC to the rendering object; constructing a first drawing area by using the rendering object; adding drawing directions of all vertex angles in the drawing area; respectively drawing edge straight lines of all vertex angles; cutting the first drawing area to obtain a second drawing area; adding a vertex angle with a preset shape and a preset size in the second drawing area;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and updating the drawn frame display window.
2. The method of claim 1, wherein the setting a second window parameter of the bezel display window according to the first window parameter of the current window comprises:
acquiring a left pixel left, a right pixel right, an upper pixel top, a lower pixel bottom and a SHADOW display width SHADOW _ MARGIN of the current window;
determining the width of the frame display window according to a formula int width, right, rect, left + SHADOW _ region 2;
determining the height of the frame display window according to a formula int height, bottom-bottom, top + SHADOW _ region, 2; wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom, and SHADOW display width SHADOW _ MARGIN of the current window.
3. The method of claim 1, wherein constructing the drawing area gradient brush of the bezel display window using the preset rendering objects comprises:
acquiring a first middle color parameter fadeInColor of the drawing area gradient brush;
acquiring a first edge surrounding color parameter fadeOutcolor of the drawing area gradient brush;
and respectively setting a first alpha value of a first alpha channel of the fadeInColor and a second alpha value of a second alpha channel of the fadeOutColor according to the required gradient effect.
4. The method of claim 1, wherein constructing the bezel gradient brush for the bezel display window using the preset rendering objects comprises:
acquiring a second intermediate color parameter fadeInColor of the frame gradient paintbrush;
acquiring a surrounding color parameter fadeOutcolor of a second edge of the frame gradient paintbrush;
respectively setting a third alpha value of a third alpha channel of the fadeinColor and a fourth alpha value of a fourth alpha channel of the fadeiOutColor according to a required gradient effect;
and setting a drawing area matrix of the frame gradual change paintbrush according to the required frame size.
5. The method of claim 1, wherein after updating the bounding box display window after the second rendering, further comprising:
monitoring message parameters in a message queue by using a message circulation function, and judging whether the message parameters are changed;
and under the condition that the message parameters are changed, calling a window callback function to process the message parameters.
6. An apparatus for creating a window border, the apparatus comprising:
the first setting unit is used for setting the current window as a frameless window according to the received window attribute;
the second setting unit is used for acquiring the window handle of the current window and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
a third setting unit, configured to set a second window parameter of the border display window according to the first window parameter of the current window, where the second window parameter includes: the width and height of the frame display window, the expansion style of the window, a pointer pointing to a registered class name, a pointer pointing to a window name, the style of the window, the horizontal position of the window and the vertical position of the window;
the display unit is used for displaying the frame display window based on the second window parameter;
the building unit is used for building each vertex angle drawing area, drawing area gradual change brush and frame gradual change brush of the frame display window by using a preset rendering object, wherein the building of each vertex angle drawing area of the frame display window by using the preset rendering object comprises the following steps: creating a DIB independent bitmap structure; creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file; adding the bitmap handle to a pre-established device object DC; creating a graphics device interface rendering object, adding the DC to the rendering object; constructing a first drawing area by using the rendering object; adding drawing directions of all vertex angles in the drawing area; respectively drawing edge straight lines of all vertex angles; cutting the first drawing area to obtain a second drawing area; adding a vertex angle with a preset shape and a preset size in the second drawing area;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and the updating unit is used for updating the drawn frame display window.
7. The apparatus according to claim 6, wherein the third setting unit is specifically configured to:
acquiring a left pixel left, a right pixel right, an upper pixel top, a lower pixel bottom and a SHADOW display width SHADOW _ MARGIN of the current window;
determining the width of the frame display window according to a formula int width, right, rect, left + SHADOW _ region 2;
determining the height of the frame display window according to a formula int height, bottom-bottom, top + SHADOW _ region, 2; wherein the first window parameter comprises: left pixel left, right pixel right, upper pixel top, lower pixel bottom, and SHADOW display width SHADOW _ MARGIN of the current window.
8. A computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, carries out the steps of:
setting a current window as a frameless window according to the received window attribute;
acquiring a window handle of the current window, and setting the current window as a parent window of a pre-registered frame display window based on the window handle;
setting a second window parameter of the frame display window according to the first window parameter of the current window, wherein the second window parameter comprises: the width and height of the frame display window, the expansion style of the window, a pointer pointing to a registered class name, a pointer pointing to a window name, the style of the window, the horizontal position of the window and the vertical position of the window;
displaying the border display window based on the second window parameter;
the method comprises the following steps of constructing each vertex angle drawing area, a drawing area gradual change brush and a frame gradual change brush of the frame display window by using a preset rendering object, wherein the step of constructing each vertex angle drawing area of the frame display window by using the preset rendering object comprises the following steps of: creating a DIB independent bitmap structure; creating a device-related bitmap file by using the DIB-independent bitmap structure, and storing a bitmap handle of the bitmap file; adding the bitmap handle to a pre-established device object DC; creating a graphics device interface rendering object, adding the DC to the rendering object; constructing a first drawing area by using the rendering object; adding drawing directions of all vertex angles in the drawing area; respectively drawing edge straight lines of all vertex angles; cutting the first drawing area to obtain a second drawing area; adding a vertex angle with a preset shape and a preset size in the second drawing area;
drawing the vertex angle drawing areas respectively by using the drawing area gradual change brush, and drawing the frames respectively by using the frame gradual change brush;
and updating the drawn frame display window.
9. A computer device for creating a window border, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein,
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 5.
CN201810027610.9A 2018-01-11 2018-01-11 Method and device for creating window frame and computer equipment Active CN108255488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810027610.9A CN108255488B (en) 2018-01-11 2018-01-11 Method and device for creating window frame and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810027610.9A CN108255488B (en) 2018-01-11 2018-01-11 Method and device for creating window frame and computer equipment

Publications (2)

Publication Number Publication Date
CN108255488A CN108255488A (en) 2018-07-06
CN108255488B true CN108255488B (en) 2021-07-23

Family

ID=62726280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810027610.9A Active CN108255488B (en) 2018-01-11 2018-01-11 Method and device for creating window frame and computer equipment

Country Status (1)

Country Link
CN (1) CN108255488B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032951A (en) * 2018-08-06 2018-12-18 武汉斗鱼网络科技有限公司 A kind of method, system, server and the storage medium of detection client operation OpenGL version

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473077A (en) * 2013-09-27 2013-12-25 珠海市君天电子科技有限公司 Method and device for enriching display interface of main window of application program
US8850354B1 (en) * 2010-05-21 2014-09-30 Google Inc. Multi-window web-based application structure
CN105404512A (en) * 2015-11-25 2016-03-16 飞天诚信科技股份有限公司 Application window interface changing method and apparatus
CN105573752A (en) * 2015-12-11 2016-05-11 中国航空工业集团公司西安航空计算技术研究所 OpenGL based support method for MiniGUI window system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8850354B1 (en) * 2010-05-21 2014-09-30 Google Inc. Multi-window web-based application structure
CN103473077A (en) * 2013-09-27 2013-12-25 珠海市君天电子科技有限公司 Method and device for enriching display interface of main window of application program
CN105404512A (en) * 2015-11-25 2016-03-16 飞天诚信科技股份有限公司 Application window interface changing method and apparatus
CN105573752A (en) * 2015-12-11 2016-05-11 中国航空工业集团公司西安航空计算技术研究所 OpenGL based support method for MiniGUI window system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Qt:基于widget方式的窗口阴影边框的实现";lixiaoxin1989;《CSDN》;20170816;第1-3页 *

Also Published As

Publication number Publication date
CN108255488A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN105808044B (en) Information pushing method and device
CN106933587B (en) Layer drawing control method and device and mobile terminal
US9811611B2 (en) Method and apparatus for creating curved surface model
CN110399583B (en) Page display method and device, electronic equipment and storage medium
CN110990741B (en) Page display method and device, electronic equipment, server and storage medium
US20150138243A1 (en) Systems and Methods for Dynamic Wall Paper for Mobile Terminals
CN111178012A (en) Form rendering method, device and equipment and storage medium
CN106780684B (en) Animation effect realization method and device
US20140096087A1 (en) Method and device for software interface display on terminal, and computer storage medium
CN106658139B (en) Focus control method and device
CN109726368B (en) Map marking method and device
JP2016529627A (en) Browser resource display method and apparatus, and computer-readable storage medium
CN104238869A (en) Floating icon display system and method
CN106250080A (en) Method for displaying image and device
CN112347545A (en) Building model processing method and device, computer equipment and storage medium
CN108255488B (en) Method and device for creating window frame and computer equipment
CN105893558A (en) Recommended data display method and system
CN109925715B (en) Virtual water area generation method and device and terminal
US20200004386A1 (en) User interface display method, apparatus, and user interface
WO2024022246A1 (en) Method and apparatus for updating virtual wall, and electronic device and storage medium
CN104834655B (en) A kind of method and apparatus for the mass parameter for showing Internet resources
WO2014159299A1 (en) Graphics processing using multiple primitives
CN110032372A (en) A kind of method, apparatus and computer equipment creating window border
CN105205854B (en) Data center 3D modeling method and device
CN103700362B (en) Multi signal window display method and device

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
GR01 Patent grant
GR01 Patent grant