WO2022174655A1 - 一种长页面截屏方法及电子设备 - Google Patents

一种长页面截屏方法及电子设备 Download PDF

Info

Publication number
WO2022174655A1
WO2022174655A1 PCT/CN2021/136526 CN2021136526W WO2022174655A1 WO 2022174655 A1 WO2022174655 A1 WO 2022174655A1 CN 2021136526 W CN2021136526 W CN 2021136526W WO 2022174655 A1 WO2022174655 A1 WO 2022174655A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
display screen
interface
long page
long
Prior art date
Application number
PCT/CN2021/136526
Other languages
English (en)
French (fr)
Inventor
任国锋
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21926369.6A priority Critical patent/EP4276615A4/en
Publication of WO2022174655A1 publication Critical patent/WO2022174655A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • 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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Definitions

  • the present application relates to the technical field of electronic devices, and in particular, to a long page screenshot method and electronic device.
  • a user needs a screenshot image of a long page, for example, when a user shares the page they browse, the user captures and shares the image of the long page.
  • the current screen capture solution for a long page is to capture parts of the long page displayed on the display screen at different times, respectively, to obtain multiple partial images of the long page. Then, the multiple partial images are stitched to obtain a relatively complete screenshot of a long page. In this solution, problems such as overlapping or missing spliced content may occur, and the screenshot effect of long pages is not good.
  • Embodiments of the present application provide a method and an electronic device for taking a screenshot of a long page, which can capture a complete screenshot of a long page by taking a screenshot of an interface, thereby achieving a better screenshot effect.
  • an embodiment of the present application provides a method for taking a screenshot of a long page, which is applied to an electronic device configured with a physical display screen.
  • the method includes: displaying a first interface through the physical display screen, where the first interface is Part of a long page; receive a screenshot operation for the long page; in response to the screenshot operation, create a virtual display screen capable of completely displaying the long page; under the constraints of the display parameters of the virtual display screen, according to the Drawing and rendering a second interface based on the layout information of the long page; and generating a screenshot image including the long page by using the second interface.
  • the layout information includes at least one of the following:
  • the layout elements on the long page and the positional relationship between different layout elements can be acquired, so that the long page can be drawn and rendered.
  • the creating a virtual display screen capable of completely displaying the long page includes: creating a first virtual display screen; under the constraints of display parameters of the first virtual display screen, according to the drawing and rendering a third interface based on the layout information; when the third interface is a part of the long page, adjust the display parameters of the first virtual display screen to obtain a second virtual display screen; Under the constraints of the display parameters of the virtual display screen, a fourth interface is drawn and rendered according to the layout information; when the long page is completely displayed in the fourth interface, it is determined that the second virtual display screen is capable of complete A virtual display screen showing the long page.
  • a virtual display screen capable of completely displaying long pages can be created.
  • determining that the second virtual display screen is the virtual display screen capable of completely displaying the long page including: When the long page is completely displayed in the fourth interface, and the fourth interface only displays the long page, it is determined that the second virtual display screen is the virtual display capable of completely displaying the long page Screen.
  • a virtual display screen that can just completely display a long page can be created.
  • the drawing and rendering the second interface according to the layout information of the long page under the constraints of display parameters of the virtual display screen includes: determining that the fourth interface is the first interface. Second interface.
  • the interface for measuring whether the display parameters of the virtual display screen are suitable can be directly used as the interface for obtaining the screenshot image.
  • the layout information includes at least one of the following:
  • the aspect ratio of the long page the size of the long page.
  • the creating a virtual display screen capable of completely displaying the long page includes: creating a virtual display screen having an aspect ratio of the long page or a size of the long page, so as to obtain a virtual display screen capable of displaying the long page completely.
  • a virtual display screen capable of completely displaying the long page can be directly created according to the aspect ratio or size of the long page.
  • the generating the screenshot image including the long page by using the second interface includes: storing the second interface according to a preset image format to obtain the screenshot image.
  • the interface displayed by the virtual display screen can be directly stored as a screenshot image, which improves the screenshot efficiency.
  • the embodiments of the present application improve an electronic device, including: a processor, a memory, a transceiver, and a physical display screen; the memory is used to store computer instructions; when the electronic device is running, the processor Executing the computer instructions, causing the electronic device to perform: displaying a first interface through the physical display screen, the first interface being a part of a long page; receiving a screenshot operation for the long page; responding to the screenshot operation to create a virtual display screen that can completely display the long page; under the constraints of the display parameters of the virtual display screen, draw and render a second interface according to the layout information of the long page; use the second interface to generate Include a screenshot of the long page.
  • the layout information includes at least one of the following:
  • the processor executes the computer instructions, so that the electronic device further executes: creating a first virtual display screen; under the constraints of display parameters of the first virtual display screen, according to drawing and rendering a third interface according to the layout information; when the third interface is a part of the long page, adjusting the display parameters of the first virtual display screen to obtain a second virtual display screen; Under the constraints of the display parameters of the second virtual display screen, a fourth interface is drawn and rendered according to the layout information; when the long page is completely displayed in the fourth interface, it is determined that the second virtual display screen is the A virtual display screen capable of displaying the long page in its entirety.
  • the processor executes the computer instructions, so that the electronic device also executes: when the long page is completely displayed in the fourth interface, and the fourth interface only displays During the long page, it is determined that the second virtual display screen is the virtual display screen capable of completely displaying the long page.
  • the processor executes the computer instructions, so that the electronic device further executes: determining that the fourth interface is the second interface.
  • the layout information includes at least one of the following:
  • the aspect ratio of the long page the size of the long page.
  • the processor executes the computer instructions, so that the electronic device further executes: creating a virtual display screen having the aspect ratio of the long page or the size of the long page, so as to obtain A virtual display screen capable of displaying the long page in its entirety.
  • the processor executes the computer instructions, so that the electronic device further executes: storing the second interface according to a preset image format to obtain the screenshot image.
  • an embodiment of the present application provides an apparatus for taking a screenshot of a long page, including a unit for executing the method provided in the first aspect.
  • an embodiment of the present application provides a computer storage medium, including computer software instructions, where the computer software instructions include a program for implementing the method provided in the first aspect.
  • an embodiment of the present application provides a computer program product, including a program for implementing the method provided in the first aspect.
  • the method and electronic device for taking a screenshot of a long page provided by the embodiments of the present application create a virtual screen that can completely display the long page at one moment, and redraw the long page accordingly, so that a complete screenshot of the long page can be obtained through one screenshot. image.
  • FIG. 1 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a block diagram of a software structure of an electronic device provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of a method for taking a screenshot of a long page according to an embodiment of the present application
  • 4A is a schematic diagram of an application interface displayed by a display screen of an electronic device according to an embodiment of the present application
  • 4B is a schematic diagram of a long page provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of displaying a screenshot image on a display screen of an electronic device according to an embodiment of the present application
  • FIG. 6 is a flowchart of a method for taking a screenshot of a long page according to an embodiment of the present application
  • FIG. 7 is a flowchart of a method for taking a screenshot of a long page according to an embodiment of the present application.
  • FIG. 8 is a flowchart of a method for taking a screenshot of a long page according to an embodiment of the present application
  • FIG. 9 is a schematic block diagram of a device for taking screenshots of a long page according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of an electronic device according to an embodiment of the present application.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • an electronic device it can display a certain type of data or content through a page.
  • weather information can be displayed within a page.
  • a short message list is displayed on a page.
  • a page displays a message in a dialog box of an instant messaging application. It can be understood that when a large amount of data or content needs to be displayed on a page, limited by the size of the physical display screen of the electronic device, it is difficult to display the page completely at one time or to display all parts of the page at the same time, and it is necessary to display the page at the same time.
  • the display screen is displayed in stages (for example, in response to a sliding gesture operation initiated by the user, the page is scrolled and displayed. Or, the page is automatically scrolled and displayed).
  • a page that is, a page that needs to be scrolled and displayed instead of being completely displayed by the display screen of the electronic device at one time, it can be called a long page.
  • the long page cannot be completely displayed on one screen.
  • a scroll bar to support the user to control the scrolling display of the long page by sliding gestures, or the page scrolls automatically so that the display can be displayed at different times.
  • the screen displays different parts of a long page.
  • a part of a long page refers to one part among the multiple parts that make up the long page.
  • different parts of the plurality of parts may be connected but not overlapped, and may also be partially overlapped.
  • users need to take a screenshot of the long page they browse to obtain a screenshot image of the long page, so as to save or share the long page they browse to others.
  • a long page is triggered to be scrolled and displayed on the display screen (at a moment, a part of the long page is displayed on the display screen), and during the scrolling period, the interface (or the long page is displayed on the display screen at different times) is respectively updated.
  • Part of the page) to take screenshots to obtain multiple screenshot images.
  • use an image recognition algorithm to identify the scrolling distance or page repetition height between the multiple screenshot images, and crop the screenshot images accordingly to remove the repeated parts, and then splicing to obtain a relatively complete long page screenshot.
  • it is necessary to trigger page scrolling intercept the content displayed on the display screen multiple times to obtain multiple images, and stitch the multiple images to obtain a relatively complete long page screenshot.
  • This solution mainly involves two technical points of scrolling screenshots and image stitching.
  • page scrolling can be divided into automatic scrolling and manual scrolling.
  • Image stitching relies on an image stitching algorithm.
  • Image stitching algorithms may have recognition errors, especially when different pages have similar items or content, which are prone to recognition errors, which may result in overlapping or missing content in the stitched images.
  • the embodiment of the present application provides a method for taking screenshots, which can obtain a complete screenshot image of a long page by taking a screenshot without scrolling the display, thereby avoiding content overlap or content loss in the screenshot image caused by scrolling the long screenshot. It also shortens the time required to take screenshots and improves the user's long-page screenshot experience.
  • the long page may be a scrollable long page. That is, the electronic device 100 can scroll the page in response to the user's operation to display different parts of the long page. Or the electronic device 100 may automatically scroll to display different parts of a long page.
  • the screenshot method provided by the embodiments of the present application may be applied to the electronic device 100 .
  • the electronic device 100 may be a portable electronic device such as a mobile phone, a tablet computer, a digital camera, a personal digital assistant (PDA), a wearable device, a laptop computer, and the like.
  • portable electronic devices include, but are not limited to, carry-on Or portable electronic devices with other operating systems.
  • the portable electronic device described above may also be other portable electronic devices, such as a laptop or the like having a touch-sensitive surface (eg, a touch panel).
  • the electronic device 100 may not be a portable electronic device, but a desktop computer having a touch-sensitive surface (eg, a touch panel).
  • the embodiment of the present application does not specifically limit the type of the electronic device 100 .
  • FIG. 1 shows a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • graphics processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, and/or USB interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • USB interface etc.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140 and supplies power to the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • Bluetooth blue, BT
  • global navigation satellite system global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • infrared technology infrared, IR
  • Bluetooth may be Bluetooth low energy (BLE).
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the wireless communication module 160 may support Wi-Fi NAN.
  • the electronic device 100 can receive the discovery beacon frame sent by the Wi-Fi NAN master device through the wireless communication module 160, so as to know the arrival time of the Wi-Fi NAN active time window, so as to wake up when the active time window is reached, and realize the communication with the Wi-Fi NAN.
  • - Other devices in the Fi NAN exchange information through the Wi-Fi interface.
  • the wireless communication module 160 can also receive broadcast messages sent by other devices in the Wi-Fi NAN, and determine the target device and the relay device according to the broadcast messages.
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can adopt LCD, OLED, AMOLED, FLED, Miniled, MicroLed, Micro-oLed, QLED, etc.
  • the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application, in conjunction with FIG. 2, uses a layered architecture of Android Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the layered architecture may include three layers, which are an application layer, an application framework layer, and a system library from top to bottom.
  • the application layer may include a screenshot application (screenshot), an application page analysis (analysisservice) module, a virtual runtime control (virtualruntimecontrol) module, and the like.
  • the application framework layer may include an application management (application management system, AMS) module, a virtual runtime service (virtualruntimeservice) module, a display management (displaymanager) module, a window management system (WMS) module, an image control (surfacecontrol) module, etc. .
  • AMS application management system
  • virtualruntimeservice virtualruntimeservice
  • display management displaymanager
  • WMS window management system
  • image control surfacecontrol
  • the system library may include an image rendering (surfaceflinger) module, a virtual display (virtualdisplay) module, and the like.
  • a kernel layer may also be set under the system library.
  • the kernel layer can include various types of drivers, such as display drivers, camera drivers, audio drivers, sensor drivers, etc.
  • the above-mentioned layers are not limited to include only the above-mentioned modules or applications, and may also include other modules or applications.
  • the application layer can also include applications such as camera, calendar, calling, SMS, etc.
  • the application framework layer may also include a telephony manager, a resource manager, a notification manager, and the like.
  • the system library may also include a media library (Media Libraries), a three-dimensional graphics processing library (eg, OpenGL ES), a two-dimensional graphics engine (eg, SGL), and the like.
  • Screenshot applications can be used to detect or receive user-initiated screenshots of long pages. It can be understood that the screen capture operation can be divided into a long page screen capture operation and a screen capture operation of the current interface.
  • the screenshot operation of the current interface is to only capture the interface currently displayed on the display screen of the electronic device 100 .
  • the long page operation is for long pages, which is used to completely capture the long page to which the current display interface of the display screen belongs.
  • the long page A1 and the screenshot of the long page are introduced as an example.
  • the long page A1 may also be referred to as a page A1.
  • the interface A11 shown in FIG. 4A is a part of the page A1 shown in FIG. 4B .
  • the electronic device 100 can only display a part of the page A1 at a time, such as the interface A11.
  • the electronic device 100 can capture the interface A11 to obtain a screenshot image of the interface A11. If the screenshot application detects or receives a screenshot operation of a long page, the electronic device 100 can screenshot the page A1 to obtain a screenshot image including the page A1.
  • the screenshot operation of a long page may be a preset gesture operation, such as an "S"-shaped gesture operation.
  • the screenshot operation of a long page may specifically be a preset voice command, for example, "take a screenshot of a long page”.
  • the screen capture application may execute step 302 to send a request identified by page A1 to the application management module. This request is used to request the identification of page A1.
  • page A1 is the page to which the screen is currently displaying the interface.
  • the page A1 identifier specifically refers to the page to which the screen is currently displaying the interface.
  • the page to which the display screen is currently displaying the interface is referred to as the page A1.
  • the application management module may respond to the request for the identification of the page A1, determine the page to which the current display interface belongs, and then determine the identification of the page to which the current display interface belongs, that is, determine the identification of the page A1.
  • the identifier of the page A1 may be an identifier of an application (application, APP) to which the page A1 belongs, such as a package name (package name). That is to say, in this example, the identifier of the application to which the page A1 belongs or the application to which the currently displayed interface belongs can be used as the identifier of the page A1.
  • the identifier of the page A1 may be preset (for example, set by the developer of the application) identification information used to distinguish the page A1 from other pages, such as a serial number and the like.
  • the application management module may execute step 303 to send the identifier of the page A1 to the screen capture application.
  • the screen capture application may perform step 304 to send a page analysis request to the application page analysis module, which includes the identification of the page A1.
  • the application page analysis module may respond to the page analysis request, and execute 305a to send a layout information request to the application management module, which may include the identifier of the page A1.
  • the application management module can extract the identifier of the page A1 therein, and obtain the layout information of the page A1 accordingly.
  • the layout information of the page A1 may include layout elements for forming the page A1 or for displaying on the page A1. It can be understood that a page may be composed of visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets (Widget). These visual interface elements can be called layout elements or controls.
  • the layout information may specifically include the size and shape of the layout elements, and the positional relationship between different layout elements or the distance between different layout elements. That is, in this example, the layout information includes absolute sizes of layout elements, and absolute distances between different layout elements. That is, when a layout element is displayed on the page, the size is fixed, and the distance between different layout elements is fixed.
  • the layout information of page A1 may specifically include the size of page A1.
  • the size of the page A1 may be determined according to the size of the layout elements on the page A1 and the positional relationship or distance between different layout elements.
  • the size of the page may refer to the vertical length and horizontal width of the page.
  • the layout information of page A1 may specifically include relative sizes between different layout elements, and relative positional relationships or relative distances between different layout elements. That is to say, when different layout elements are displayed on the page, the size relationship or size ratio between the different layout elements is fixed, and the vertical position relationship and the horizontal position relationship between the different layout elements are fixed. The scale is fixed, or the ratio between the vertical distance and the horizontal distance between the different layout elements is fixed.
  • the layout information of the page A1 may specifically include the aspect ratio of the page A1.
  • the aspect ratio may be determined according to the relative sizes between different layout elements on the page A1 and the relative positional relationship or relative distance between the different layout elements.
  • the layout information for page A1 may include the resolution of page A1, as well as include the size of page A1.
  • the application management module may execute step 306a to send the layout information of the page A1 to the application page analysis module.
  • the application page analysis module may also perform step 305b, and send a request for displaying window information to the window management module, which may include the identifier of the page A1.
  • the window management module may extract the identifier of the page A1 therein, and obtain the information of the display window of the page A1 accordingly.
  • the display window of the page A1 refers to a display window or a display area for displaying the page A1.
  • the display screen of the electronic device 100 may include one or more display windows.
  • the display window can also be understood as the display area. Different display windows or display areas are used to display corresponding pages or parts of the corresponding pages (in the case that a window does not fully display its corresponding page, a part of the window is displayed. That is, the page is a long page).
  • the display area or display window currently allocated by the electronic device 100 for the page A1 may be referred to as the display window B1.
  • the display window B1 may be one of a plurality of display windows displayed on the display screen of the electronic device 100 .
  • the size of the display window B1 may be equal to or slightly smaller than the size of the physical display screen of the electronic device 100 .
  • the size of the display screen window B1 is slightly smaller than the size of the physical display screen of the electronic device 100 means that the physical display screen of the electronic device 100 also displays system-level interface elements, for example, a status bar and //or display virtual keys at the bottom of the display area.
  • the status bar can include the operator name (eg China Mobile ), a signal bar indicating signal strength, remaining battery power, etc.
  • the virtual key may include a virtual return key, a virtual home key, and the like.
  • the display window information may be a display parameter of the display window.
  • the display parameters of the display window may include the size or size of the display window.
  • the display parameter of the display window may specifically refer to the aspect ratio of the display window.
  • the display parameters of the display window may specifically refer to the vertical length and horizontal width of the display window.
  • the display parameters of the display window may include the resolution of the display window.
  • the window management module may execute step 306b to send the displayed window information of the page A1 to the application page analysis module.
  • the application page analysis module may execute step 307 to determine whether the page A1 is a long page. Specifically, according to the layout information of the page A1 and the display window information of the page A1, it can be determined whether the display window of the page A1 can completely display the page A1 at one moment. If the display window of the page A1 cannot completely display the page A1 at one time, but can only display a part of the page A1, it can be determined that the page A1 is a long page. Otherwise, it can be determined that page A1 is not a long page.
  • the layout information of page A1 may include absolute sizes of layout elements of page A1, and absolute distances between different layout elements.
  • the layout information of page A1 may include the size of page A1.
  • the display window information of the page A1 may include the vertical length and horizontal width of the display window B1.
  • the layout information of page A1 may include relative sizes between different layout elements on page A1, and relative positional relationships or relative distances between different layout elements.
  • the layout information of page A1 may include the aspect ratio of page A1.
  • the display window information of the page A1 may include the aspect ratio of the display window B1.
  • the layout information for page A1 may include the resolution of page A1, as well as include the size of page A1.
  • the display window information of the page A1 may include the resolution and size of the display window B1.
  • the application page analysis module may execute step 308 to send long page indication information to the screen capture application, so that the screen capture application can know that page A1 is a long page.
  • the long page indication information may include the identifier of page A1, to indicate that the long page indication information is used to indicate that page A1 is a long page.
  • the screenshot application may perform step 309 to send a page redraw request to the virtual execution control module to instruct the virtual execution control module to redraw the page A1.
  • the page redraw request may include the identifier of the page A1, so that the virtual execution control module may know that the page to be redrawn is the page A1.
  • the virtual operation control module may execute step 310 to send a virtual display screen creation request to the virtual operation service module, so as to instruct the virtual operation service module to create a virtual display screen.
  • a virtual display is a display that does not exist physically, but a virtual display with set display parameters created by simulating the function of a physical display.
  • the display parameters of the display screen or the virtual display screen may include the aspect ratio of the display screen or the virtual display screen, and the like.
  • the display parameters of the display screen or the virtual display screen may include the vertical length, the horizontal width, and the like of the display screen or the virtual display screen.
  • the virtual operation service module may create a virtual display screen in response to the virtual display screen creation request.
  • the virtual operation service module may execute step 311 to send the display parameters of the created virtual display screen to the virtual operation control module.
  • the virtual execution control module may perform step 312 to perform page redrawing. Specifically, the page A1 may be redrawn according to the layout information of the page A1 under the constraints of the display parameters of the virtual display screen received in step 311 .
  • the virtual execution control module may acquire the layout information of the page A1 from the application management module or the application page analysis module.
  • the page redraw request sent in step 309 may include the identification of page A1.
  • the virtual execution control module can learn the identifier of the page A1, and learn that the page redraw request is used to request the page A1 to be redrawn.
  • the virtual operation control module may acquire the layout information of the page A1 from the application management module or the application page analysis module based on the identifier of the page A1.
  • the virtual operation control module can redraw the page A1 according to the layout information of the page A1 under the constraints of the display parameters of the virtual display screen.
  • the application draws the page according to the page layout information of the application. But for ease of understanding, this article briefly introduces the process.
  • the virtual operation control module can determine whether the virtual display screen can completely display the page A1 at the same time according to the display parameters of the virtual display screen. If the display parameters of the virtual display screen can support the complete display of page A1 at the same time. Then the virtual operation control module can draw and render the entire page A1 to obtain a new interface.
  • the new interface includes this page A1. In other words, the new interface includes the interface elements on page A1.
  • the virtual execution control module draws and renders a part of the page A1.
  • the partial display can be supported by the display parameters of the virtual display screen. That is, the display parameters of the virtual display screen are only enough to support the display of this part at a time.
  • the aspect ratio of the virtual display screen included in the display parameters of the virtual display screen can be set to 3:1, and the aspect ratio of the page A1 included in the layout information of the page A1 is 9:1. Then it can be determined that the virtual display screen can only display one third of the size of the page A1 at the same time. Therefore, the virtual execution control module can first draw a third of the size of the rendering page A1. That is, the drawn and rendered interface is one third of the page A1, or the drawn and rendered interface displays one of the three sides of the page A1.
  • the vertical length of the virtual display screen included in the display parameters of the virtual display screen can be set to 3 inches, and the horizontal width is 1 inch.
  • the vertical length of the page A1 included in the layout information of the page A1 is 9 inches, and the horizontal width is 1 inch. Then it can be determined that the virtual display screen can only display one third of the size of the page A1 at the same time. Therefore, the virtual execution control module can first draw a third of the size of the rendering page A1. That is, the drawn and rendered interface is one third of the page A1, or the drawn and rendered interface displays one of the three sides of the page A1.
  • the virtual operation control The module may execute step 313 to send a display parameter adjustment request to the virtual operation service module.
  • the virtual operation service module may adjust the display parameters of the virtual display screen in response to the display parameter adjustment request, and send the adjusted virtual parameters to the virtual operation control module through step 315 .
  • the virtual operation control module may draw the page A1 again based on the adjusted display parameters, and determine whether the page or interface rendered by the drawing is a part of the page A1.
  • steps 313 to 316 may be repeated until the adjusted display parameters support the complete display of the page A1 at the same moment.
  • step 317 may be executed to determine that the page A1 is completely displayed on the virtual display screen.
  • the pages drawn and rendered in steps 312 and 316 above may also be referred to as interfaces.
  • the layout information of page A1 includes the aspect ratio of page A1.
  • the virtual display screen creation request sent in step 310 may include the aspect ratio of page A1.
  • the virtual operation service module can set display parameters of the virtual display screen according to the aspect ratio of the page A1, so that the created virtual display screen can completely display the page A1 at the same time.
  • the aspect ratio included in the layout information of the page A1 can be set as 9:1, and the aspect ratio of the virtual display screen created by the virtual operation service module is also 9:1.
  • the page A1 can be completely displayed on the virtual display screen.
  • the interface obtained by redrawing and rendering can completely display the page A1.
  • subsequent steps 313-316 need not be performed.
  • the layout information for page A1 includes the size of page A1.
  • the virtual display screen creation request sent in step 310 may include the size of page A1.
  • the virtual operation service module can set display parameters of the virtual display screen according to the size of the page A1, so that the created virtual display screen can completely display the page A1 at the same time.
  • the vertical length of page A1 can be set to be 9 inches, and the horizontal width can be set to 1 inch.
  • the vertical length of the virtual display screen created by the virtual operation service module is greater than or equal to 9 inches, and the horizontal width is greater than or equal to 1 inch.
  • the page A1 can be completely displayed on the virtual display screen.
  • the interface obtained by redrawing and rendering can completely display the page A1.
  • subsequent steps 313-316 need not be performed.
  • the virtual operation control module may execute step 317 to determine that the page A1 is completely displayed on the virtual display screen. Then, the interface drawn and rendered in step 312 or step 316 and completely displaying page A1 may be stored according to a preset image format (eg, bitmap or JPEG, etc.) to obtain a screenshot image of page A1.
  • a preset image format eg, bitmap or JPEG, etc.
  • the virtual operation control module may execute step 317 to determine that the page A1 is completely displayed on the virtual display screen. Then, step 318 may be executed to send a complete screenshot request to the graphics control module. The complete screen capture request is used to capture the interface displayed by the virtual display screen.
  • the graphics control module may execute step 319 to send a graphics composition request to the graphics rendering module, so as to request the graphics rendering module to synthesize the screenshot based on the interface drawn and rendered in step 312 or 316 that completely displays the page A1.
  • the interface can be combined with a status bar or the like to obtain or simulate an interface displayed on a real display screen. Screenshots are taken according to the combined interface to obtain a screenshot image. For the specific process of taking screenshots, reference may be made to the introduction of the prior art, which will not be repeated here.
  • the graphics rendering module may perform step 320 to send the screenshot image to the screenshot application, so as to display or edit the screenshot image to the user.
  • the screenshot application may display the interface shown in FIG. 5 when or after receiving the screenshot image. In this way, the user can share, save, or edit the screenshot image.
  • the method for taking a screenshot of a long page provided by the embodiment of the present application is described above with reference to the software architecture shown in FIG. 2 . But it is not limited to the software architecture shown in FIG. 2 .
  • the electronic device 100 can also implement the long page screenshot method shown in FIG. 3 under other software architectures. It can be understood that the functions of each module in the software architecture shown in FIG. 2 are implemented by the processing of the electronic device 100 by running computer instructions. Under other software architectures, the method embodiment shown in FIG. 3 can be implemented by adaptive modification of relevant computer instructions. Or according to the embodiment shown in FIG. 3, computer instructions are compiled. Therefore, the specific implementation process of the screenshot method under other software architectures will not be described in detail in this specification.
  • the long page screenshot method provided by the embodiment of the present application realizes that a complete screenshot image of the long page can be obtained by one interception by creating a virtual screen capable of completely displaying the long page at one moment, and redrawing the long page accordingly. In this way, problems such as image splicing, overlapping and confusion in the scrolling screenshot are avoided, and the user's long screenshot experience is improved.
  • an embodiment of the present application provides a method for taking a screenshot of a long page.
  • the method may be performed by the electronic device 100 .
  • the method includes the following steps.
  • the screenshot application module can initiate screenshots.
  • the execution module performs application page analysis. It can be judged whether the page exceeds one screen. If the page does not exceed one screen, the graphics drawing module can take a single page screenshot to complete the screenshot.
  • the virtual running module can create a virtual running environment, and then load the application page in the virtual running environment.
  • the virtual execution module may receive status data from the execution module.
  • the virtual execution module can also determine whether the page exceeds one screen in the virtual execution environment based on the state data received from the execution module and the page loaded in the virtual execution environment. If there is no more than one screen, the application page can be redrawn.
  • the graphics drawing module can take a single page screenshot of the interface displayed by the virtual screen, so as to complete the screenshot.
  • the screenshot method provided by the embodiments of the present application can obtain a complete screenshot of a long scrollable page, without problems such as different scrolling effects, overlapping image stitching, or confusion, thereby improving user experience. That is to say, with the solution provided by the embodiments of the present application, when taking a screenshot of a long scrollable page, it is not necessary to rely on page scrolling and splicing, but directly use the display synthesis technology, so that the page information can be captured completely, and at the same time, the scrolling response is avoided. One and splicing confusion and other issues.
  • This embodiment of the present application provides a method for taking a screenshot of a long page as shown in FIG. 7 .
  • the method may be performed by the electronic device 100 .
  • a virtual application loading environment can be created, the application page can be loaded into the virtual operating environment, the display page of the application can be loaded in the virtual operating environment, and the height of the application page can be adjusted according to the measurement result of the displayed content of the application page, so that the page of the application can be loaded. It can be completely displayed in a complete layout in the running environment. According to the display content of the virtual operating environment, a complete screenshot of the application is obtained by synthetically redrawing it.
  • the method may include the following steps.
  • the user triggers a screenshot of a long scrollable page
  • the screenshot method provided by the embodiments of the present application can obtain a complete screenshot of a long scrollable page, without problems such as different scrolling effects, overlapping image stitching, or confusion, thereby improving user experience. That is to say, with the solution provided by the embodiments of the present application, when taking a screenshot of a long scrollable page, it is not necessary to rely on page scrolling and splicing, but directly use the display synthesis technology, so that the page information can be captured completely, and at the same time, the scrolling response is avoided. One and splicing confusion and other issues.
  • an embodiment of the present application provides a method for taking a screenshot of a long page, and the method can be applied to an electronic device 100 configured with a physical display screen.
  • the method may include the following steps.
  • Step 801 displaying a first interface through the physical display screen, where the first interface is a part of a long page;
  • Step 802 receiving a screenshot operation for the long page
  • Step 803 in response to the screenshot operation, create a virtual display screen capable of completely displaying the long page;
  • Step 804 under the constraints of the display parameters of the virtual display screen, draw and render a second interface according to the layout information of the long page;
  • Step 805 using the second interface to generate a screenshot image including the long page.
  • the layout information includes at least one of the following:
  • the creating a virtual display screen capable of completely displaying the long page includes: creating a first virtual display screen; under the constraints of display parameters of the first virtual display screen, according to the drawing and rendering a third interface based on the layout information; when the third interface is a part of the long page, adjust the display parameters of the first virtual display screen to obtain a second virtual display screen; Under the constraints of the display parameters of the virtual display screen, a fourth interface is drawn and rendered according to the layout information; when the long page is completely displayed in the fourth interface, it is determined that the second virtual display screen is capable of complete A virtual display screen showing the long page.
  • determining that the second virtual display screen is the virtual display screen capable of completely displaying the long page includes: when the long page is completely displayed.
  • the fourth interface only displays the long page, it is determined that the second virtual display screen is the virtual display screen capable of completely displaying the long page .
  • the drawing and rendering the second interface according to the layout information of the long page under the constraints of display parameters of the virtual display screen includes: determining that the fourth interface is the Second interface.
  • the layout information includes at least one of the following:
  • the aspect ratio of the long page the size of the long page.
  • the creating a virtual display screen capable of displaying the long page in its entirety includes:
  • a virtual display screen having the aspect ratio of the long page or the size of the long page is created to obtain a virtual display screen capable of completely displaying the long page.
  • generating the screenshot image including the long page by using the second interface includes: storing the second interface according to a preset image format to obtain the screenshot image.
  • the long page screenshot method provided by the embodiment of the present application realizes that a complete screenshot image of the long page can be obtained by one interception by creating a virtual screen capable of completely displaying the long page at one moment, and redrawing the long page accordingly.
  • an embodiment of the present application provides a long-page screen capture device.
  • the apparatus may be configured in an electronic device having a physical display screen, such as the electronic device 100 .
  • the device includes:
  • a display unit 910 configured to display a first interface through the physical display screen, where the first interface is a part of a long page;
  • a receiving unit 920 configured to receive a screenshot operation for the long page
  • a creating unit 930 configured to create a virtual display screen capable of completely displaying the long page in response to the screenshot operation
  • a drawing unit 940 configured to draw and render a second interface according to the layout information of the long page under the constraints of display parameters of the virtual display screen;
  • the generating unit 950 is configured to generate a screenshot image including the long page by using the second interface.
  • each functional unit of the long-page screen capture device provided by the embodiments of the present application may be implemented with reference to the above embodiments shown in FIG. 8 , which will not be repeated here.
  • the long page screenshot device provided by the embodiments of the present application creates a virtual screen that can completely display the long page at one moment, and redraws the long page accordingly, so that a complete screenshot image of the long page can be obtained through one screenshot.
  • an embodiment of the present application provides an electronic device 1000 .
  • the electronic device 1000 may include a processor 1010, a memory 1020, a transceiver 1030, and a physical display screen 1040; the memory 1020 is used to store computer instructions.
  • the computer program stored in the memory 1020 is executed by the processor 1010, the electronic device 1000 executes the operations performed by the electronic device 100 in the above method embodiments, for example, as shown in FIG. 3 or FIG. 6 or FIG. 7 or FIG. 8 operations performed by the electronic device 100 in the illustrated embodiment.
  • the processor 1010 may perform data processing operations.
  • the method steps in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (programmable rom) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disks, removable hard disks, CD-ROMs or known in the art in any other form of storage medium.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may reside in an ASIC.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer instructions can be sent from one website site, computer, server, or data center to another website site by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) , computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.

Landscapes

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

Abstract

一种长页面截屏方法及电子设备,涉及电子设备技术领域。该方法包括:通过电子设备的物理显示屏显示第一界面,所述第一界面是长页面的局部(801);接收针对所述长页面的截屏操作(802);响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏(803);在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面(804);利用所述第二界面,生成包括所述长页面的截屏图像(805)。在该方法中,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,利用重新绘制的长页面,实现了一次截取,即可得到长页面的完整截屏图像。

Description

一种长页面截屏方法及电子设备
本申请要求于2021年02月19日提交中国国家知识产权局、申请号为202110189021.2、申请名称为“一种长页面截屏方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子设备技术领域,具体涉及一种长页面截屏方法及电子设备。
背景技术
随着电子设备的发展,具有显示屏的电子设备可以运行多种应用,呈现的不同的页面。受限于物理显示屏的尺寸限制,有的页面不被物理显示屏在一个时刻完整显示,需要滚动显示。不被电子设备的显示屏在一个时刻完整显示,而需要滚动显示的页面,可以称为长页面。
有时,用户需要长页面的截屏图像,例如用户在分享其所浏览的页面时,截取并分享长页面的图像。目前长页面的截屏方案为分别截取显示屏在不同时刻所显示的长页面的局部,得到长页面的多个局部图像。然后,拼接该多个局部图像,以得到一张比较完整的长页面截图。该方案可能发生拼接内容重叠或缺少等问题,长页面截图效果不佳。
发明内容
本申请实施例提供了一种长页面截屏方法及电子设备,可以在通过一次界面截图,截取到长页面的完整截图,实现了较佳的截图效果。
第一方面,本申请实施例提供了一种长页面截屏方法,应用于配置有物理显示屏的电子设备,所述方法包括:通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;接收针对所述长页面的截屏操作;响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;利用所述第二界面,生成包括所述长页面的截屏图像。
也就是说,在该方法中,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,利用重新绘制的长页面,实现了一次截取,即可得到长页面的完整截屏图像。
在一种可能的实现方式中,所述布局信息包括以下至少一项:
所述长页面上不同布局元素之间的相对大小、所述长页面上的不同布局元素之间的相对位置。
也就是说,在该实现方式中,可以获取长页面上的布局元素以及不同布局元素之间的位置关系,由此可以对长页面进行绘制渲染。
在一种可能的实现方式中,所述创建能够完整显示所述长页面的虚拟显示屏包括: 创建第一虚拟显示屏;在所述第一虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第三界面;当所述第三界面为所述长页面的局部时,对所述第一虚拟显示屏的显示参数进行调整,以得到第二虚拟显示屏;在所述第二虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第四界面;当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
也就是说,可以通过调整虚拟显示屏的显示参数,由此可以能够创建出能够完整显示长页面的虚拟显示屏。
在一种可能的实现方式中,当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏,包括:当所述长页面在所述第四界面中完整显示,且所述第四界面仅显示所述长页面时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
也就是说,在该实现方式中,可以创建出刚好可以完整显示长页面的虚拟显示屏。
在一种可能的实现方式中,所述在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面,包括:确定所述第四界面为所述第二界面。
也就是说,在该实现方式中,在虚拟显示屏能够完整显示长页面的情况下,可以将用于测量该虚拟显示屏的显示参数是否合适的界面,直接用作用于得到截屏图像的界面。
在一种可能的实现方式中,所述布局信息包括以下至少一项:
所述长页面的纵横比、所述长页面的尺寸。
在一种可能的实现方式中,所述创建能够完整显示所述长页面的虚拟显示屏包括:创建具有所述长页面的纵横比或所述长页面的尺寸的虚拟显示屏,以得到能够完整显示所述长页面的虚拟显示屏。
也就是说,在该实现方式中,可以根据长页面的纵横比或尺寸,直接创建出能够完整显示该长页面的虚拟显示屏。
在一种可能的实现方式中,所述利用所述第二界面,生成包括所述长页面的截屏图像包括:按照预设的图像格式,存储所述第二界面,以得到所述截屏图像。
也就是说,在该实现方式中,可以将虚拟显示屏所显示的界面直接存储为截屏图像,提高了截屏效率。
第二方面,本申请实施例提高了一种电子设备,包括:处理器、存储器、收发器、物理显示屏;所述存储器用于存储计算机指令;当所述电子设备运行时,所述处理器执行所述计算机指令,使得所述电子设备执行:通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;接收针对所述长页面的截屏操作;响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;利用所述第二界面,生成包括所述长页面的截屏图像。
在一种可能的实现方式中,所述布局信息包括以下至少一项:
所述长页面上不同布局元素之间的相对大小、所述长页面上的不同布局元素之间的相对位置。
在一种可能的实现方式中,所述处理器执行所述计算机指令,使得所述电子设备 还执行:创建第一虚拟显示屏;在所述第一虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第三界面;当所述第三界面为所述长页面的局部时,对所述第一虚拟显示屏的显示参数进行调整,以得到第二虚拟显示屏;在所述第二虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第四界面;当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
在一种可能的实现方式中,所述处理器执行所述计算机指令,使得所述电子设备还执行:当所述长页面在所述第四界面中完整显示,且所述第四界面仅显示所述长页面时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
在一种可能的实现方式中,所述处理器执行所述计算机指令,使得所述电子设备还执行:确定所述第四界面为所述第二界面。
在一种可能的实现方式中,所述布局信息包括以下至少一项:
所述长页面的纵横比、所述长页面的尺寸。
在一种可能的实现方式中,所述处理器执行所述计算机指令,使得所述电子设备还执行:创建具有所述长页面的纵横比或所述长页面的尺寸的虚拟显示屏,以得到能够完整显示所述长页面的虚拟显示屏。
在一种可能的实现方式中,所述处理器执行所述计算机指令,使得所述电子设备还执行:按照预设的图像格式,存储所述第二界面,以得到所述截屏图像。
第三方面,本申请实施例提供了一种长页面截屏装置,包括用于执行第一方面所提供的方法的单元。
第四方面,本申请实施例提供了一种计算机存储介质,包括计算机软件指令,所述计算机软件指令包括用于实现第一方面所提供的方法的程序。
第五方面,本申请实施例提供了一种计算机程序产品,包括用于实现第一方面所提供的方法的程序。
本申请实施例提供的长页面截屏方法及电子设备,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,实现了通过一次截取,就可以得到长页面的完整截屏图像。
附图说明
图1为本申请实施例提供的一种电子设备的硬件结构示意图;
图2为本申请实施例提供的一种电子设备的软件结构框图;
图3为本申请实施例提供的一种长页面截屏方法的流程图;
图4A为本申请实施例提供的由电子设备的显示屏所显示的一种应用界面示意图;
图4B为本申请实施例提供的一种长页面示意图;
图5为本申请实施例提供的电子设备的显示屏展示截屏图像的示意图;
图6为本申请实施例提供的一种长页面截屏方法的流程图;
图7为本申请实施例提供的一种长页面截屏方法的流程图;
图8为本申请实施例提供的一种长页面截屏方法的流程图;
图9为本申请实施例提供的一种长页面截屏装置示意性框图;
图10为本申请实施例提供的一种电子设备的示意性框图。
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。
在本说明书的描述中“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
其中,在本说明书的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
在本说明书的描述中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
对于电子设备而言,其可以通过一个页面来展示某种类型的数据或者内容。例如,可以在一个页面内展示天气信息。再例如,在一个页面内展示短消息列表。再例如,在一个页面展示即时通讯应用的一个对话框中消息。可以理解,在需要在一个页面上展示的数据或内容较多时,受限于电子设备的物理显示屏的尺寸,难以一次性完整显示该页面或者说难以同时显示该页面的所有部分,而需要在显示屏上分次显示(例如,响应于用户起始的滑动手势操作,滚动显示该页面。或者,自动滚动显示该页面)。对于这种类型的页面,即不被电子设备的显示屏在一个时刻完整显示,而需要滚动显示的页面,可以称为长页面。换言之,用户在浏览长页面时,长页面不能够被一屏完整显示,通常会有滚动条支持用户通过滑动手势操作,来控制长页面的滚动显示,或者页面自动滚动,以在不同时刻通过显示屏显示长页面的不同局部。其中,长页面的一个局部是指组成长页面的多个部分中一个部分。其中,该多个部分中的不同部分可以相接但不重叠,也可以部分重叠。
有时,用户需要对其所浏览的长页面进行截屏,得到长页面的截屏图像,以便保存或向他人分享其所浏览的长页面。
在一种方案中,触发长页面在显示屏上滚动显示(在一个时刻,显示屏上显示长页面的一个局部),在滚动期间,分别对显示屏在不同时刻所显示的界面(或者说长页面的局部)进行截屏,得到多个截屏图像。然后,利用图像识别算法,识别该多个截屏图像之间的滚动距离或页面重复高度,并据此对截屏图像进行裁剪,以去掉重复部分,然后进行拼接,以得到一张比较完整的长页面截图。换言之,在该方案中,需要触发页面滚动,多次截取显示屏所显示的内容,得到多个图像,对该多个图像进行拼接,得到较为完整的长页面截图。
该方案主要涉及滚动截屏和图像拼接这两个技术要点。
其中,页面滚动可以分为自动滚动和手动滚动。
对于自动滚动而言,其通过注入模拟触摸事件触发页面滚动,以在滚动期间进行多次截屏。其中,每次滚动的距离不确定,滚动期间的截屏依赖页面的滑动响应参数设置,因此,相邻两次截屏之间重复位置不确定。进而导致拼接难道大,拼接后的图像可能出现内容重叠或内容丢失的情况。并且,不同的页面的滚动速度不一,页面的长度不同,整个截屏过程的时长长短不一,由此使得用户截屏体验不一致,例如,整个截屏过程漫长,需要用户长时间等待,导致用户截屏体验很差。
对于手动滚动而言,其通过在显示屏上显示提示信息以及功能按钮,引导用户通过手动方式触发页面滚动,以在滚动期间进行多次截屏。在整个截屏过程中,需要用户多次干预操作,操作较为繁琐,也导致用户截屏体验不佳。
图像拼接依赖于图像拼接算法。图像拼接算法可能出现识别误差,尤其是不同页面具有类似条目或内容时,容易出现识别误差,进而导致拼接后的图像可能出现内容重叠或内容丢失的情况。
本申请实施例提供了一种截屏方法,可以在不需要滚动显示的情况下,通过一次截屏,得到完整的长页面截屏图像,从而避免了滚动长截屏所导致的截屏图像中内容重叠或内容丢失的情况,并且也缩短了截屏所需的时间,改善了用户的长页面截屏体验。其中,长页面可以为可滚动长页面。即电子设备100可以响应于用户的操作,进行页面滚动,以显示长页面不同的局部。或者电子设备100可以自动滚动,以显示长页面不同的局部。
本申请实施例提供的截屏方法可以应用于电子设备100。电子设备100可以为手机、平板电脑、数码相机、个人数字助理(personal digitalassistant,PDA)、可穿戴设备、膝上型计算机(laptop)等便携式电子设备。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2021136526-appb-000001
或者其他操作系统的便携式电子设备。上述便携式电子设备也可以是其他便携式电子设备,诸如具有触敏表面(例如触控面板)的膝上型计算机(laptop)等。还应当理解的是,在本申请其他一些实施例中,电子设备100也可以不是便携式电子设备,而是具有触敏表面(例如触控面板)的台式计算机。本申请实施例对电子设备100的类型不做具体限定。
图1示出了本申请实施例提供的一种电子设备100的结构示意图。
如图1所示。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。 在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,和/或USB接口等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器 件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。在一些实施例中,蓝牙可以为蓝牙低功耗(bluetooth low energy,BLE)。
无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
本申请实施例中,无线通信模块160可以支持Wi-Fi NAN。电子设备100可以通过无线通信模块160接收Wi-Fi NAN主设备发送的发现信标帧,从而可以获知Wi-Fi NAN的活动时间窗口到达时间,以便在活动时间窗口达到时醒来,实现和Wi-Fi NAN中其他设备通过Wi-Fi接口进行信息交互。无线通信模块160还可以接收Wi-Fi NAN中其他设备发送的广播消息,并根据广播消息,确定目标设备以及中继设备。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用LCD,OLED,AMOLED,FLED,Miniled,MicroLed,Micro-oLed,QLED等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例结合图2,以分层架构的安卓
Figure PCTCN2021136526-appb-000002
系统为例,示例性说明电子设备100的软件结构。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,如图2所示,分层架构可以包括三层,从上至下分别为应用程序(application)层,应用程序框架层(framework),系统库。
如图2所示,应用程序层可以包括截屏应用(screenshot)、应用页面分析(analysisservice)模块、虚拟运行控制(virtualruntimecontrol)模块等。
应用程序框架层可以包括应用管理(application management system,AMS)模块,虚拟运行服务(virtualruntimeservice)模块、显示管理(displaymanager)模块、窗口管理(window management system,WMS)模块、图像控制(surfacecontrol)模块等。
系统库可以包括图像绘制(surfaceflinger)模块、虚拟显示(virtualdisplay)模块等。
示例性的,系统库之下还可以设置内核层(未示出)。内核层可以包括各类驱动程序,例如显示驱动,摄像头驱动,音频驱动,传感器驱动等。
上述各层并不局限于仅包括上述各模块或应用,还可以包括其他模块或应用。例如,应用程序层还可以包括相机、日历、通话、短消息等应用程序。应用框架层还可以包括电话管理器,资源管理器,通知管理器等。系统库还可以包括媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
上述同一层上的不同模块或应用之间,以及不同层的模块或应用之间可以通过预先定义的应用编程接口(application programming interface,API)或函数实现相互调用。
接下来,结合图3,对图2所示模块或应用的功能进行示例说明。
截屏应用可以用于检测或者说接收用户起始的长页面截屏操作。可以理解,截屏操作可分为长页面截屏操作和当前界面的截屏操作。当前界面的截屏操作是仅截取电子设备100的显示屏当前显示的界面。而长页面操作是针对长页面而言,其用于完整地截取显示屏当前显示界面所属的长页面。
接下来,结合图4A和图4B,示例介绍长页面A1以及长页面截图。其中,为方便表述,长页面A1也可以称为页面A1。
图4A所示的界面A11为图4B所示的页面A1的一个局部。受限于电子设备100的显示屏的尺寸,电子设备100一个时刻只能显示页面A1的一个局部,例如界面A11。
在电子设备100的显示屏显示界面A11的情况下,若截屏应用检测到或接收到当前界面的截屏操作,则电子设备100可以截取界面A11,得到界面A11的截图图像。若截屏应用检测到或接收到长页面的截屏操作,则电子设备100可以截取页面A1,得到包含页面A1的截屏图像。
在一些实施例中,对于配置有触摸屏的电子设备100而言,长页面的截屏操作可以为预设的手势操作,例如“S”形手势操作。在一些实施例中,长页面的截屏操作具体可以预设的语音指令,例如“长页面截屏”。
回到图3,在电子设备100的显示屏当前正在显示界面A11或页面A1的其他局部的情况下,若截屏应用在步骤301中,检测或接收到长页面截屏操作。截屏应用可以执行步骤302,向应用管理模块发送页面A1标识的请求。该请求用于请求页面A1的标识。如上所述,页面A1为显示屏当前正在显示界面的所属页面。页面A1标识具体是指显示屏当前正在显示界面的所属页面。为方便方便,在电子设备100的显示屏当前正在显示界面A11或页面A1的其他局部的情况下,将显示屏当前正在显示界面的所属页面称为页面A1。
应用管理模块可以响应页面A1的标识的请求,确定当前显示界面所属的页面,进 而确定当前显示界面所属页面的标识,即确定页面A1的标识。在一个例子中,页面A1的标识可以为页面A1所属应用(application,APP)的标识,例如包名(package name)。也就是说,在该例子中,可以页面A1所属应用或者说当前显示界面所属应用的标识可以用作页面A1的标识。在一个例子中,页面A1的标识可以为预设(例如应用的开发者设置的)的用于将页面A1和其他页面区分开的标识信息,例如编号等。
应用管理模块可以执行步骤303,向截屏应用发送页面A1的标识。截屏应用在接收到页面A1的标识时或之后,可以执行步骤304,向应用页面分析模块发送页面分析请求,其中包括页面A1的标识。
应用页面分析模块可以响应页面分析请求,执行305a,向应用管理模块发送布局信息请求,其中可以包括页面A1的标识。应用管理模块在接收到布局信息请求时或之后,可以提取其中的页面A1的标识,并据此获取页面A1的布局信息。页面A1的布局信息可以包括用于形成页面A1或者用于在页面A1上显示的布局元素。可以理解,页面可以由图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、微件(Widget)等可视的界面元素组成。这些可视的界面元素可以称为布局元素,也可以称为控件。
在一个说明性示例中,布局信息具体可以包括布局元素的大小和形状,以及不同布局元素之间的位置关系或者说不同布局元素之间的距离。也就是说,在该示例中,布局信息包括布局元素的绝对大小,以及不同布局元素之间的绝对距离。即在某个布局元素在页面上显示时,大小是固定的,以及不同布局元素之间的距离是固定的。
在一些说明性示例中,页面A1的布局信息具体可以包括页面A1的尺寸。该页面A1的尺寸可以根据页面A1上的布局元素之间的大小,以及不同布局元素之间的位置关系或者说距离确定。其中,页面的尺寸可以是指该页面的纵向长度和横向宽度。
在一个说明性示例中,页面A1的布局信息具体可用包括不同布局元素之间的相对大小,以及不同布局元素之间的相对位置关系或者说相对距离。也就是说,即不同布局元素在页面上显示时,该不同的布局元素之间的大小关系或者说大小比例是固定的,以及该不同布局元素之间的纵向位置关系和横向位置关系之间的比例是固定的,或者说该不同布局元素之间的纵向距离和横向距离之间的比例是固定的。
在一个说明性示例中,页面A1的布局信息具体可以包括页面A1的纵横比。该纵横比可以根据页面A1上的不同布局元素之间的相对大小,以及不同布局元素之间的相对位置关系或者说相对距离确定。
在一个说明性示例中,页面A1的布局信息可以包括页面A1的分辨率,以及包括页面A1的尺寸。
继续参阅图3,应用管理模块可用执行步骤306a,将页面A1的布局信息发送给应用页面分析模块。
应用页面分析模块还可以执行步骤305b,向窗口管理模块发送显示窗口信息的请求,其中可以包括页面A1的标识。窗口管理模块在接收到显示窗口信息的请求时或之后,可以提取其中的页面A1的标识,并据此获取页面A1的显示窗口的信息。页面A1的显示窗口是指用于显示页面A1的显示窗口或者说显示区域。
可以理解,电子设备100的显示屏上可以包括一个或多个显示窗口。显示窗口也可以理解为显示区域。不同的显示窗口或显示区域用于显示相应的页面或者说相应页 面的局部(在某个窗口不够完整显示其对应页面的情况下,显示该窗口的局部。即该页面为长页面)。为方便表述,可以将当前电子设备100为页面A1分配的显示区域或者说显示窗口称为显示窗口B1。示例性的,显示窗口B1可以是电子设备100的显示屏所显示的多个显示窗口中的一个。示例性的,显示窗口B1的尺寸可以等于或略小于电子设备100的物理显示屏的尺寸。其中,显示屏窗口B1的尺寸略小于电子设备100的物理显示屏的尺寸是指,电子设备100的物理显示屏还显示系统级别的界面元素,例如可以在物理显示屏的顶部显示有状态栏和/或在显示区域的底部显示虚拟按键。状态栏可以包括运营商名称(例如中国移动
Figure PCTCN2021136526-appb-000003
)、表示信号强度的信号格、剩余电量等。虚拟按键可以包括虚拟返回按键、虚拟home按键等。
显示窗口信息可以为显示窗口的显示参数。在一些实施例中,显示窗口的显示参数可以包括显示窗口的尺寸或者说大小。在一个例子中,显示窗口的显示参数具体可以是指显示窗口的纵横比。在一个例子中,显示窗口的显示参数具体可以是指显示窗口的纵向长度和横向宽度。在一些实施例中,显示窗口的显示参数可以包括显示窗口的分辨率。
继续参阅图3,窗口管理模块可以执行步骤306b,将页面A1的显示窗口信息发送给应用页面分析模块。
应用页面分析模块在获取了页面A1的布局信息和页面A1的显示窗口信息时后之后,可以执行步骤307,确定页面A1是否为长页面。具体而言,可以根据页面A1的布局信息和页面A1的显示窗口信息,确定页面A1的显示窗口是否可以在一个时刻完整显示页面A1。若页面A1的显示窗口不能在一个时刻完整显示页面A1,而是仅可以显示页面A1的一个局部,则可以确定页面A1为长页面。否则,则可以确定页面A1不是长页面。
在一个说明性示例中,页面A1的布局信息可以包括页面A1布局元素的绝对大小,以及不同布局元素之间的绝对距离。或者,页面A1的布局信息可以包括页面A1的尺寸。页面A1的显示窗口信息可以包括显示窗口B1的纵向长度和横向宽度。由此,可以在纵向和/或横向上,比较页面A1的布局信息和显示窗口B1,由此,可以确定页面A1是否为长页面。
在一个说明性示例中,页面A1的布局信息可以包括页面A1上不同布局元素之间的相对大小,以及不同布局元素之间的相对位置关系或者说相对距离。或者,页面A1的布局信息可以包括页面A1的纵横比。页面A1的显示窗口信息可以包括显示窗口B1的纵横比。由此,可以在纵向和/或横向上,比较页面A1的布局信息和显示窗口B1,由此,可以确定页面A1是否为长页面。
在一个说明性示例中,页面A1的布局信息可以包括页面A1的分辨率,以及包括页面A1的尺寸。页面A1的显示窗口信息可以包括显示窗口B1的分辨率和尺寸。由此,可以确定显示窗口B1在是否可以完整显示具有布局信息所包括的分布率的页面A1,进而确定页面A是否为长页面。
在确定了页面A1是长页面时或之后,应用页面分析模块可以执行步骤308,向截屏应用发送长页面指示信息,以使截屏应用可以获知页面A1为长页面。示例性的,长页面指示信息可以包括页面A1的标识,以表示该长页面指示信息用于指示页面A1为 长页面。
截屏应用在获知了页面A1为长页面时或之后,可以执行步骤309,向虚拟运行控制模块发送页面重绘请求,以指示虚拟运行控制模块重新绘制页面A1。示例性的,页面重绘请求可以包括页面A1的标识,以便虚拟运行控制模块可以获知需要重新绘制的页面为页面A1。
虚拟运行控制模块可以执行步骤310,向虚拟运行服务模块发送虚拟显示屏创建请求,以指示虚拟运行服务模块创建虚拟显示屏。虚拟显示屏是一种并非实体存在的显示屏,而是通过模拟物理显示屏的功能,创建的具有设定显示参数的虚拟屏幕(virtual display)。示例性的,显示屏或者说虚拟显示屏的显示参数可以包括该显示屏或该虚拟显示屏的纵横比等。示例性的,显示屏或者说虚拟显示屏的显示参数可以包括该显示屏或该虚拟显示屏的纵向长度、横向宽度等。
虚拟运行服务模块可以响应于虚拟显示屏创建请求,创建一个虚拟显示屏。虚拟运行服务模块可以执行步骤311,将创建的虚拟显示屏的显示参数发送给虚拟运行控制模块。
虚拟运行控制模块可以执行步骤312,执行页面重绘。具体而言,可以在通过步骤311接收到的虚拟显示屏的显示参数的约束下,根据页面A1的布局信息,重新绘制页面A1。
示例性的,虚拟运行控制模块可以从应用管理模块或应用页面分析模块获取页面A1的布局信息。在一个例子中,在步骤309中发送的页面重绘请求可以包括页面A1的标识。由此,虚拟运行控制模块可以获知页面A1的标识,以及获知该页面重绘请求用于请求重新绘制页面A1。进而虚拟运行控制模块可以基于页面A1的标识从应用管理模块或应用页面分析模块获取页面A1的布局信息。
虚拟运行控制模块可以在虚拟显示屏的显示参数的约束下,根据页面A1的布局信息,重新绘制页面A1。可以参考现有技术中,在电子设备的显示屏的约束下,应用根据应用的页面布局信息,绘制该页面的过程。但为了便于理解,本文对该过程进行简单介绍。
虚拟运行控制模块可以根据虚拟显示屏的显示参数,确定虚拟显示屏在同一时刻是否可以完整显示页面A1。若虚拟显示屏的显示参数可以支持在同一时刻可以完整显示页面A1。则虚拟运行控制模块可以对整个页面A1进行绘制及渲染,以得到新的界面。该新的界面包括这个页面A1。换言之,该新的界面包括了页面A1上的界面元素。
若虚拟显示屏的显示参数可以不支持在同一时刻可以完整显示页面A1。即虚拟显示屏还不能够在同一时刻完整显示页面A1。则虚拟运行控制模块绘制及渲染页面A1的一个局部。该局部的显示可以得到虚拟显示屏的显示参数的支持。即虚拟显示屏的显示参数在一个时刻仅够支持显示该局部。
举例而言,可以设定虚拟显示屏的显示参数所包括的虚拟显示屏的纵横比为3:1,而页面A1的布局信息所包括的页面A1的纵横比为9:1。则可以确定虚拟显示屏在同一时刻仅能显示页面A1大小的三分之一。由此,虚拟运行控制模块可以先绘制渲染页面A1大小的三分之一。即绘制渲染出的界面为页面A1的三分之一或者说绘制渲染的界面显示了页面A1的三方之一。
再举例而言,可以设定虚拟显示屏的显示参数所包括的虚拟显示屏的纵向长度为3英寸,横向宽度为1英寸。而页面A1的布局信息所包括的页面A1的纵向长度为9英寸,横向宽度为1英寸。则可以确定虚拟显示屏在同一时刻仅能显示页面A1大小的三分之一。由此,虚拟运行控制模块可以先绘制渲染页面A1大小的三分之一。即绘制渲染出的界面为页面A1的三分之一或者说绘制渲染的界面显示了页面A1的三方之一。
在显示屏显示参数的约束下,根据页面的布局信息,对页面的绘制渲染的具体过程,可以参考现有技术的介绍,在此不再赘述。
在一些实施例中,继续参阅图3,若步骤312中的页面重绘所得到的界面仍是页面A1的局部,即步骤311发送的显示参数不支持同一时刻完整显示页面A1,则虚拟运行控制模块可以执行步骤313,向虚拟运行服务模块发送显示参数调整请求。虚拟运行服务模块可以响应于显示参数调整请求,调整虚拟显示屏的显示参数,并通过步骤315,将调整后的虚拟参数发送给虚拟运行控制模块。之后,虚拟运行控制模块可以基于调整后的显示参数,再次绘制页面A1,并判断绘制渲染出的页面或者说界面是否为页面A1的局部。当绘制渲染出的界面仍为页面A1的局部(即绘制渲染出的界面没有完整显示页面A1)时,可以重复步骤313-步骤316,直到调整后的显示参数支持在同一时刻完整显示页A1。例如,可以执行步骤317中,确定页面A1在虚拟显示屏中完整显示。
其中,上文中步骤312以及步骤316中绘制渲染出的页面也可以称为界面。
在一些实施例中,页面A1的布局信息包括页面A1的纵横比。步骤310中发送的虚拟显示屏创建请求可包括页面A1的纵横比。虚拟运行服务模块在创建虚拟显示屏时,可以根据页面A1的纵横比设置虚拟显示屏的显示参数,由此,使得创建的虚拟显示屏可以在同一个时刻完整显示页面A1。举例而言,可以设定页面A1的布局信息所包括的纵横比为9:1,则虚拟运行服务模块创建的虚拟显示屏的纵横比也为9:1。由此,页面A1可以在虚拟显示屏上完整显示。在该实施例中,在步骤312中,重新绘制渲染得到的界面可以完整显示页面A1。从而无需在执行后续的步骤313-316。
在一些实施例中,页面A1的布局信息包括页面A1的尺寸。步骤310中发送的虚拟显示屏创建请求可包括页面A1的尺寸。虚拟运行服务模块在创建虚拟显示屏时,可以根据页面A1的尺寸设置虚拟显示屏的显示参数,由此,使得创建的虚拟显示屏可以在同一个时刻完整显示页面A1。举例而言,可以设定页面A1的纵向长度为9英寸,横向宽度为1英寸。则虚拟运行服务模块创建的虚拟显示屏的纵向长度≥9英寸,横向宽度≥1英寸。由此,页面A1可以在虚拟显示屏上完整显示。在该实施例中,在步骤312中,重新绘制渲染得到的界面可以完整显示页面A1。从而无需在执行后续的步骤313-316。
在一些实施例中,虚拟运行控制模块可以执行步骤317,确定页面A1在虚拟显示屏中完整显示。然后,可以将步骤312或步骤316中绘制渲染的完整显示了页面A1的界面按照预设的图像格式(例如bitmap或JPEG等)进行存储,得到页面A1的截屏图像。其中,截屏图像的具体图像格式可以参考现有技术介绍,在此不再赘述。
在一些实施例中,虚拟运行控制模块可以执行步骤317,确定页面A1在虚拟显示屏中完整显示。然后,可以执行步骤318,向图形控制模块发送完整截屏请求。该完 整截屏请求用于截取虚拟显示屏所显示的界面。图形控制模块可以执行步骤319,向图形绘制模块发送图形合成请求,以请求图形绘制模块基于步骤312或步骤316中绘制渲染的完整显示了页面A1的界面,合成截屏图形。例如,可以将该界面和状态栏等合并,以得到或者模拟出在真实显示屏上显示的界面。并根据合并得到的界面进行截屏,得到截屏图像。其中,截屏的具体过程可以参考现有技术的介绍,在此不再赘述。
图形绘制模块可以执行步骤320,向截屏应用发送截屏图像,以便向用户展示或者编辑截屏图像。
在一些实施例中,以截取图4B所示长页面为例,截屏应用在接收到截屏图像时或之后,可以显示图5所示的界面。由此,用户可以对截屏图像进行分享或收藏或编辑等操作。
上文结合图2所示的软件架构,对本申请实施例所提供的长页面截屏方法进行了示例说明。但并不限于图2所示的软件架构。电子设备100在其他软件架构下,也可以实现图3所示的长页面截屏方法。可以理解,图2所示软件架构中各模块的功能是电子设备100的处理运行计算机指令所实现的。在其他软件架构下,对相关计算机指令的适应性修改,可实现图3所示的方法实施例。或者根据图3所示实施例,编制计算机指令。由此,本说明书不再对其他软件架构下的截屏方法的具体实现过程一一进行赘述。
本申请实施例提供的长页面截屏方法,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,实现了通过一次截取,就可以得到长页面的完整截屏图像。由此避免了滚动截屏中图像拼接重叠、错乱等问题,改善了用户长截屏体验。
参阅图6,本申请实施例提供了一种长页面截屏方法。该方法可以由电子设备100执行。如图6所示,该方法包括如下步骤。
截屏应用模块可以启动截屏。
执行模块进行应用页面分析。可以判断页面是否超过一屏。若页面没有超过一屏,图形绘制模块可以进行单页截取,从而完成截屏。
若页面超过一屏,虚拟运行模块可以创建虚拟运行环境,然后在虚拟运行环境中加载应用页面。虚拟运行模块可以从执行模块接收状态数据。虚拟运行模块还可以基于从执行模块接收的状态数据以及虚拟运行环境加载的页面,判断页面是否在虚拟运行环境中超过一屏。若没有超过一屏,则可以进行应用页面重新绘制。
然后,图形绘制模块可以对虚拟屏显示的界面进行单页截取,从而完成截屏。
本申请实施例提供的截屏方法,可以获取可滚动长页面的完整截图,而不会出现滚动效果不一、图片拼接重叠或错乱等问题,提升用户体验。也就是说,通过本申请实施例提供的方案,在对可滚动长页面进行截屏时,不必依赖于页面滚动和拼接,而直接使用显示合成技术,页面信息抓取完整,同时避免了滚动响应不一和拼接错乱等问题。
本申请实施例提供了一种如图7所示的长页面截屏方法。该方法可以由电子设备100执行。在该方法中,可以通过创建虚拟应用加载环境,将应用页面加载到虚拟运行环境中,在虚拟运行环境启动加载应用的显示页面,并根据应用页面的显示内容测 量结果调整高度,使应用的页面能完整的在运行的环境中完整布局显示。根据虚拟运行环境的显示内容,进行合成重绘得到应用的完整截图。
该方法可以包括如下步骤。
1.用户触发可滚动长页面的截屏;
2.获取应用的页面信息;
3.启动页面分析服务,发起页面分析请求,向AMS和WMS请求获取页面的布局显示和状态信息;
4.向虚拟运行控制模块发起页面加载请求,通过虚拟运行服务创建应用页面虚拟运行环境,加载页面及页面的显示状态和参数;
5.根据页面的测量和绘制情况,适当调整页面显示的尺寸,以较合适的大小重绘;
6.发起完整截屏请求,通过图形绘制模块合成虚拟屏截屏图片;
本申请实施例提供的截屏方法,可以获取可滚动长页面的完整截图,而不会出现滚动效果不一、图片拼接重叠或错乱等问题,提升用户体验。也就是说,通过本申请实施例提供的方案,在对可滚动长页面进行截屏时,不必依赖于页面滚动和拼接,而直接使用显示合成技术,页面信息抓取完整,同时避免了滚动响应不一和拼接错乱等问题。
综合以上内容,本申请实施例提供了一种长页面截屏方法,该方法可以应用于配置有物理显示屏的电子设备100。参阅图8,该方法可以包括如下步骤。
步骤801,通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;
步骤802,接收针对所述长页面的截屏操作;
步骤803,响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;
步骤804,在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;
步骤805,利用所述第二界面,生成包括所述长页面的截屏图像。
在一些实施例中,所述布局信息包括以下至少一项:
所述长页面上不同布局元素之间的相对大小、所述长页面上的不同布局元素之间的相对位置。
在这些实施例的一个示例中,所述创建能够完整显示所述长页面的虚拟显示屏包括:创建第一虚拟显示屏;在所述第一虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第三界面;当所述第三界面为所述长页面的局部时,对所述第一虚拟显示屏的显示参数进行调整,以得到第二虚拟显示屏;在所述第二虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第四界面;当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
在该示例的一个例子中,当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏,包括:当所述长页面在所述第四界面中完整显示,且所述第四界面仅显示所述长页面时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
在这些实施例的另一个示例中,所述在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面,包括:确定所述第四界面为所述第二界面。
在一些实施例中,所述布局信息包括以下至少一项:
所述长页面的纵横比、所述长页面的尺寸。
在这些实施例的一个示例中,所述创建能够完整显示所述长页面的虚拟显示屏包括:
创建具有所述长页面的纵横比或所述长页面的尺寸的虚拟显示屏,以得到能够完整显示所述长页面的虚拟显示屏。
在一些实施例中,所述利用所述第二界面,生成包括所述长页面的截屏图像包括:按照预设的图像格式,存储所述第二界面,以得到所述截屏图像。
本申请实施例提供的长页面截屏方法,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,实现了通过一次截取,就可以得到长页面的完整截屏图像。
参阅图9,本申请实施例提供了一种长页面截屏装置。该装置可以配置于具有物理显示屏的电子设备,例如电子设备100。如图9所示,该装置包括:
显示单元910,用于通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;
接收单元920,用于接收针对所述长页面的截屏操作;
创建单元930,用于响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;
绘制单元940,用于在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;
生成单元950,用于利用所述第二界面,生成包括所述长页面的截屏图像。
本申请实施例提供的长页面截屏装置的各功能单元的功能可以参考上文对图8所示的各实施例实现,在此不再赘述。
本申请实施例提供的长页面截屏装置,通过创建能够在一个时刻完整显示长页面的虚拟屏,并据此重新绘制长页面,实现了通过一次截取,就可以得到长页面的完整截屏图像。
参阅图10,本申请实施例提供了一种电子设备1000。电子设备1000可以包括处理器1010、存储器1020、收发器1030、物理显示屏1040;所述存储器1020用于存储计算机指令。当存储器1020存储的计算机程序被处理器1010执行时,电子设备1000执行上述各方法实施例中电子设备100执行的操作,例如图3所示或图6所示或图7所示或图8所示实施例中的电子设备100执行的操作。具体而言,处理器1010可以进行数据处理操作。
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器 (erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。

Claims (18)

  1. 一种长页面截屏方法,其特征在于,应用于配置有物理显示屏的电子设备,所述方法包括:
    通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;
    接收针对所述长页面的截屏操作;
    响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;
    在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;
    利用所述第二界面,生成包括所述长页面的截屏图像。
  2. 根据权利要求1所述的方法,其特征在于,所述布局信息包括以下至少一项:
    所述长页面上不同布局元素之间的相对大小、所述长页面上的不同布局元素之间的相对位置。
  3. 根据权利要求2所述的方法,其特征在于,所述创建能够完整显示所述长页面的虚拟显示屏包括:
    创建第一虚拟显示屏;
    在所述第一虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第三界面;
    当所述第三界面为所述长页面的局部时,对所述第一虚拟显示屏的显示参数进行调整,以得到第二虚拟显示屏;
    在所述第二虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第四界面;
    当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
  4. 根据权利要求3所述的方法,其特征在于,当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏,包括:
    当所述长页面在所述第四界面中完整显示,且所述第四界面仅显示所述长页面时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
  5. 根据权利要求3或4所述的方法,其特征在于,所述在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面,包括:
    确定所述第四界面为所述第二界面。
  6. 根据权利要求1所述的方法,其特征在于,所述布局信息包括以下至少一项:
    所述长页面的纵横比、所述长页面的尺寸。
  7. 根据权利要求6所述的方法,其特征在于,所述创建能够完整显示所述长页面的虚拟显示屏包括:
    创建具有所述长页面的纵横比或所述长页面的尺寸的虚拟显示屏,以得到能够完整显示所述长页面的虚拟显示屏。
  8. 根据权利要求1所述的方法,其特征在于,所述利用所述第二界面,生成包括所述长页面的截屏图像包括:
    按照预设的图像格式,存储所述第二界面,以得到所述截屏图像。
  9. 一种电子设备,其特征在于,包括:处理器、存储器、收发器、物理显示屏;
    所述存储器用于存储计算机指令;
    当所述电子设备运行时,所述处理器执行所述计算机指令,使得所述电子设备执行:
    通过所述物理显示屏显示第一界面,所述第一界面是长页面的局部;
    接收针对所述长页面的截屏操作;
    响应于所述截屏操作,创建能够完整显示所述长页面的虚拟显示屏;
    在所述虚拟显示屏的显示参数的约束下,根据所述长页面的布局信息绘制渲染第二界面;
    利用所述第二界面,生成包括所述长页面的截屏图像。
  10. 根据权利要求9所述的电子设备,其特征在于,所述布局信息包括以下至少一项:
    所述长页面上不同布局元素之间的相对大小、所述长页面上的不同布局元素之间的相对位置。
  11. 根据权利要求10所述的电子设备,其特征在于,所述处理器执行所述计算机指令,使得所述电子设备还执行:
    创建第一虚拟显示屏;
    在所述第一虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第三界面;
    当所述第三界面为所述长页面的局部时,对所述第一虚拟显示屏的显示参数进行调整,以得到第二虚拟显示屏;
    在所述第二虚拟显示屏的显示参数的约束下,根据所述布局信息绘制渲染第四界面;
    当所述长页面在所述第四界面中完整显示时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行所述计算机指令,使得所述电子设备还执行:
    当所述长页面在所述第四界面中完整显示,且所述第四界面仅显示所述长页面时,确定所述第二虚拟显示屏为所述能够完整显示所述长页面的虚拟显示屏。
  13. 根据权利要求11或12所述的电子设备,其特征在于,所述处理器执行所述计算机指令,使得所述电子设备还执行:
    确定所述第四界面为所述第二界面。
  14. 根据权利要求9所述的电子设备,其特征在于,所述布局信息包括以下至少一项:
    所述长页面的纵横比、所述长页面的尺寸。
  15. 根据权利要求14所述的电子设备,其特征在于,所述处理器执行所述计算机指令,使得所述电子设备还执行:
    创建具有所述长页面的纵横比或所述长页面的尺寸的虚拟显示屏,以得到能够完整显示所述长页面的虚拟显示屏。
  16. 根据权利要求9所述的电子设备,其特征在于,所述处理器执行所述计算机指令,使得所述电子设备还执行:
    按照预设的图像格式,存储所述第二界面,以得到所述截屏图像。
  17. 一种长页面截屏装置,其特征在于,包括用于执行权利要求1-8任一项所述的方法的单元。
  18. 一种计算机存储介质,其特征在于,包括计算机软件指令,所述计算机软件指令包括用于实现权利要求1-8任一项所述方法的程序。
PCT/CN2021/136526 2021-02-19 2021-12-08 一种长页面截屏方法及电子设备 WO2022174655A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP21926369.6A EP4276615A4 (en) 2021-02-19 2021-12-08 LONG PAGE SCREEN CAPTURE METHOD AND ELECTRONIC DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110189021.2 2021-02-19
CN202110189021.2A CN114968423B (zh) 2021-02-19 2021-02-19 一种长页面截屏方法及电子设备

Publications (1)

Publication Number Publication Date
WO2022174655A1 true WO2022174655A1 (zh) 2022-08-25

Family

ID=82930267

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136526 WO2022174655A1 (zh) 2021-02-19 2021-12-08 一种长页面截屏方法及电子设备

Country Status (3)

Country Link
EP (1) EP4276615A4 (zh)
CN (1) CN114968423B (zh)
WO (1) WO2022174655A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180349107A1 (en) * 2017-06-05 2018-12-06 Apptimize, Inc. Preview Changes To Mobile Applications At Different Display Resolutions
CN110413366A (zh) * 2019-07-30 2019-11-05 深圳市乘法信息技术有限公司 一种基于区块链的截屏方法、装置、设备及存储介质
CN110704784A (zh) * 2019-10-10 2020-01-17 深圳前海微众银行股份有限公司 web页面截屏方法、装置、设备及计算机可读存储介质
CN111382386A (zh) * 2020-03-03 2020-07-07 上海掌门科技有限公司 一种用于生成网页截图的方法与设备
CN111399732A (zh) * 2020-03-13 2020-07-10 深圳市珍爱云信息技术有限公司 网页截图方法、装置、计算机设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200076449A (ko) * 2018-12-19 2020-06-29 삼성전자주식회사 증강 장치를 제어하는 방법 및 이를 수행하는 전자 장치
CN112068919B (zh) * 2020-09-17 2024-01-30 北京五八信息技术有限公司 一种网页截屏处理方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180349107A1 (en) * 2017-06-05 2018-12-06 Apptimize, Inc. Preview Changes To Mobile Applications At Different Display Resolutions
CN110413366A (zh) * 2019-07-30 2019-11-05 深圳市乘法信息技术有限公司 一种基于区块链的截屏方法、装置、设备及存储介质
CN110704784A (zh) * 2019-10-10 2020-01-17 深圳前海微众银行股份有限公司 web页面截屏方法、装置、设备及计算机可读存储介质
CN111382386A (zh) * 2020-03-03 2020-07-07 上海掌门科技有限公司 一种用于生成网页截图的方法与设备
CN111399732A (zh) * 2020-03-13 2020-07-10 深圳市珍爱云信息技术有限公司 网页截图方法、装置、计算机设备和存储介质

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
EP4276615A1 (en) 2023-11-15
CN114968423B (zh) 2024-05-14
EP4276615A4 (en) 2024-07-24
CN114968423A (zh) 2022-08-30

Similar Documents

Publication Publication Date Title
US11861161B2 (en) Display method and apparatus
US10853979B2 (en) Electronic device and method for displaying screen thereof
EP3483715B1 (en) Electronic device and method for controlling display
KR102330829B1 (ko) 전자 장치에서 증강현실 기능 제공 방법 및 장치
EP3920523A1 (en) Photographing method and terminal device
WO2021115194A1 (zh) 一种应用图标的显示方法及电子设备
US11989383B2 (en) Application window display method and terminal
CN108463799B (zh) 电子设备的柔性显示器及其操作方法
WO2020151460A1 (zh) 对象处理方法及终端设备
WO2021129536A1 (zh) 图标移动方法及电子设备
WO2022057512A1 (zh) 分屏方法、装置及电子设备
US20160313781A1 (en) Method for displaying user interface and electronic device thereof
US20180307387A1 (en) Electronic device and method for operating the electronic device
EP3792741A1 (en) Method for browsing folder of application, and electronic device
CN110908554B (zh) 长截图的方法及终端设备
WO2021057699A1 (zh) 具有柔性屏幕的电子设备的控制方法及电子设备
US20150220205A1 (en) User input method and apparatus in electronic device
KR102614044B1 (ko) 미라캐스트 제공 장치 및 방법
WO2021109960A1 (zh) 图像处理方法、电子设备及存储介质
CN111010523A (zh) 一种视频录制方法及电子设备
CN112347048A (zh) 电子装置及其共享数据的方法
US11526320B2 (en) Multi-screen interface control method and terminal device
WO2021098460A1 (zh) 截屏显示方法、装置和终端设备
CN111447598A (zh) 一种交互方法和显示设备
WO2022174655A1 (zh) 一种长页面截屏方法及电子设备

Legal Events

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

Ref document number: 21926369

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021926369

Country of ref document: EP

Effective date: 20230808

NENP Non-entry into the national phase

Ref country code: DE