Method and apparatus for displaying preview image, and readable storage medium
Abstract
A method and an apparatus for displaying a preview image, and a readable storage medium. The method includes: enabling a camera in response to detecting a camera enabling operation; displaying a first preview image on a first display, where the first preview image is generated based on a first framing content collected by the camera; lighting up a second display when a collaboration condition is triggered, where the collaboration condition is a condition of synchronously displaying the first preview image on the second display; copying the first framing content to obtain a second framing content; generating a second preview image based on the second framing content; and displaying the second preview image on the second display.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for displaying a preview image, applicable to an electronic device having a foldable display, wherein the foldable display comprises a first display and a second display, the first display is arranged on a front side of the electronic device, the second display is arranged on a back side of the electronic device, and the method comprises:
enabling a camera in response to detecting a camera enabling operation; displaying a first preview image on the first display, wherein the first preview image is generated based on a first framing content collected by the camera; lighting up the second display when a collaboration condition is triggered, wherein the collaboration condition is a condition of synchronously displaying the first preview image on the second display; copying a first framing content through a camera service module, to obtain a second framing content, wherein the first framing content is obtained from the camera by a camera hardware management module; and adding the second framing content to a first graphics buffer through the camera service module, wherein the first graphics buffer is created by a camera application when it is determined that the collaboration condition is triggered, and the first graphics buffer is configured to store a framing content of a preview image to be displayed on the second display, generating a second preview image based on the second framing content; and displaying the second preview image on the second display.
2 . The method of claim 1 , wherein the electronic device comprises an image display system; and the lighting up the second display when a collaboration condition is triggered comprises:
creating a first function module through the image display system when the collaboration condition is triggered, wherein the first function module is configured to light up the second display; and lighting up the second display through the first function module.
3 . The method of claim 2 , wherein before the adding the second framing content to a first graphics buffer through the camera service module, the method further comprises:
creating the first graphics buffer through the camera application when the collaboration condition is triggered; and transmitting first address information of the first graphics buffer to the camera service module through the camera application; and the adding the second framing content to a first graphics buffer through the camera service module comprises: adding the second framing content to the first graphics buffer based on the first address information through the camera service module.
4 . The method of claim 2 , wherein the image display system further comprises a graphics drawing module, and the generating a second preview image based on the second framing content comprises:
instructing the graphics drawing module to read the second framing content through the camera application when it is determined through the camera application that the first graphics buffer comprises the second framing content; reading the second framing content from the first graphics buffer through the graphics drawing module; and generating the second preview image based on the second framing content through the graphics drawing module; and the displaying the second preview image on the second display comprises: displaying the second preview image on the second display through the graphics drawing module.
5 . The method of claim 2 , wherein before the lighting up the second display when a collaboration condition is triggered, the method further comprises:
displaying a collaboration switch on the first display through the camera application when the foldable display is in an unfolded state and a rear camera is currently enabled, wherein the collaboration switch is configured to control whether to enable a function of synchronously displaying the first preview image on the second display; and determining that the collaboration condition is triggered when it is detected through the camera application that the collaboration switch is enabled.
6 . The method of claim 5 , wherein the unfolded state is that a folding angle of the foldable display is greater than a preset angle threshold and less than or equal to 180 degrees.
7 . The method of claim 5 , wherein the image display system further comprises a display status monitoring module, and a manner for determining that the foldable display is in the unfolded state comprises:
transmitting a registration request to the display status monitoring module through the camera application to request to monitor a state of the foldable display; controlling the display status monitoring module to transmit first indication information to the camera application when it is monitored through the display status monitoring module that the foldable display is in the unfolded state, wherein the first indication information is configured to indicate that the display is in the unfolded state; and determining that the foldable display is in the unfolded state based on the first indication information through the camera application.
8 . The method of claim 5 , wherein after the determining that the collaboration condition is triggered when it is detected through the camera application that the collaboration switch is enabled, the method further comprises:
releasing the first graphics buffer through the camera application when it is detected through the camera application that the collaboration switch is disabled; transmitting a collaboration termination message to the camera service module through the camera application, wherein the collaboration termination message is configured to instruct to stop storing the second framing content in the first graphics buffer; and controlling the camera service module to stop storing the second framing content in the first graphics buffer after the collaboration termination message is received.
9 . The method of claim 8 , further comprising:
controlling the first function module to turn off the second display through the image display system when it is detected through the camera application that the collaboration switch is disabled.
10 . An apparatus for displaying a preview image, having a foldable display, wherein the foldable display comprises a first display and a second display, the first display is arranged on a front side of the apparatus, and the second display is arranged on a back side of the apparatus;
structure of the apparatus for displaying a preview image comprises a processor and a memory, the memory is configured to store a program that, when executed by one or more processors, cause the apparatus to be configured to: enable a camera in response to detecting a camera enabling operation; display a first preview image on the first display, wherein the first preview image is generated based on a first framing content collected by the camera; light up the second display when a collaboration condition is triggered, wherein the collaboration condition is a condition of synchronously displaying the first preview image on the second display; copy the first framing content to obtain a second framing content, copying the first framing content through a camera service module, to obtain a second framing content, wherein the first framing content is obtained from the camera by a camera hardware management module; and add the second framing content to a first graphics buffer through the camera service module, wherein the first graphics buffer is created by a camera application when it is determined that the collaboration condition is triggered, and the first graphics buffer is configured to store a framing content of a preview image to be displayed on the second display; generate a second preview image based on the second framing content; and display the second preview image on the second display.
11 . A non-transitory computer-readable storage medium, storing instructions that the instructions when run on a computer, cause the computer to be configured to:
enable a camera in response to detecting a camera enabling operation; display a first preview image on the first display, wherein the first preview image is generated based on a first framing content collected by the camera; light up the second display when a collaboration condition is triggered, wherein the collaboration condition is a condition of synchronously displaying the first preview image on the second display; copying a first framing content through a camera service module, to obtain a second framing content, wherein the first framing content is obtained from the camera by a camera hardware management module; and add the second framing content to a first graphics buffer through the camera service module, wherein the first graphics buffer is created by a camera application when it is determined that the collaboration condition is triggered, and the first graphics buffer is configured to store a framing content of a preview image to be displayed on the second display, generate a second preview image based on the second framing content; and display the second preview image on the second display.
12 . The apparatus of claim 10 , wherein the apparatus comprises an image display system; and wherein lighting up the second display when a collaboration condition is triggered comprises:
creating a first function module through the image display system when the collaboration condition is triggered, wherein the first function module is configured to light up the second display.
13 . The apparatus of claim 11 , wherein before the adding the second framing content to a first graphics buffer through the camera service module further comprises:
creating the first graphics buffer through the camera application when the collaboration condition is triggered; and transmitting first address information of the first graphics buffer to the camera service module through the camera application; and the adding the second framing content to a first graphics buffer through the camera service module comprises: adding the second framing content to the first graphics buffer based on the first address information through the camera service module.
14 . The apparatus of claim 11 , wherein the image display system further comprises a graphics drawing module, and the generating a second preview image based on the second framing content comprises:
instructing the graphics drawing module to read the second framing content through the camera application when it is determined through the camera application that the first graphics buffer comprises the second framing content; reading the second framing content from the first graphics buffer through the graphics drawing module; and generating the second preview image based on the second framing content through the graphics drawing module; and the displaying the second preview image on the second display comprises: displaying the second preview image on the second display through the graphics drawing module.
15 . The non-transitory computer-readable storage medium of claim 11 , wherein the apparatus comprises an image display system; and wherein lighting up the second display when a collaboration condition is triggered comprises:
creating a first function module through the image display system when the collaboration condition is triggered, wherein the first function module is configured to light up the second display; and lighting up the second display through the first function module.
16 . The apparatus of claim 11 , wherein before the lighting up the second display when a collaboration condition is triggered further comprises:
displaying a collaboration switch on the first display through the camera application when the foldable display is in an unfolded state and a rear camera is currently enabled, wherein the collaboration switch is configured to control whether to enable a function of synchronously displaying the first preview image on the second display; and determining that the collaboration condition is triggered when it is detected through the camera application that the collaboration switch is enabled.
17 . The apparatus of claim 16 , wherein the unfolded state is that a folding angle of the foldable display is greater than a preset angle threshold and less than or equal to 180 degrees.
18 . The apparatus of claim 16 , wherein the image display system further comprises a display status monitoring module, and a manner for determining that the foldable display is in the unfolded state comprises:
transmitting a registration request to the display status monitoring module through the camera application to request to monitor a state of the foldable display; controlling the display status monitoring module to transmit first indication information to the camera application when it is monitored through the display status monitoring module that the foldable display is in the unfolded state, wherein the first indication information is configured to indicate that the display is in the unfolded state; and determining that the foldable display is in the unfolded state based on the first indication information through the camera application.
19 . The apparatus of claim 16 , wherein after the determining that the collaboration condition is triggered when it is detected through the camera application that the collaboration switch is enabled further comprises:
releasing the first graphics buffer through the camera application when it is detected through the camera application that the collaboration switch is disabled; transmitting a collaboration termination message to the camera service module through the camera application, wherein the collaboration termination message is configured to instruct to stop storing the second framing content in the first graphics buffer; and controlling the camera service module to stop storing the second framing content in the first graphics buffer after the collaboration termination message is received.
20 . The apparatus of claim 19 , wherein after detecting through the camera application that the collaboration switch is disabled comprises:
controlling the first function module to turn off the second display through the image display system.Join the waitlist — get patent alerts
Track US12464222B2 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.