CN113760419A - Method, apparatus, device and computer readable medium for displaying image - Google Patents

Method, apparatus, device and computer readable medium for displaying image Download PDF

Info

Publication number
CN113760419A
CN113760419A CN202011010401.7A CN202011010401A CN113760419A CN 113760419 A CN113760419 A CN 113760419A CN 202011010401 A CN202011010401 A CN 202011010401A CN 113760419 A CN113760419 A CN 113760419A
Authority
CN
China
Prior art keywords
color
layer
mode
hidden view
display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011010401.7A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011010401.7A priority Critical patent/CN113760419A/en
Publication of CN113760419A publication Critical patent/CN113760419A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a computer readable medium for displaying images, and relates to the technical field of computers. One embodiment of the method comprises: monitoring through a hidden view, wherein the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view; the hidden view monitors a display mode switching event and presets a deep color mode; and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode. The embodiment can also adapt to the deep color mode in the APP for the layer which does not support the deep color mode.

Description

Method, apparatus, device and computer readable medium for displaying image
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer readable medium for displaying an image.
Background
The dark mode is an application mode in which the text is light and the background is dark. And a dark color mode is newly added in the system of the mobile terminal, and the dark color mode can be opened through system setting. In the dark mode, all adapted applications (apps) switch to the dark mode presentation.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the image in APP is difficult to adapt to the dark mode because the layers involved in displaying the image do not support the dark mode.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a computer readable medium for displaying an image, which can also adapt to a dark color mode in an APP for an image layer that does not support the dark color mode.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of displaying an image, including:
monitoring through a hidden view, wherein the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view;
the hidden view monitors a display mode switching event and presets a deep color mode;
and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
The layer comprises CALAYER;
the hidden view is generated by setting the color types of the layers by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
And the layer and the hidden view are bound by adopting the extended attribute of the hidden view.
The method for adjusting the color of the layer in the control in the display image according to the preset display color to adapt to the deep color mode comprises the following steps:
and adjusting the color of the layer in the control in the display image according to a preset display color by adopting a callback function so as to adapt to the deep color mode.
The adoption of the callback function adjusts the color of the layer in the control in the display image according to the preset display color so as to adapt to the dark color mode, and the method comprises the following steps:
and adjusting the color of the layer in the control in the display image according to a preset display color by adopting a callback function through the bound hidden view so as to adapt to a deep color mode.
The hidden view provides an entry for a callback function;
the adoption of the callback function adjusts the color of the layer in the control in the display image according to the preset display color so as to adapt to the dark color mode, and the method comprises the following steps:
and adjusting the color of the layer in the control in the display image according to a preset display color through the entrance of the callback function so as to adapt to the deep color mode.
The method for adjusting the color of the layer in the control in the display image according to the preset display color to adapt to the deep color mode comprises the following steps:
and after a preset display color is obtained from the color type of the hidden view, adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
The preset display color is a color set corresponding to the dark color mode or a preset color.
According to a second aspect of embodiments of the present invention, there is provided an apparatus for displaying an image, including:
the monitoring module is used for monitoring through a hidden view, the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view;
the determining module is used for determining that the hidden view monitors that a display mode switching event is heard and a deep color mode is preset;
and the adjusting module is used for adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
The layer comprises CALAYER;
the hidden view is generated by setting the color types of the layers by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus that displays an image, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method as described above.
One embodiment of the above invention has the following advantages or benefits: monitoring is carried out through a hidden view, the hidden view is generated when the color type of a layer in the control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view; the hidden view monitors that a display mode switching event is detected and a deep color mode is preset; and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode. And binding the hidden view and the layer, monitoring a display mode switching event by adopting the hidden view, and being suitable for the layer which does not support the deep color mode. Therefore, the deep color mode in the APP can be adapted to the layer which does not support the deep color mode.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the output of layers of color objects and view classes in normal mode and dark mode;
fig. 2 is a schematic diagram of a main flow of a method of displaying an image according to an embodiment of the present invention;
FIG. 3 is a schematic flow diagram for generating a hidden view according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an arrangement of layers using an extension method according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating updating colors of layers using callback functions according to an embodiment of the invention;
FIG. 6 is a flow chart diagram of a method of displaying an image according to an embodiment of the invention;
fig. 7 is a schematic diagram of a main structure of an apparatus for displaying an image according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
And a dark color mode is newly added in the mobile terminal system. Specifically, an adapted color object (UIColor) in a dark mode is configured. A dynamic function is added to the UIColors, and one UIColor can return different display colors according to whether the current APP is in a common mode or a dark mode.
Although, a dynamic adaptation function is added to the UIColor of the generic view class, in which the UIColor includes a background color and a font color, etc. However, no dynamic adaptation function is added to the layers of the view class. If the dynamic adaptation function is to be implemented, it is necessary to listen to system events and add a lot of extra processing.
Referring to fig. 1, fig. 1 is an output schematic diagram of layers of color objects and view classes in a normal mode and a dark mode.
Two images, view 1 and view 2, are included in fig. 1. View 1 belongs to a color object and view 2 to a layer. For view 1, the normal mode is set to green, and the dark mode is set to red; for view 2, the normal mode is set to green and the dark mode is set to red.
In the normal mode, view 1 shows green and view 2 shows green. In the dark mode, view 1 shows red and view 2 still shows green. This is because the layers of view 2 do not add dynamic adaptation functions and cannot adapt to the dark mode.
Therefore, the dark mode is not supported for the layers involved in displaying the image, making it difficult for the image in APP to adapt to the dark mode.
In order to solve the problem that an image layer related to an image is not supported by a dark color mode, which causes difficulty in adapting the image in the APP to the dark color mode, the following technical scheme in the embodiment of the present invention may be adopted.
Referring to fig. 2, fig. 2 is a schematic diagram of a main flow of a method for displaying an image according to an embodiment of the present invention, in which a hidden view and a layer are bound, and if a display mode switching event is monitored, a color of the layer is adjusted. As shown in fig. 2, the method specifically includes the following steps:
s201, monitoring is carried out through a hidden view, the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view.
The technical scheme in the embodiment of the invention is applied to the mobile terminal. As an example, it can be applied to the android system, and also to the iOS system. The following description is exemplary and not limited to the iOS system, and the iOS system control is one object most contacted in the mobile terminal and is a base class of all view controls. Mainly comprising buttons, text, input boxes, pictures and the like.
In an iOS system the control may be UIView. The controls visible in the iOS system are essentially all UIView. UIView can be displayed on the screen because it has a layer inside it. The layer may be CALAYER. The UIView provides a basis for CALAyer display, and is responsible for processing events such as touch and participating in an event response chain. The CALAYER is only responsible for providing the displayed content.
CALAYER is a rectangular layer that manages image-based content and animated presentations, often used to store views, and also used as a presentation without views, and mainly works to manage visual effects, including the layer's own visual attributes, such as: background color (background color), border (border), shadow (shadow), and the like. In addition, the layer also stores the geometric content it displays on the screen, such as: position (position), size (size) and transform (transform).
In the iOS system only the view class can listen to display mode switch events, whereas the CALayer does not inherit the view class, so the CALayer cannot listen to display mode switch events. CALAyer belongs to the system class. As one example, the view class includes UIView.
And if the layer does not belong to the view class, the display mode switching event cannot be monitored, and then a hidden view can be established and the display mode switching event is monitored through the hidden view. This is because the hidden view belongs to the view class. It is understood that the hidden view is generated when the color category of the layer in the control is set.
Referring to fig. 3, fig. 3 is a schematic flowchart of generating a hidden view according to an embodiment of the present invention, which specifically includes:
s301, setting the color type of the layer and the color type of the hidden view by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
Considering that CALayer typically sets one or more of the border color, background color, and shadow color in iOS, difficulties arise in adapting the dark mode.
In the embodiment of the invention, the color in the layer is adjusted through the hidden view. Under the condition that the image layer comprises multiple color types, colors consistent with the color types of the image layer need to be set in the hidden view, so that the image layer is ensured to be adaptive to the dark color mode. That is, the hidden view is generated when the color type of the layer in the control is set. And the layers do not support the dark mode.
In the embodiment of the invention, the color type of the layer and the color type of the hidden view are set by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
It should be noted that the color type of the layer and the color type of the hidden view are consistent and corresponding.
Referring to fig. 4, fig. 4 is a schematic diagram of setting a layer by using an extension method according to an embodiment of the present invention, which specifically includes:
the layer is specifically CALAYER. CALAyer includes three color categories, specifically, border color, background color, and shade color. And sequentially setting a self-border color scheme, a self-background color scheme and a self-shadow color scheme according to the expansion. Wherein, extension (Category) is a special technology in iOS programming, and the extension can add functions on the basis of the original class.
Thus, the hidden view also includes three color classes, as an example, the hidden view may be a UIView class. The three color categories are specifically border color, background color, and shadow color. And sequentially setting a hidden view frame color scheme, a hidden view background color scheme and a hidden view shadow color scheme according to the expansion.
And S302, generating a hidden view.
And creating a bound view class to generate a hidden view, wherein the color class of the hidden view corresponds to the color class of the layer. The role of the binding view class is to listen to the display mode switch event (traitcollectionDidChange) of the system.
It is understood that the hidden view is generated by setting the color type of the layer using the extension method. And the layer is bound with the hidden view.
In the embodiment of fig. 3, the color type of the layer is set to correspond to the color type of the hidden view, so that the color of the layer is adjusted based on the hidden view.
The hidden view belongs to the binding view class, so the hidden view can be used to listen for display mode switching events. And binding the hidden view and the layer, so that the hidden view can be used for monitoring the display mode switching event, and the color in the layer can be adjusted under the condition that the hidden view monitors the display mode switching event.
In an embodiment of the present invention, in order to bind the hidden view and the layer, an extended attribute of the hidden view may be used to bind the hidden view and the layer. It is understood that the layer and hidden view are extended property bindings that employ hidden views.
I.e. adding a property of the bound view to the hidden view. As an example, if the hidden view is the UIView system class, then the properties of a bound view are added. Such as: and adding the attribute of the binding view in the UIView system class by using the associatedObject method of runtime, and avoiding influencing the native method of the UIView.
That is, the attribute of the hidden view is added on the basis of the original attribute of the hidden view, so that the native method in the original attribute of the hidden view is not affected.
S202, the hidden view monitors the display mode switching event and presets a deep color mode.
The hidden view is in charge of monitoring the display mode switching event on one hand, and informing the layer of the monitored display mode switching event on the other hand so as to adapt to the deep color mode.
In the embodiment of the invention, the color of the layer in the control in the display image is adjusted to a dark color mode, and two conditions are required to be met. One condition is that the hidden view hears a display mode switch event and the other condition is that the dark mode has been preset.
Referring to fig. 5, fig. 5 is a schematic diagram of updating colors of layers by using a callback function according to an embodiment of the present invention.
The created binding view class not only can monitor the display mode switching event, but also can provide a callback function. When the user switches the display mode, the display mode switching event is triggered, and the hidden view monitors the display mode switching event. And updating the color of the layer in the display image by utilizing the callback function of the hidden view.
That is to say, the callback function is adopted, so that the color of the layer in the control in the display image can be adjusted to adapt to the dark color mode.
In an embodiment of the invention, in consideration of the binding relationship between the hidden view and the layer, when the display mode switching event is monitored, the color of the layer in the control in the display image can be adjusted according to the preset display color through the bound hidden view and by adopting a callback function, so as to adapt to the deep color mode.
In an embodiment of the present invention, the hidden view provides an entry of a callback function, so that the color of the layer in the control in the display image can be adjusted in time according to the preset display color through the entry of the callback function to adapt to the dark color mode.
S203, adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
In an embodiment of the present invention, the color type of the hidden view corresponds to the color type in the layer, so that the color of the layer in the control in the display image may be adjusted according to the preset display color after the preset display color is obtained from the color type of the hidden view. Therefore, the hidden view can not only monitor the display mode switching event, but also transmit the preset display color.
Namely, the color of the layer in the control in the display image is adjusted according to the preset display color so as to adapt to the deep color mode.
In one embodiment of the present invention, the preset display color is a color set corresponding to the dark mode. As an example, the dark mode corresponds to the preset display color of the frame being black.
Or, the preset display color is a preset color. It will be appreciated that the preset display colour is black.
In the embodiment, monitoring is performed through a hidden view, the hidden view is generated when the color type of an image layer in a control is set, the image layer does not support a deep color mode, and the image layer is bound with the hidden view; the hidden view monitors that a display mode switching event is detected and a deep color mode is preset; and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode. And binding the hidden view and the layer, monitoring a display mode switching event by adopting the hidden view, and being suitable for the layer which does not support the deep color mode. Therefore, the deep color mode in the APP can be adapted to the layer which does not support the deep color mode.
The following describes an exemplary embodiment of the present invention with reference to the drawings, where an operating system of the mobile terminal is iOS and a layer may be CALayer.
Referring to fig. 6, fig. 6 is a schematic flowchart of a method for displaying an image according to an embodiment of the present invention, which specifically includes:
s601, setting the color type of CALAyer.
Setting the color type of the CALAyer by using an extension method, wherein the color type of the CALAyer comprises the following steps: border color, background color, and shadow color.
S602, judging whether the current system supports a deep color mode.
Judging whether the current system supports a deep color mode, if so, executing S603; if the current system does not support the deep color mode, S607 is executed.
As an example, the system for the mobile terminal may determine whether the dark mode is supported according to a system version number.
And S603, generating a hidden view.
And generating a hidden view, wherein the attribute of the hidden view is UIView. Extend the properties of the bind view, bind hidden view and CALAyer for UIView.
S604, monitoring a display mode switching event.
The hidden view hears the display mode switching event, indicating that the system instructs to switch the display mode.
S605, judging whether the mode is the deep color mode.
And judging whether the display mode is switched to be a deep color mode or not. If the switching display mode is the deep color mode, executing S606; if the switching display mode is the normal mode, S607 is executed.
And S606, displaying the corresponding color of the deep color mode.
In CALAYER for displaying image, color is displayed according to color of dark mode corresponding to reference color.
And S607, displaying the corresponding color of the common mode.
In CALAYER displaying the image, the color is displayed according to the color of the common mode corresponding to the input reference color.
In the above embodiment, only one line of code is needed for the adaptation of CALAYER, so that the workload of iOS adaptation to the dark mode is greatly reduced, and the native methods of UIView and CALAYER are not affected.
Referring to fig. 7, fig. 7 is a schematic diagram of a main structure of an apparatus for displaying an image according to an embodiment of the present invention, where the apparatus for displaying an image may implement a method for displaying an image, and as shown in fig. 7, the apparatus for displaying an image specifically includes:
the monitoring module 701 is configured to monitor through a hidden view, where the hidden view is generated when a color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound to the hidden view;
a determining module 702, configured to determine that the hidden view monitors a display mode switching event and a dark color mode is preset;
and an adjusting module 703, configured to adjust the color of the layer in the control in the display image according to a preset display color, so as to adapt to the deep color mode.
In one embodiment of the present invention, the layer includes a CALAYER;
the hidden view is generated by setting the color types of the layers by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
In an embodiment of the present invention, the layer and the hidden view are bound by using an extended attribute of the hidden view
In an embodiment of the present invention, the adjusting module 703 is specifically configured to adjust, by using a callback function, a color of a layer in the control in the display image according to a preset display color, so as to adapt to the deep color mode.
In an embodiment of the present invention, the adjusting module 703 is specifically configured to adjust, by using a callback function through the bound hidden view, a color of a layer in the control in the display image according to a preset display color, so as to adapt to the deep color mode.
In one embodiment of the invention, the hidden view provides an entry for a callback function;
the adjusting module 703 is specifically configured to adjust, through the entry of the callback function, the color of the layer in the control in the display image according to a preset display color, so as to adapt to the deep color mode.
In an embodiment of the present invention, the adjusting module 703 is specifically configured to, after obtaining a preset display color from the color type of the hidden view, adjust a color of a layer in the control in a display image according to the preset display color to adapt to a deep color mode.
In an embodiment of the present invention, the preset display color is a color set corresponding to the deep color mode, or a preset color.
Fig. 8 illustrates an exemplary system architecture 800 of a method of displaying an image or an apparatus for displaying an image to which embodiments of the present invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a back-office management server (for example only) that supports shopping-like websites browsed by users using the terminal devices 801, 802, 803. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for displaying an image provided by the embodiment of the present invention is generally executed by the server 805, and accordingly, the apparatus for displaying an image is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
monitoring through a hidden view, wherein the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view;
the hidden view monitors a display mode switching event and presets a deep color mode;
and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
According to the technical scheme of the embodiment of the invention, monitoring is carried out through a hidden view, the hidden view is generated when the color type of the layer in the control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view; the hidden view monitors that a display mode switching event is detected and a deep color mode is preset; and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode. And binding the hidden view and the layer, monitoring a display mode switching event by adopting the hidden view, and being suitable for the layer which does not support the deep color mode. Therefore, the deep color mode in the APP can be adapted to the layer which does not support the deep color mode.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of displaying an image, comprising:
monitoring through a hidden view, wherein the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view;
the hidden view monitors a display mode switching event and presets a deep color mode;
and adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
2. A method for displaying an image as defined in claim 1, wherein the layer comprises a CALayer;
the hidden view is generated by setting the color types of the layers by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
3. The method for displaying images according to claim 1, wherein the layer and the hidden view are bound by using an extended attribute of the hidden view.
4. The method for displaying the image according to claim 1 or 3, wherein the adjusting the color of the layer in the control in the display image according to the preset display color to adapt to the dark color mode comprises:
and adjusting the color of the layer in the control in the display image according to a preset display color by adopting a callback function so as to adapt to the deep color mode.
5. The method for displaying an image according to claim 4, wherein the adapting a callback function to adjust the color of the layer in the control in the displayed image according to a preset display color to adapt to a dark color mode comprises:
and adjusting the color of the layer in the control in the display image according to a preset display color by adopting a callback function through the bound hidden view so as to adapt to a deep color mode.
6. The method of displaying an image of claim 4, wherein the hidden view provides an entry to a callback function;
the adoption of the callback function adjusts the color of the layer in the control in the display image according to the preset display color so as to adapt to the dark color mode, and the method comprises the following steps:
and adjusting the color of the layer in the control in the display image according to a preset display color through the entrance of the callback function so as to adapt to the deep color mode.
7. The method for displaying the image according to claim 1, wherein the adjusting the color of the layer in the control in the display image according to the preset display color to adapt to the dark color mode comprises:
and after a preset display color is obtained from the color type of the hidden view, adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
8. The method for displaying images according to claim 1, wherein the preset display color is a color set corresponding to the dark color mode or a preset color.
9. An apparatus for displaying an image, comprising:
the monitoring module is used for monitoring through a hidden view, the hidden view is generated when the color type of a layer in a control is set, the layer does not support a deep color mode, and the layer is bound with the hidden view;
the determining module is used for determining that the hidden view monitors that a display mode switching event is heard and a deep color mode is preset;
and the adjusting module is used for adjusting the color of the layer in the control in the display image according to the preset display color so as to adapt to the deep color mode.
10. Apparatus for displaying an image as defined in claim 9, wherein the layers comprise CALayer;
the hidden view is generated by setting the color types of the layers by using an expansion method, wherein the color types comprise one or more of a frame color, a background color and a shadow color.
11. An electronic device for displaying an image, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202011010401.7A 2020-09-23 2020-09-23 Method, apparatus, device and computer readable medium for displaying image Pending CN113760419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011010401.7A CN113760419A (en) 2020-09-23 2020-09-23 Method, apparatus, device and computer readable medium for displaying image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011010401.7A CN113760419A (en) 2020-09-23 2020-09-23 Method, apparatus, device and computer readable medium for displaying image

Publications (1)

Publication Number Publication Date
CN113760419A true CN113760419A (en) 2021-12-07

Family

ID=78785847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011010401.7A Pending CN113760419A (en) 2020-09-23 2020-09-23 Method, apparatus, device and computer readable medium for displaying image

Country Status (1)

Country Link
CN (1) CN113760419A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1991019237A1 (en) * 1990-05-30 1991-12-12 Allen-Bradley Company, Inc. Graphical programming interface for machine/process controllers
US6579324B1 (en) * 1999-04-30 2003-06-17 Microsoft Corporation Method for indicating a selected region on a computer display while allowing the user to see the formatting of the background and content items within the selected region
US20090193434A1 (en) * 2008-01-25 2009-07-30 Microsoft Corporation Isolation of user-interactive components
US20100115282A1 (en) * 2008-11-05 2010-05-06 International Business Machines Corporation Method for watermark hiding in designated applications
CN107038037A (en) * 2017-05-22 2017-08-11 北京小米移动软件有限公司 Display mode switching method and device
CN107993178A (en) * 2017-12-14 2018-05-04 山西省煤炭地质物探测绘院 A kind of underground pipeline management software systems
US20180293453A1 (en) * 2017-04-05 2018-10-11 Here Global B.V. Unsupervised approach to environment mapping at night using monocular vision
CN109729417A (en) * 2019-03-28 2019-05-07 深圳市酷开网络科技有限公司 A kind of video-see play handling method, smart television and storage medium
CN110775057A (en) * 2019-08-29 2020-02-11 浙江零跑科技有限公司 Lane assisting method for analyzing and controlling steering torque based on vehicle-mounted blind zone visual scene
CN111611034A (en) * 2020-04-23 2020-09-01 北京小米移动软件有限公司 Screen display adjusting method and device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1991019237A1 (en) * 1990-05-30 1991-12-12 Allen-Bradley Company, Inc. Graphical programming interface for machine/process controllers
US6579324B1 (en) * 1999-04-30 2003-06-17 Microsoft Corporation Method for indicating a selected region on a computer display while allowing the user to see the formatting of the background and content items within the selected region
US20090193434A1 (en) * 2008-01-25 2009-07-30 Microsoft Corporation Isolation of user-interactive components
US20100115282A1 (en) * 2008-11-05 2010-05-06 International Business Machines Corporation Method for watermark hiding in designated applications
US20180293453A1 (en) * 2017-04-05 2018-10-11 Here Global B.V. Unsupervised approach to environment mapping at night using monocular vision
CN107038037A (en) * 2017-05-22 2017-08-11 北京小米移动软件有限公司 Display mode switching method and device
CN107993178A (en) * 2017-12-14 2018-05-04 山西省煤炭地质物探测绘院 A kind of underground pipeline management software systems
CN109729417A (en) * 2019-03-28 2019-05-07 深圳市酷开网络科技有限公司 A kind of video-see play handling method, smart television and storage medium
CN110775057A (en) * 2019-08-29 2020-02-11 浙江零跑科技有限公司 Lane assisting method for analyzing and controlling steering torque based on vehicle-mounted blind zone visual scene
CN111611034A (en) * 2020-04-23 2020-09-01 北京小米移动软件有限公司 Screen display adjusting method and device and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
宫海梅;: "基于不同图层的LSB自适应数字水印隐藏算法研究", 电子测试, no. 21, 5 November 2016 (2016-11-05) *
林一;陈靖;周琪;刘越;: "移动增强现实浏览器的信息可视化和交互式设计", 计算机辅助设计与图形学学报, no. 02, 15 February 2015 (2015-02-15) *
王磊;: "基于组件的电子地图显示软件设计", 微型电脑应用, no. 06, 20 June 2012 (2012-06-20) *
芮建勋;陈能;孙雅荣;: "地理信息系统OLE开发中的关键技术探讨", 地理与地理信息科学, no. 06, 30 November 2005 (2005-11-30) *

Similar Documents

Publication Publication Date Title
CN110046021B (en) Page display method, device, system, equipment and storage medium
KR20230070067A (en) System and method for displaying multiple applications
CN110888696A (en) Page display method and system, computer system and computer readable medium
US20220366066A1 (en) Display method, display device, and electronic device
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN113190152A (en) Method and device for switching application program theme
CN114528517A (en) View processing method and device, electronic equipment and computer readable medium
CN112926068A (en) Authority management method, management server, service server and readable storage medium
CN110275787B (en) Online platform data transmission method, device, medium and electronic equipment
US20230379279A1 (en) Interaction method and apparatus, and electronic device
CN110795328A (en) Interface testing method and device
CN110324432B (en) Data processing method, device and medium applied to terminal and computing equipment
CN110619101B (en) Method and apparatus for processing information
CN113364664A (en) Instant messaging method and device
CN107741970B (en) Method and device for laying out main page
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN116192789A (en) Cloud document processing method and device and electronic equipment
CN113760419A (en) Method, apparatus, device and computer readable medium for displaying image
CN112966201B (en) Object processing method, device, electronic equipment and storage medium
CN112947918A (en) Data display method and device
CN111010449B (en) Image information output method, system, device, medium, and electronic apparatus
WO2020011067A1 (en) Display method and device for terminal, terminal, and storage medium
WO2020011066A1 (en) Terminal display method and device, terminal and readable medium
CN111325621A (en) Protocol processing method, device, computer system and medium

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