WO2020134708A1 - 截图处理方法、计算设备及计算机存储介质 - Google Patents

截图处理方法、计算设备及计算机存储介质 Download PDF

Info

Publication number
WO2020134708A1
WO2020134708A1 PCT/CN2019/119261 CN2019119261W WO2020134708A1 WO 2020134708 A1 WO2020134708 A1 WO 2020134708A1 CN 2019119261 W CN2019119261 W CN 2019119261W WO 2020134708 A1 WO2020134708 A1 WO 2020134708A1
Authority
WO
WIPO (PCT)
Prior art keywords
layer element
layer
page
content
picture
Prior art date
Application number
PCT/CN2019/119261
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 US17/418,363 priority Critical patent/US11593981B2/en
Publication of WO2020134708A1 publication Critical patent/WO2020134708A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • 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

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular to a screenshot processing method, a computing device, and a computer storage medium.
  • the present disclosure is proposed in order to provide a screenshot processing method, a computing device, and a computer storage medium that overcome the above problems or at least partially solve the above problems.
  • a screenshot processing method including:
  • the first layer element corresponding to the content to be removed in the current page determines whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; wherein, The preset condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of the second layer element;
  • the content to be removed is covered to remove the content to be removed, and the processed page picture is obtained.
  • a computing device including: a processor, a memory, a communication interface, and a communication bus, and the processor, memory, and communication interface complete communication with each other through a communication bus;
  • the memory is used to store at least one executable instruction.
  • the executable instruction causes the processor to perform the following operations:
  • the first layer element corresponding to the content to be removed in the current page determines whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; wherein, The preset condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of the second layer element;
  • the content to be removed is covered to remove the content to be removed, and the processed page picture is obtained.
  • a non-volatile computer-readable storage medium having at least one executable instruction stored in the non-volatile computer-readable storage medium, the executable instruction causing the processor to perform the following operations :
  • the first layer element corresponding to the content to be removed in the current page determines whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; wherein, The preset condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of the second layer element;
  • the content to be removed is covered to remove the content to be removed, and the processed page picture is obtained.
  • a computer program product including a computer program stored on the above-mentioned non-volatile computer-readable storage medium.
  • the screenshot processing method, computing device, and computer storage medium of the present disclosure after the page image is captured, if it is determined that the page image contains the content to be removed, the first layer element corresponding to the content to be removed is found in the current page ; Then, determine whether there is a second layer element in the current page, the special hierarchical relationship and positional relationship between the second layer element and the first layer element, so that only using the second layer element can be treated Complete coverage of the removed content; based on this, the content to be removed is covered according to the judgment result, and the display of the content to be removed can be hidden.
  • the content to be removed can be covered to cover the content to be removed to avoid presenting the content to be removed to the user; and, based on The judgment result of whether there is a second layer element in the current page, and select the corresponding layer element to perform the overlay processing, instead of directly rearranging all the layer elements in the current page, which simplifies the processing process and improves the processing effectiveness.
  • FIG. 1 shows a flowchart of a screenshot processing method according to an embodiment of the present disclosure
  • FIG. 2 shows a flowchart of a screenshot processing method according to another embodiment of the present disclosure
  • FIG. 3 shows a schematic diagram of second layer elements in a specific embodiment of the present disclosure
  • FIG. 4 shows a schematic diagram of at least one fourth layer element in another specific embodiment
  • FIG. 5 shows a schematic diagram of a third layer element in another specific embodiment of the present disclosure.
  • FIG. 6 shows a schematic structural diagram of a computing device according to an embodiment of the present disclosure.
  • FIG. 1 shows a flowchart of a screenshot processing method according to an embodiment of the present disclosure. As shown in Figure 1, the method includes:
  • Step S101 According to the screenshot instruction, intercept the page image of the current page.
  • the screenshot instruction may be initiated by the user by performing a screenshot operation, or may be automatically initiated by the terminal according to current needs. For example, when the user clicks the share page button, the terminal automatically initiates a screenshot instruction to take a screenshot of the current page.
  • the screenshot operation is performed on the current page according to the screenshot instruction to obtain the page picture.
  • the screenshot instruction may be an instruction to take a screenshot of the entire current page, or an instruction to take a screenshot of a partial area of the current page, which is not specifically limited in this disclosure.
  • Step S102 determine whether the page picture contains the content to be removed; if yes, perform step S103; if not, the method ends.
  • the present disclosure does not specifically limit the determination method in this step.
  • a person skilled in the art can make flexible determination based on at least one of the image content of the page picture and the page elements included in the current page as the source of the page picture.
  • Step S103 Find the first layer element corresponding to the content to be removed in the current page; determine whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page.
  • the first layer element refers to the layer element that contains the content to be removed in the current page.
  • the purpose of the present disclosure is to hide the display of the content to be removed. Specifically, according to the position information of each layer element in the current page and the layer information (that is, the information of the layer where it is located), determine the relationship between each layer element and the first layer element Positional relationship and hierarchical relationship between them, and then determine whether there is a second layer element in the current page according to this, so as to determine an overlay processing strategy for the content to be removed according to the judgment result.
  • the first layer element and the second layer element have the following relationship: First, the hierarchical relationship.
  • the second layer element is located adjacent to the first layer element. In more detail, the second layer element is at a level below the first layer element. Second, the location relationship.
  • the preset condition is satisfied between the second layer element and the first layer element, and the preset condition specifically refers to the vertical projection area of the first layer element in the vertical projection area of the second layer element in the vertical direction of the page.
  • the second layer element is at the next level of the first layer element, and the second layer element completely "covers” the first layer element.
  • overlay here refers only to vertical The inclusion relationship on the projection area, not the occlusion between levels (for example, the upper layer covers the lower layer).
  • the first layer element is located one level above another layer element, and the first layer element is a rectangular picture located in the center of the screen, and the other layer element is another size equal to the screen
  • the other layer element is another size equal to the screen
  • Step S104 Perform overlay processing on the content to be removed according to the judgment result to remove the content to be removed to obtain the processed page picture.
  • the judgment result includes the presence of the second layer element or the absence of the second layer element; when the second layer element exists, it can be determined that only the second layer element can be used to achieve complete removal of the content to be removed Coverage, when there is no second layer element, it can be determined that multiple layer elements under the first layer element need to be used to achieve complete coverage of the content to be removed, based on this, the coverage process is performed according to the judgment result to hide The display of the content to be removed in the page picture.
  • the screenshot processing method provided in this embodiment, after the page image is captured, if it is determined that the page image contains the content to be removed, the first layer element corresponding to the content to be removed is found in the current page; then, the current Whether there is a second layer element on the page, and the special hierarchical relationship and positional relationship between the second layer element and the first layer element, so that only the second layer element can be used to achieve complete coverage of the content to be removed ; Based on this, the content to be removed is covered according to the judgment result, and the display of the content to be removed can be hidden.
  • the content to be removed can be covered to realize the hiding of the content to be removed, to avoid presenting the content to be removed to the user; and, according to The judgment result of whether there is a second layer element in the current page, select the corresponding layer element to perform the overlay process, instead of directly rearranging all the layer elements in the current page each time, simplifying the processing process and improving Processing efficiency.
  • FIG. 2 shows a flowchart of a screenshot processing method according to another embodiment of the present disclosure. As shown in Figure 2, the method includes:
  • Step S201 According to the screenshot instruction, intercept the page image of the current page.
  • a screenshot instruction when a screenshot instruction is received, a screenshot is taken according to the screenshot area specified in the screenshot instruction, and a page image corresponding to the screenshot area in the current page is obtained, for example, a page image corresponding to the complete current page is obtained.
  • Step S202 Determine whether the page picture contains the content to be removed. If yes, step S203 is executed; if no, the method ends.
  • the content to be removed is content that does not need to be displayed in the page picture.
  • the content to be removed is the content corresponding to the operable control in the current page. Since the page picture obtained from the screenshot, the user cannot perform any operation on the control displayed in the page picture, based on this, the page picture The corresponding control in is determined as the content to be removed.
  • the content to be removed is movable content in the current page.
  • the movable content is a playback progress bar, such as audio, video, and other content playback progress bars.
  • the content list to be removed may be preset. In the current page of the page image source, match each page element contained in the screenshot area of the current page with the list of content to be removed, if there is a page element that matches successfully, it is determined that the page image contains the content to be removed, indicating that there is If the content to be removed needs to be hidden, step S203 is executed to take hidden display measures; if not, it means that there is no content to be hidden and displayed in the page picture, and the method ends.
  • Step S203 Find the first layer element corresponding to the content to be removed in the current page.
  • the first layer element found in the current page is the layer element that matches successfully.
  • Step S204 determine whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; where the preset condition is: in the vertical direction of the page, the first layer element Of the vertical projection area is within the vertical projection area of the second layer element. If yes, go to step S205; if no, go to step S208.
  • part of the element content of the second layer element is blocked by the first layer element, and at the same time, the area corresponding to the first layer element is included in the corresponding within the area.
  • the results of the above two determination processes are both yes, it is determined that a second layer element exists in the current page.
  • step S205 is performed to perform an overlay process according to the second layer element; when the above two determination When the result of the process is not all true, it is determined that the second layer element does not exist in the current page.
  • step S208 is executed to cover based on multiple layer elements related to the first layer element.
  • FIG. 3 shows a schematic diagram of second layer elements in a specific embodiment of the present disclosure.
  • the layer element is determined by comparing the position information of the layer element and the layer information to determine the layer element 31 is the second layer element; and the layer element 33 does not satisfy the condition of completely "overwriting" the layer element 32, then the layer element 33 is not the second layer element.
  • the number, position information, or level information of the layer elements of the current page in FIG. 3 are all exemplary, and in specific implementation, the present disclosure is not limited thereto.
  • the number of non-second layer elements, position information, and layer information are not just a case of layer element 33.
  • Step S205 determine whether a third layer element exists in the current page, where the third layer element is located above the second layer element, and the third layer element and the second layer element overlap in the vertical direction of the page area. If not, step S206 is executed, and if yes, step S207 is executed.
  • the overlay between the layers will cause occlusion between the corresponding page elements, where the layer elements on the upper layer will block the layer elements on the lower layer with overlapping areas, for example, as shown in Figure 3
  • the layer element 32 will block the display of the layer element 31.
  • the third layer element can be understood as a layer element corresponding to the picture content that will be covered by the second layer element.
  • FIG. 5 shows a schematic diagram of a third layer element in another specific embodiment of the present disclosure. What is different from FIG. 3 is that there is an upper layer located in layer element 3 (that is, the second layer element) in FIG. 5, and has layer element 3 (that is, the second layer element) in the vertical direction of the page. Layer element 51 (that is, the third layer element) in the overlapping area, and when the third layer element exists, it is obviously not possible to use only the second layer element for overlay processing, and the third layer must also be considered The element will be covered by the second layer element.
  • layer element 3 that is, the second layer element
  • layer element 3 that is, the second layer element
  • step S206 is executed to perform the overlay process using only the second layer element; when it is determined that the third layer element exists, step S207 is executed to utilize the The elements of the second layer and the elements of the third layer are overlaid to ensure the integrity of the information transmitted by the page pictures.
  • Step S206 If it is determined that the third layer element does not exist, the second layer element is overlaid to the corresponding position of the page picture according to the position information of the second layer element to obtain the processed page picture.
  • the position information of the second layer element in the current page is obtained.
  • the position information may be the edge coordinate information of at least one second layer element; according to the position information, the page picture The corresponding position corresponding to the position information is determined in, and then the second layer element is covered to the corresponding position, and then the content to be removed is completely covered, and the processed page image no longer shows the content to be removed.
  • the coordinates of the four vertices (upper left vertex, upper right vertex, lower right vertex, and lower left vertex) of layer element 31 are (a1, b1), (a2, b2), (a3, b3 ), and (a4, b4), determine the corresponding coordinate position in the page picture, and cover the layer element 31 according to the corresponding coordinate position.
  • the second layer element can be used to cover the content to be removed in the page picture, the display of the content to be removed can be hidden, and there is no need to use multiple layer elements to perform the overlay process, making the processing process simpler Efficient.
  • Step S207 If it is determined that there is a third layer element, then according to the layer information of the first layer element and the third layer element, the content to be removed is covered to obtain a processed page picture.
  • the first layer element is located below and adjacent to the first layer element, and the third layer element is located above the second layer element, the first layer element
  • the level information of the third layer element is specifically that the third layer element is located above the first layer element, or the third layer element and the first layer element belong to the same layer.
  • the process of overwriting processing is specifically: when the third layer element is located above the first layer element, or the third layer element and the first layer element belong to the same layer, first according to the second layer element’s Position information, covering the second layer element to the corresponding position of the page picture, that is: firstly using the second layer element located in the lower layer to cover the content to be removed, the occlusion of the content to be removed has been completed, and then the to be removed is hidden The display of content.
  • the third layer element is overlaid to the corresponding position above the second layer element to obtain the processed page picture, that is: on the basis of blocking the content to be removed, Further, other content that needs to be displayed blocked by the second layer element is overlaid on the second layer element in the page picture, so that the information transmitted in the finally obtained page picture is consistent with the information transmitted in the current page.
  • the third layer element is layer element 51
  • the process of performing the overlay process is as follows: First, according to the position information of layer element 31 in the current page, layer element 31 is overlaid to the corresponding page image Position to complete the blocking of the playback progress bar in the page picture; then, according to the position information of the layer element 51 in the current page, the layer element 51 is overlaid to the corresponding position above the layer element 31 in the page picture, so that The element content of the layer element 51 can be displayed in the page picture.
  • the example in FIG. 5 only uses the third layer element as the one, it is described in the specific implementation that if there are multiple third layer elements, for each third layer element , All need to perform the above correction process.
  • the third layer element is further used to perform the overlay process to ensure the integrity of the information transmitted by the page picture.
  • steps S205 to S207 are all descriptions of the overlay process for the case where there is a second layer element that completely "overwrites" the first layer element in the current page.
  • steps S208 to S209 are descriptions of the overlay process performed when there is no second layer element in the current page.
  • Step S208 If it is determined that the second layer element does not exist, determine at least one fourth layer element in the current page that has an overlapping area with the first layer element in the vertical direction of the page.
  • the layer adjacent to the first layer element does not have a layer element that can completely "overwrite" the first layer element
  • it needs to be on the current page Determine the layer element related to the first layer element (that is, at least one fourth layer element) in order to use the related layer element to hide the display of the content to be removed.
  • the relevant layer element is determined by: starting from the layer below the first layer element and adjacent to the first layer element, The layer elements of each layer are searched in order from top to bottom, until the found multiple layer elements meet the preset termination condition, the search is stopped, and the multiple layer elements found at the time of stop are determined as at least one fourth Layer element; wherein the preset termination condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of at least one fourth layer element.
  • FIG. 4 shows a schematic diagram of at least one fourth layer element in another specific embodiment.
  • the layer element 41 in the layer adjacent to the layer element 32 (that is, the first layer element) in FIG. 4 does not completely “overwrite” the layer element 32, That is, there is no second layer element.
  • the layer element 41 is first found, obviously the layer element The vertical projection of 32 cannot completely fall within the area of the vertical projection of layer element 41, which does not meet the preset termination condition; continue to look down to find layer element 31, the vertical projection of layer element 32 falls on the figure In the area formed by the vertical projection of layer element 41 and layer element 31 (the two layer elements found), if the preset termination condition is met, the search is stopped, and the found layer element 41 and layer Element 31 is determined as at least one fourth layer element. It should be noted that, according to the layer information of the layer element 33, it can be determined whether it is at least one fourth layer element. For example, if the layer element 33 is below the layer element 31, when the layer element 33 has not been found When the preset termination condition is satisfied, the layer element 33 is not the first layer element.
  • the bottom layer of the page is usually a background layer.
  • the bottom layer is not found when the preset termination condition is met.
  • at least one element of the fourth layer is a non-bottom element.
  • At least one fourth layer element can be determined, because at least one first layer element is a layer element that is searched according to layer information from top to bottom and stops searching when the preset termination condition is met, Then, the at least one fourth layer element is usually only part of the layer elements in the current page, but not all layer elements.
  • Step S209 According to the position information and level information of the at least one fourth layer element, in order from the lower layer to the upper layer, at least one fourth layer element sequentially covers the corresponding position of the page picture to obtain the processed page picture.
  • the Cover to the page picture to get the processed page picture.
  • the layer element 41 and the layer element 41 are at least one fourth layer element, in order from the bottom to the top of the layer information (layer element 31 is below the layer element 41) . Then the layer element 31 is first overlaid into the page picture according to its position information, and then the layer element 41 is overlaid into the page picture according to its position information, thereby achieving complete occlusion of the layer element 32, and according to the layer The information is overwritten from bottom to top, so that the processed page pictures can avoid the inaccurate information displayed due to chaotic layer overlay.
  • At least one fourth layer element is used to cover to complete the complete occlusion of the content to be removed; at the same time, at least one fourth layer element is usually only a part of the layer elements of the current page, but not all layers Elements, you can reduce the amount of data processing for the overlay process; and, according to the level information from the bottom to the top of the overlay process, you can make the processed page image pass accurate information; In addition, when the preset termination conditions are met, all found The layer element is determined to be at least one fourth layer element, thereby avoiding the problem of missing information in the processed page picture.
  • the corresponding overlay processing strategy is determined according to whether the result obtained by judging whether the second layer element exists in the current page is different.
  • the solution of this embodiment can use only a part of the layer elements to complete the occlusion of the content to be removed to achieve the purpose of hiding the content to be removed; at the same time, compared to the way of rearranging all layer elements, this implementation
  • the processing efficiency of the example solution is higher; moreover, the solution of this embodiment ensures the completeness and accuracy of picture information transmission while completing the hidden display of the content to be removed.
  • Embodiments of the present disclosure provide a non-volatile computer-readable storage medium.
  • the non-volatile computer-readable storage medium stores at least one executable instruction, and the computer-executable instruction can execute any of the foregoing method embodiments. Screenshot processing method.
  • the executable instructions can be used to make the processor perform the following operations:
  • the first layer element corresponding to the content to be removed in the current page determines whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; wherein, The preset condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of the second layer element;
  • the content to be removed is covered to remove the content to be removed, and the processed page picture is obtained.
  • executable instructions further cause the processor to perform the following operations:
  • the second layer element is overlaid to the corresponding position of the page picture according to the position information of the second layer element to obtain the processed page picture.
  • executable instructions further cause the processor to perform the following operations:
  • the executable instructions further cause the processor to perform the following operations:
  • the second layer element is overwritten according to the position information of the second layer element To the corresponding position of the page picture, and then cover the third layer element to the corresponding position above the second layer element according to the position information of the third layer element to obtain the processed page picture.
  • executable instructions further cause the processor to perform the following operations:
  • At least one fourth layer element in the current page that has an overlapping area with the first layer element in the vertical direction of the page is determined, and the fourth layer element is a non-bottom layer element;
  • the at least one fourth layer element sequentially covers the corresponding position of the page picture to obtain the processed page picture.
  • the content to be removed is removable content in the current page.
  • the content to be removed is a playback progress bar.
  • FIG. 6 shows a schematic structural diagram of a computing device according to an embodiment of the present disclosure.
  • the specific embodiment of the present disclosure does not limit the specific implementation of the computing device.
  • the computing device may include: a processor 602, a communication interface 604, a memory 606, and a communication bus 608.
  • the processor 602, the communication interface 604, and the memory 606 communicate with each other through the communication bus 608.
  • the processor 602 is configured to execute the program 610, and may specifically execute relevant steps in the above screenshot processing method embodiments.
  • the program 610 may include program code, and the program code includes computer operation instructions.
  • the processor 602 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present disclosure.
  • the one or more processors included in the computing device may be processors of the same type, such as one or more CPUs, or may be processors of different types, such as one or more CPUs and one or more ASICs.
  • the memory 606 is used to store the program 610.
  • the memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one magnetic disk memory.
  • the program 610 may specifically be used to cause the processor 602 to perform the following operations:
  • the first layer element corresponding to the content to be removed in the current page determines whether there is a second layer element that satisfies the preset condition in the layer adjacent to the first layer element in the current page; wherein, The preset condition is: in the vertical direction of the page, the vertical projection area of the first layer element is located in the vertical projection area of the second layer element;
  • the content to be removed is covered to remove the content to be removed, and the processed page picture is obtained.
  • the second layer element is overlaid to the corresponding position of the page picture according to the position information of the second layer element to obtain the processed page picture.
  • program 610 may be further used to cause the processor 602 to perform the following operations:
  • the content to be removed is covered to obtain a processed page picture.
  • program 610 may be further used to cause the processor 602 to perform the following operations:
  • the second layer element is overwritten according to the position information of the second layer element To the corresponding position of the page picture, and then cover the third layer element to the corresponding position above the second layer element according to the position information of the third layer element to obtain the processed page picture.
  • the program 610 may be further specifically configured to cause the processor 602 to perform the following operation: if it is determined that the second layer element does not exist, it is determined that the current page is perpendicular to the first layer element on the page At least one fourth layer element with overlapping areas in the direction, the fourth layer element is a non-bottom layer element;
  • the at least one fourth layer element sequentially covers the corresponding position of the page picture to obtain the processed page picture.
  • the content to be removed is movable content in the current page.
  • the content to be removed is a playback progress bar.
  • modules in the device in the embodiment can be adaptively changed and set in one or more devices different from the embodiment.
  • the modules or units or components in the embodiments may be combined into one module or unit or component, and in addition, they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features or processes or units are mutually exclusive, any combination of all features disclosed in this specification (including the accompanying claims, abstract, and drawings), as well as any method or device disclosed in this way, can be used All processes or units are combined. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose.

Landscapes

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

Abstract

一种截图处理方法、计算设备及计算机存储介质,其中,方法包括:根据截图指令,截取得到当前页面的页面图片(S101);判断页面图片是否包含待去除内容(S102);若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素(S103);其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片(S104)。

Description

截图处理方法、计算设备及计算机存储介质
相关申请的交叉参考
本申请要求于2018年12月26日提交中国专利局、申请号为201811599988.2、名称为“截图处理方法、计算设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及图像处理技术领域,具体涉及一种截图处理方法、计算设备及计算机存储介质。
背景技术
在信息传递方面,图片往往比文字更加形象、生动,传递的信息也更为直观。在各网页页面、或终端应用页面中,随处可见的是通过图片传递的信息,甚至在各大应用的好友用户之间,也会通过图片来进行信息分享等。上述作为信息载体的图片中,有大量来源于页面截图,这些截图图片中包含了对应截图区域的完整内容,与此同时,也包含了部分无需呈现给用户的内容,例如,对播放界面进行截图后,得到的截图图片中包括播放进度条,该进度条用户并无法进行操作,则无需将该播放进度条呈现给用户。
现有技术,针对上述无需在截图图片中呈现的内容如何处理,是一个亟待解决的问题。
发明内容
鉴于上述问题,提出了本公开以便提供一种克服上述问题或者至少部分地解决上述问题的截图处理方法、计算设备及计算机存储介质。
根据本公开的一个方面,提供了一种截图处理方法,包括:
根据截图指令,截取得到当前页面的页面图片;
判断页面图片是否包含待去除内容;
若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域 位于第二图层元素的垂直投影区域内;
根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
根据本公开的另一方面,提供了一种计算设备,包括:处理器、存储器、通信接口和通信总线,处理器、存储器和通信接口通过通信总线完成相互间的通信;
存储器用于存放至少一可执行指令,可执行指令使处理器执行以下操作:
根据截图指令,截取得到当前页面的页面图片;
判断页面图片是否包含待去除内容;
若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
根据本公开的又一方面,提供了一种非易失性计算机可读存储介质,该非易失性计算机可读存储介质中存储有至少一可执行指令,可执行指令使处理器执行以下操作:
根据截图指令,截取得到当前页面的页面图片;
判断页面图片是否包含待去除内容;
若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
根据本公开的再一方面,还提供了一种计算机程序产品,该计算机程序产品包括存储在上述非易失性计算机可读存储介质上的计算机程序。
根据本公开的截图处理方法、计算设备及计算机存储介质,在截取得到 页面图片后,若判定出页面图片中包含待去除内容,则通过在当前页面中查找待去除内容对应的第一图层元素;然后,判断当前页面中是否存在第二图层元素,该第二图层元素与第一图层元素之间的特殊层级关系以及位置关系,使得仅利用该第二图层元素即可实现对待去除内容的完全覆盖;基于此,根据判断结果对待去除内容进行覆盖处理,则可以隐藏待去除内容的显示。由此可见,本公开的方案,在确定页面图片中包含待去除内容后,可以通过对待去除内容进行覆盖处理,以实现对待去除内容的隐藏,避免将该待去除内容呈现给用户;并且,依据当前页面中是否存在第二图层元素的判断结果,选择相应的图层元素来进行覆盖处理,而并不是直接对当前页面中的所有图层元素进行重排,简化了处理流程,提高了处理效率。
上述说明仅是本公开的技术方案的概述,为了能够更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为了让本公开的上述和其它目的、特征和优点能够更明显易懂,以下特举本公开的具体实施方式。
附图概述
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本公开的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本公开一个实施例的截图处理方法的流程图;
图2示出了根据本公开另一个实施例的截图处理方法的流程图;
图3示出了本公开一个具体实施例中的第二图层元素的示意图;
图4示出了另一个具体实施例中的至少一个第四图层元素的示意图;
图5示出了本公开另一个具体实施例中的第三图层元素的示意图;
图6示出了根据本公开实施例的一种计算设备的结构示意图。
本公开的较佳实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
图1示出了根据本公开一个实施例的截图处理方法的流程图。如图1所示,该方法包括:
步骤S101:根据截图指令,截取得到当前页面的页面图片。
其中,该截图指令可以是用户执行截图操作发起的,也可以是终端根据当前需求自动发起的,例如,用户点击分享页面按钮,终端则自动发起截图指令,以对当前页面进行截图。
具体地,根据截图指令对当前页面进行截图操作,得到页面图片。其中,截图指令可以为针对整个当前页面进行截图的指令,或者为针对当前页面的部分区域进行截图的指令,本公开对此不做具体限定。
步骤S102:判断页面图片是否包含待去除内容;若是,则执行步骤S103;若否,则本方法结束。
具体地,判断页面图片是否包含待去除内容,其中,待去除内容即为无需在页面图片中显示的内容。并且,本公开不对该步骤中判断的方式做具体限定,具体实施时,本领域技术人员可根据页面图片的图片内容以及作为页面图片来源的当前页面包含的页面元素中的至少一个进行灵活判断。
步骤S103:在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素。
其中,第一图层元素是指当前页面中包含待去除内容的图层元素。
本公开的目的在于隐藏待去除内容的显示,具体地,根据当前页面中各个图层元素的位置信息以及层级信息(即所在图层的信息),确定各个图层元素与第一图层元素之间的位置关系以及层级关系,然后据此判断当前页面中是否存在第二图层元素,以便根据判断结果确定针对待去除内容的覆盖处理策略。其中,第一图层元素和第二图层元素具有如下关系:其一,层级关系。第二图层元素位于第一图层元素的相邻图层,更详细地,第二图层元素在第一图层元素的下一层级。其二,位置关系。第二图层元素和第一图层元素之间满足预设条件,预设条件具体指在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内。换言之,第二图层元素在第一图层元素的下一层级,且第二图层元素完全“覆盖”第一图层元素,需要在此说明的是,此处的“覆盖”仅仅指垂直投影区域上的包含关系,而不是指层级之间的遮挡(例如上层覆盖下层)。
举例来说,第一图层元素位于另一图层元素的上一层级,且第一图层元素为位于屏幕正中心的一张矩形图片,另一图层元素为与屏幕等大的另一矩形图片,则可认为该另一图层元素完全“覆盖”第一图层元素。
步骤S104:根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
具体地,判断结果包括存在第二图层元素或不存在第二图层元素两种;当存在第二图层元素时,可以确定仅利用该第二图层元素即可实现对待去除内容的完全覆盖,当不存在第二图层元素时,可以确定需要利用第一图层元素之下的多个图层元素才能实现对待去除内容的完全覆盖,基于此,根据判断结果进行覆盖处理,以隐藏待去除内容在页面图片中的显示。
根据本实施例提供的截图处理方法,在截取得到页面图片后,若判定出页面图片中包含待去除内容,则通过在当前页面中查找待去除内容对应的第一图层元素;然后,判断当前页面中是否存在第二图层元素,该第二图层元素与第一图层元素之间的特殊层级关系以及位置关系,使得仅利用该第二图层元素即可实现对待去除内容的完全覆盖;基于此,根据判断结果对待去除内容进行覆盖处理,则可以隐藏待去除内容的显示。由此可见,本实施例方案,在确定页面图片中包含待去除内容后,可以通过对待去除内容进行覆盖处理,以实现对待去除内容的隐藏,避免将该待去除内容呈现给用户;并且,依据当前页面中是否存在第二图层元素的判断结果,选择相应的图层元素来进行覆盖处理,而并不是每次直接对当前页面中的所有图层元素进行重排,简化了处理流程,提高了处理效率。
图2示出了根据本公开另一个实施例的截图处理方法的流程图。如图2所示,该方法包括:
步骤S201:根据截图指令,截取得到当前页面的页面图片。
具体地,当接收到截图指令时,根据截图指令中指定的截图区域进行截图,截取得到当前页面中对应该截图区域的页面图片,例如,得到对应完整的当前页面的页面图片。
步骤S202:判断页面图片是否包含待去除内容。若是,则执行步骤S203;若否,则本方法结束。
其中,待去除内容为无需在页面图片中显示的内容。可选地,待去除内容为对应当前页面中具有可操作性的控件的内容,由于在截图得到的页面图 片中,用户并无法对页面图片中显示的控件执行任何操作,基于此,将页面图片中的相应控件确定为待去除内容。在一个具体的实施例中,待去除内容为当前页面中的可移动内容,可选地,该可移动内容为播放进度条,例如音频、视频等内容的播放进度条。
具体地,可在实施本实施例方案之前,预设待去除内容列表。在页面图片来源的当前页面中,将当前页面的截图区域中包含的各个页面元素与待去除内容列表进行匹配,若存在匹配成功的页面元素,则判定页面图片中包含待去除内容,即表明存在需要隐藏的待去除内容,则执行步骤S203,以采取隐藏显示措施;若否,即表明该页面图片中不存在需要隐藏显示的内容,则本方法结束。
步骤S203:在当前页面中查找待去除内容对应的第一图层元素。
其中,在当前页面中查找到的第一图层元素即为匹配成功的图层元素。
步骤S204:判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内。若是,则执行步骤S205;若否,则执行步骤S208。
其中,在当前页面中,从视觉层面而言,第二图层元素的部分元素内容被第一图层元素遮挡,同时,第一图层元素对应的区域被包含在第二图层元素对应的区域内。
具体地,首先通过查询当前页面的页面布局信息,得到各个图层元素的位置信息以及层级信息;然后,将各个图层元素的层级信息与第一图层元素的层级信息进行比较,根据比较结果确定相应的图层元素是否位于第一图层元素之下且相邻的图层;以及,将各个图层元素的位置信息与第一图层元素的位置信息进行比较,根据比较结果确定相应的图层元素是否完全“覆盖”第一图层元素。当上述两个确定过程的结果均为是时,则判定出当前页面中存在第二图层元素,此时,执行步骤S205,以根据该第二图层元素进行覆盖处理;当上述两个确定过程的结果不全为是时,则判定出当前页面中不存在第二图层元素,此时,则执行步骤S208,以根据多个与第一图层元素相关的图层元素进行覆盖。
图3示出了本公开一个具体实施例中的第二图层元素的示意图。如图3所示,待去除内容为音频播放进度控件,则当前页面中的第一图层元素为图 层元素32时,通过图层元素的位置信息以及层级信息的比较判断,确定图层元素31为第二图层元素;而图层元素33不满足完全“覆盖”图层元素32的条件,则该图层元素33不是第二图层元素。需要在此说明的是,图3中的当前页面的图层元素的数量、位置信息、或层级信息均为示例性的,具体实施时,本公开并不以此为限。例如,非第二图层元素的数量、位置信息、以及图层信息并不仅为图层元素33一种情况。以及,下文中的图4以及图5也同理。
步骤S205:判断当前页面中是否存在第三图层元素,其中,第三图层元素位于第二图层元素的上层,且第三图层元素与第二图层元素在页面垂直方向上具有重叠区域。若否,则执行步骤S206,若是,则执行步骤S207。
具体地,当判定出当前页面中存在第二图层元素时,则表明可以仅利用该第二图层元素来实现对待去除内容的覆盖。与此同时,图层之间的叠加会导致相应的页面元素之间的遮挡,其中,上层的图层元素会对与其具有重叠区域的下层的图层元素造成遮挡,例如,图3中的图层元素32会遮挡图层元素31的显示,基于此,为避免直接将第二图层元素覆盖至页面图片的相应位置而导致处理后的页面图片,相较于当前页面存在信息缺失的问题,进一步判断当前页面中是否存在第三图层元素,该第三图层元素可以理解为会被第二图层元素覆盖的图片内容对应的图层元素。
图5示出了本公开另一个具体实施例中的第三图层元素的示意图。与图3所不同的是,图5中存在位于图层元素3 1(即第二图层元素)的上层,且与图层元素3 1(即第二图层元素)在页面垂直方向上具有重叠区域的图层元素51(即第三图层元素),并且,在存在该第三图层元素时,显然不能仅利用第二图层元素进行覆盖处理,同时还得考虑该第三图层元素会被第二图层元素覆盖的问题。
进一步地,当判定出不存在第三图片元素时,则执行步骤S206,以仅利用第二图层元素进行覆盖处理;当判定出存在第三图层元素时,则执行步骤S207,以利用第二图层元素以及第三图层元素进行覆盖处理,进而确保页面图片传递的信息的完整性。
步骤S206:若判定出不存在第三图层元素,则根据第二图层元素的位置信息,将第二图层元素覆盖至页面图片的相应位置,得到处理后的页面图片。
具体地,若判定出不存在第三图层元素(图3示出的即为此种情况),则表明仅利用第二图层元素针对待去除内容进行覆盖处理,并不会造成对其 它需要显示的图片内容的遮挡,此时,则获取第二图层元素在当前页面中的位置信息,该位置信息可以为至少一个第二图层元素的边缘坐标信息;根据该位置信息,在页面图片中确定对应该位置信息的相应位置,然后将第二图层元素覆盖至该相应位置,进而将待去除内容完全覆盖,得到的处理后的页面图片中不再显示有待去除内容。
以图3为例,假设图层元素31的四个顶点(左上顶点、右上顶点、右下顶点、以及左下顶点)的坐标分别为(a1,b1),(a2,b2),(a3,b3),以及(a4,b4),则在页面图片中确定对应的坐标位置,并将图层元素31按照该对应的坐标位置进行覆盖。
经过该步骤,可以仅利用第二图层元素对页面图片中的待去除内容进行覆盖,隐藏该待去除内容的显示,以及,无需利用多个图层元素进行覆盖处理,使得处理的过程更加简单高效。
步骤S207:若判定出存在第三图层元素,则根据第一图层元素和第三图层元素的层级信息,对待去除内容进行覆盖处理,得到处理后的页面图片。
具体地,若判定出存在第三图层元素(图5示出的即为此种情况),则表明需要同时提取出第二图层元素和第三图层元素来进行覆盖处理,才能在实现隐藏待去除内容的显示的同时,确保处理后的页面图片传递的信息的完整性。
进一步地,由于第二图层元素位于第一图层元素之下、且相邻的图层,并且,第三图层元素位于第二图层元素之上的图层,则第一图层元素和第三图层元素的层级信息具体为第三图层元素位于第一图层元素的上层、或者第三图层元素与第一图层元素属于同一层。相应地,覆盖处理的过程具体为:当第三图层元素位于第一图层元素的上层、或者第三图层元素与第一图层元素属于同一层时,首先根据第二图层元素的位置信息,将第二图层元素覆盖至页面图片的相应位置,也即:首先利用位于下层的第二图层元素针对待去除内容进行覆盖处理,已完成对待去除内容的遮挡,进而隐藏待去除内容的显示。然后根据第三图层元素的位置信息,将第三图层元素覆盖至第二图层元素之上的相应位置,得到处理后的页面图片,也即:在对待去除内容进行遮挡的基础上,进一步将被第二图层元素遮挡的其它需要显示的内容覆盖至页面图片中的第二图层元素之上,以使最终得到的页面图片中传递的信息与当前页面传递的信息的一致。
以图5为例,第三图层元素为图层元素51,进行覆盖处理的过程具体如 下:首先根据图层元素31在当前页面中的位置信息,将图层元素31覆盖至页面图片的相应位置,完成对页面图片中的播放进度条的遮挡;然后,根据图层元素51在当前页面中的位置信息,将图层元素51覆盖至页面图片中图层元素31之上的相应位置,使图层元素51的元素内容可以显示在页面图片中。需要在此说明的是,图5的举例中虽然仅以第三图层元素为一个时进行了说明,但是具体实施时,若第三图层元素为多个,针对每个第三图层元素,均需执行上述的修正处理。
经过本步骤,可以在利用第二图层元素对页面图片中的待去除内容进行覆盖处理后,进一步利用第三图层元素进行覆盖处理,以确保页面图片传递的信息的完整性。
上述步骤S205至步骤S207均是针对当前页面中存在完全“覆盖”第一图层元素的第二图层元素的情况,进行覆盖处理的说明。下述步骤S208至步骤S209则是针对当前页面中不存在第二图层元素的情况进行的覆盖处理的说明。
步骤S208:若判定出不存在第二图层元素,则确定当前页面中与第一图层元素在页面垂直方向上具有重叠区域的至少一个第四图层元素。
具体地,当判定出不存在第二图层元素时,即与第一图层元素相邻的图层中不存在能够完全“覆盖”第一图层元素的图层元素,则需在当前页面中确定与第一图层元素相关的图层元素(即至少一个第四图层元素),以利用该相关的图层元素隐藏待去除内容的显示。并且,为了在经过覆盖处理后可以完全隐藏待去除内容的显示,通过如下方式确定该相关的图层元素:从第一图层元素下层的、与第一图层元素相邻的图层开始,由上至下依次查找各个图层的图层元素,直至查找到的多个图层元素满足预设终止条件则停止查找,并将停止时查找到的多个图层元素确定为至少一个第四图层元素;其中,预设终止条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于至少一个第四图层元素的垂直投影区域内。
图4示出了另一个具体实施例中的至少一个第四图层元素的示意图。如图4所示,与图3不同的是,图4中与图层元素32(即第一图层元素)相邻的图层中的图层元素41未完全“覆盖”图层元素32,即不存在第二图层元素的情况,此时,则从图层元素41所在的图层开始,向下查找各个图层的图层元素,则首先查找到图层元素41,显然图层元素32的垂直投影并不能完全落在图层元素41的垂直投影的区域内,不满足预设终止条件;继续往 下查找,查找到图层元素31,图层元素32的垂直投影落在了图层元素41和图层元素31(为查找到的两个图层元素)的垂直投影共同构成的区域内,满足预设终止条件,则停止查找,并将查找到的图层元素41和图层元素31确定为至少一个第四图层元素。需要说明的是,可根据图层元素33的层级信息确定其是否为至少一个第四图层元素,例如,若图层元素33在图层元素31的下层,当还未查找到图层元素33时已满足预设终止条件,则图层元素33不是第一图层元素。
另外,页面的底层通常为背景图层,一般而言,在查找至少一个第四图层的过程中,满足预设终止条件时并未查找到该底层,相应的,在一些可选的实施例中,至少一个第四图层元素为非底层元素。
经过本步骤,可确定至少一个第四图层元素,由于至少一个第一图层元素是按照图层信息由上至下进行查找、并且满足预设终止条件则停止查找而找到的图层元素,则该至少一个第四图层元素通常仅为当前页面中的部分图层元素,而非全部的图层元素。
步骤S209:根据至少一个第四图层元素的位置信息以及层级信息,按照从下层到上层的顺序,依次将至少一个第四图层元素覆盖页面图片的相应位置,得到处理后的页面图片。
具体地,按照至少一个第四图层元素的层级信息由下至上的顺序,依次选择第四图层元素;并将该选择的第四图层元素根据其在当前页面中的位置信息,将其覆盖至页面图片中,得到处理后的页面图片。
以图4为例,在确定了图层元素41和图层元素41为至少一个第四图层元素后,按照图层信息由下至上的顺序(图层元素31在图层元素41之下),则先将图层元素31根据其位置信息覆盖至页面图片中,然后将图层元素41根据其位置信息覆盖至页面图片中,进而实现了对图层元素32的完全遮挡,而且按照图层信息由下至上的顺序进行覆盖,可以使处理后的页面图片避免因图层覆盖混乱而导致显示的信息不准确。
经过本步骤,利用至少一个第四图层元素进行覆盖,以完成对待去除内容的完全遮挡;同时,至少一个第四图层元素通常仅为当前页面的一部分图层元素,而非全部的图层元素,则可以减少覆盖处理的数据处理量;并且,按照层级信息由下至上进行覆盖处理,可以使处理后的页面图片传递准确的信息;另外,将满足预设终止条件时,查找到的所有图层元素确定为至少一个第四图层元素,进而可以避免处理后的页面图片中出现信息缺失的问题。
根据本实施例提供的截图处理方法,根据判断得到的当前页面中是否存在第二图层元素的结果不同,确定相应的覆盖处理策略。当当前页面中存在第二图层元素时,需要进一步根据第二图层元素与其它图层元素的重叠情况,判断当前页面中是否存在第三图层元素,若不存在第三图层元素,则仅利用第二图层元素进行覆盖处理,即可完成对页面图片中的待去除内容的遮挡;若存在第三图层元素,则需利用第三图层元素和第二图层元素进行覆盖处理,以在完成对待去除内容的遮挡的同时,确保页面图片传递的信息的完整性;当当前页面中不存在第二图层元素时,则通过确定至少一个第四图层元素,并利用该至少一个第四图层元素进行覆盖处理,以完成对待去除内容的遮挡,同时确保图片信息传递的完整性以及准确性。由此可见,本实施例方案,可以仅利用一部分的图层元素完成对待去除内容的遮挡,达到隐藏待去除内容的显示的目的;同时,相较于所有图层元素重排的方式,本实施例方案的处理效率更高;而且,本实施例方案在完成待去除内容的隐藏显示的同时,还确保了图片信息传递的完整性以及准确性。
本公开实施例提供了一种非易失性计算机可读存储介质,该非易失性计算机可读存储介质存储有至少一可执行指令,该计算机可执行指令可执行上述任意方法实施例中的截图处理方法。
可执行指令具体可以用于使得处理器执行以下操作:
根据截图指令,截取得到当前页面的页面图片;
判断页面图片是否包含待去除内容;
若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
在一种可选的实施方式中,可执行指令进一步使所述处理器执行以下操作:
若判定出存在第二图层元素,则判断当前页面中是否存在第三图层元素,其中,第三图层元素位于第二图层元素的上层,且第三图层元素与第二图层元素在页面垂直方向上具有重叠区域;
若判定出不存在所述第三图层元素,则根据第二图层元素的位置信息,将第二图层元素覆盖至页面图片的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,可执行指令进一步使所述处理器执行以下操作:
若判定出存在第三图层元素,则根据第一图层元素和第三图层元素的层级信息,对待去除内容进行覆盖处理,得到处理后的页面图片。在一种可选的实施方式中,可执行指令进一步使处理器执行以下操作:
当第三图层元素位于第一图层元素的上层、或者第三图层元素与第一图层元素属于同一层时,则根据第二图层元素的位置信息,将第二图层元素覆盖至页面图片的相应位置,然后根据第三图层元素的位置信息,将第三图层元素覆盖至第二图层元素之上的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,可执行指令进一步使处理器执行以下操作:
若判定出不存在第二图层元素,则确定当前页面中与第一图层元素在页面垂直方向上具有重叠区域的至少一个第四图层元素,第四图层元素为非底层元素;
根据至少一个第四图层元素的位置信息以及层级信息,按照从下层到上层的顺序,依次将至少一个第四图层元素覆盖页面图片的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,待去除内容为当前页面中的可移动内容。
在一种可选的实施方式中,其中,待去除内容为播放进度条。
图6示出了根据本公开实施例的一种计算设备的结构示意图,本公开具体实施例并不对计算设备的具体实现做限定。
如图6所示,该计算设备可以包括:处理器(processor)602、通信接口(Communications Interface)604、存储器(memory)606、以及通信总线608。
其中:
处理器602、通信接口604、以及存储器606通过通信总线608完成相互间的通信。
通信接口604,用于与其它设备比如客户端或其它服务器等的网元通信。
处理器602,用于执行程序610,具体可以执行上述截图处理方法实施例中的相关步骤。
具体地,程序610可以包括程序代码,该程序代码包括计算机操作指令。
处理器602可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本公开实施例的一个或多个集成电路。计算设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。
存储器606,用于存放程序610。存储器606可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
程序610具体可以用于使得处理器602执行以下操作:
根据截图指令,截取得到当前页面的页面图片;
判断页面图片是否包含待去除内容;
若是,则在当前页面中查找待去除内容对应的第一图层元素;判断当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,预设条件为:在页面垂直方向上,第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
根据判断结果对待去除内容进行覆盖处理,以去除待去除内容,得到处理后的页面图片。
在一种可选的实施方式中,程序610具体可以进一步用于使得处理器602执行以下操作:
若判定出存在第二图层元素,则判断当前页面中是否存在第三图层元素,其中,第三图层元素位于第二图层元素的上层,且第三图层元素与第二图层元素在页面垂直方向上具有重叠区域;
若判定出不存在第三图层元素,则根据第二图层元素的位置信息,将第二图层元素覆盖至页面图片的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,程序610具体可以进一步用于使得处理器602执行以下操作:
若判定出存在第三图层元素,则根据第一图层元素和第三图层元素的层级信息,对待去除内容进行覆盖处理,得到处理后的页面图片。
在一种可选的实施方式中,程序610具体可以进一步用于使得处理器602 执行以下操作:
当第三图层元素位于第一图层元素的上层、或者第三图层元素与第一图层元素属于同一层时,则根据第二图层元素的位置信息,将第二图层元素覆盖至所述页面图片的相应位置,然后根据第三图层元素的位置信息,将第三图层元素覆盖至第二图层元素之上的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,程序610具体可以进一步用于使得处理器602执行以下操作:若判定出不存在第二图层元素,则确定当前页面中与第一图层元素在页面垂直方向上具有重叠区域的至少一个第四图层元素,第四图层元素为非底层元素;
根据至少一个第四图层元素的位置信息以及层级信息,按照从下层到上层的顺序,依次将至少一个第四图层元素覆盖页面图片的相应位置,得到处理后的页面图片。
在一种可选的实施方式中,待去除内容为所述当前页面中的可移动内容。
在一种可选的实施方式中,其中,待去除内容为播放进度条。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本公开也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本公开的内容,并且上面对特定语言所做的描述是为了披露本公开的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本公开的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个公开方面中的一个或多个,在上面对本公开的示例性实施例的描述中,本公开的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本公开要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如权利要求书所反映的那样,公开方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本公开的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本公开的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
应该注意的是上述实施例对本公开进行说明而不是对本公开进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本公开可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。

Claims (16)

  1. 一种截图处理方法,包括:
    根据截图指令,截取得到当前页面的页面图片;
    判断所述页面图片是否包含待去除内容;
    若是,则在所述当前页面中查找所述待去除内容对应的第一图层元素;判断所述当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,所述预设条件为:在页面垂直方向上,所述第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
    根据判断结果对所述待去除内容进行覆盖处理,以去除所述待去除内容,得到处理后的页面图片。
  2. 根据权利要求1所述的方法,其中,所述根据判断结果对所述待去除内容进行覆盖处理,得到处理后的页面图片进一步包括:
    若判定出存在第二图层元素,则判断所述当前页面中是否存在第三图层元素,其中,所述第三图层元素位于所述第二图层元素的上层,且所述第三图层元素与第二图层元素在页面垂直方向上具有重叠区域;
    若判定出不存在所述第三图层元素,则根据所述第二图层元素的位置信息,将所述第二图层元素覆盖至所述页面图片的相应位置,得到处理后的页面图片。
  3. 根据权利要求2所述的方法,其中,所述根据判断结果对所述待去除内容进行覆盖处理,得到处理后的页面图片还包括:
    若判定出存在所述第三图层元素,则根据所述第一图层元素和第三图层元素的层级信息,对所述待去除内容进行覆盖处理,得到处理后的页面图片。
  4. 根据权利要求3所述的方法,其中,所述根据所述第一图层元素和第三图层元素的层级信息,对所述待去除内容进行覆盖处理,得到处理后的页面图片进一步包括:
    当所述第三图层元素位于第一图层元素的上层、或者所述第三图层元素与所述第一图层元素属于同一层时,则根据所述第二图层元素的位置信息,将所述第二图层元素覆盖至所述页面图片的相应位置,然后根据所述第三图层元素的位置信息,将所述第三图层元素覆盖至所述第二图层元素之上的相应位置,得到处理后的页面图片。
  5. 根据权利要求1所述的方法,其中,所述根据判断结果对所述待去除内容进行覆盖处理,得到处理后的页面图片进一步包括:
    若判定出不存在第二图层元素,则确定所述当前页面中与第一图层元素在页面垂直方向上具有重叠区域的至少一个第四图层元素,所述第四图层元素为非底层元素;
    根据所述至少一个第四图层元素的位置信息以及层级信息,按照从下层到上层的顺序,依次将所述至少一个第四图层元素覆盖所述页面图片的相应位置,得到处理后的页面图片。
  6. 根据权利要求1-5任一项所述的方法,其中,所述待去除内容为所述当前页面中的可移动内容。
  7. 根据权利要求1-6任一项所述的方法,其中,所述待去除内容为播放进度条。
  8. 一种计算设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;
    所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行以下操作:
    根据截图指令,截取得到当前页面的页面图片;
    判断所述页面图片是否包含待去除内容;
    若是,则在所述当前页面中查找所述待去除内容对应的第一图层元素;判断所述当前页面中与第一图层元素相邻的图层中是否存在满足预设条件的第二图层元素;其中,所述预设条件为:在页面垂直方向上,所述第一图层元素的垂直投影区域位于第二图层元素的垂直投影区域内;
    根据判断结果对所述待去除内容进行覆盖处理,以去除所述待去除内容,得到处理后的页面图片。
  9. 根据权利要求8所述的计算设备,其中,所述可执行指令进一步使所述处理器执行以下操作:若判定出存在第二图层元素,则判断所述当前页面中是否存在第三图层元素,其中,所述第三图层元素位于所述第二图层元素的上层,且所述第三图层元素与第二图层元素在页面垂直方向上具有重叠区域;
    若判定出不存在所述第三图层元素,则根据所述第二图层元素的位置信息,将所述第二图层元素覆盖至所述页面图片的相应位置,得到处理后的页面图片。
  10. 根据权利要求9所述的计算设备,所述可执行指令进一步使所述处理器执行以下操作:
    若判定出存在所述第三图层元素,则根据所述第一图层元素和第三图层元素的层级信息,对所述待去除内容进行覆盖处理,得到处理后的页面图片。
  11. 根据权利要求10所述的计算设备,所述可执行指令进一步使所述处理器执行以下操作:
    当所述第三图层元素位于第一图层元素的上层、或者所述第三图层元素与所述第一图层元素属于同一层时,则根据所述第二图层元素的位置信息,将所述第二图层元素覆盖至所述页面图片的相应位置,然后根据所述第三图层元素的位置信息,将所述第三图层元素覆盖至所述第二图层元素之上的相应位置,得到处理后的页面图片。
  12. 根据权利要求8所述的计算设备,所述可执行指令进一步使所述处理器执行以下操作:
    若判定出不存在第二图层元素,则确定所述当前页面中与第一图层元素在页面垂直方向上具有重叠区域的至少一个第四图层元素,所述第四图层元素为非底层元素;
    根据所述至少一个第四图层元素的位置信息以及层级信息,按照从下层到上层的顺序,依次将所述至少一个第四图层元素覆盖所述页面图片的相应位置,得到处理后的页面图片。
  13. 根据权利要求8-12所述的计算设备,所述待去除内容为所述当前页面中的可移动内容。
  14. 根据权利要求8-13任一项所述的计算设备,其中,所述待去除内容为播放进度条。
  15. 一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质中存储有至少一可执行指令,所述可执行指令用于使处理器执行前述任一权利要求1-7所述的截图处理方法。
  16. 一种计算机程序产品,该计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,该计算机程序包括程序指令,当该程序指令被计算机执行时,使该计算机执行前述任一权利要求1-7所述的截图处理方法。
PCT/CN2019/119261 2018-12-26 2019-11-18 截图处理方法、计算设备及计算机存储介质 WO2020134708A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/418,363 US11593981B2 (en) 2018-12-26 2019-11-18 Method for processing a screenshot image, electronic device and computer storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811599988.2 2018-12-26
CN201811599988.2A CN109710362B (zh) 2018-12-26 2018-12-26 截图处理方法、计算设备及计算机存储介质

Publications (1)

Publication Number Publication Date
WO2020134708A1 true WO2020134708A1 (zh) 2020-07-02

Family

ID=66257720

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119261 WO2020134708A1 (zh) 2018-12-26 2019-11-18 截图处理方法、计算设备及计算机存储介质

Country Status (3)

Country Link
US (1) US11593981B2 (zh)
CN (1) CN109710362B (zh)
WO (1) WO2020134708A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710362B (zh) 2018-12-26 2020-02-07 掌阅科技股份有限公司 截图处理方法、计算设备及计算机存储介质
CN111459590A (zh) * 2020-03-31 2020-07-28 联想(北京)有限公司 一种截图处理方法及电子设备
CN111880776A (zh) * 2020-07-31 2020-11-03 北京爱奇艺科技有限公司 一种层级关系获得方法、装置及电子设备
CN112100978B (zh) * 2020-09-16 2022-07-08 掌阅科技股份有限公司 基于电子书的排版处理方法、电子设备及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9083990B2 (en) * 2013-04-26 2015-07-14 Zhongshan Innocloud Intellectual Property Services Co., Ltd. Electronic device and method for managing video snapshot
WO2016078390A1 (zh) * 2014-11-21 2016-05-26 中兴通讯股份有限公司 一种截图图像输出方法、装置及存储介质
CN106168872A (zh) * 2016-06-23 2016-11-30 珠海市魅族科技有限公司 截屏方法和装置
CN106569700A (zh) * 2016-11-15 2017-04-19 珠海市魅族科技有限公司 一种截图方法以及截图装置
CN106791022A (zh) * 2016-11-30 2017-05-31 努比亚技术有限公司 一种移动终端及截图方法
CN106775298A (zh) * 2016-11-28 2017-05-31 北京小米移动软件有限公司 截图的处理方法及装置
CN107357505A (zh) * 2017-07-26 2017-11-17 北京小米移动软件有限公司 屏幕截图的方法、装置及计算机可读存储介质
CN109710362A (zh) * 2018-12-26 2019-05-03 掌阅科技股份有限公司 截图处理方法、计算设备及计算机存储介质

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8891939B2 (en) * 2009-12-22 2014-11-18 Citrix Systems, Inc. Systems and methods for video-aware screen capture and compression
CN103399640B (zh) * 2013-08-16 2017-01-25 贝壳网际(北京)安全技术有限公司 根据用户手势进行控制的方法、装置和客户端
CN103715627A (zh) * 2013-12-19 2014-04-09 国家电网公司 一种分图层的配电开关站图样式
CN105607792A (zh) * 2014-11-21 2016-05-25 南京酷派软件技术有限公司 一种分层截图的方法、装置及终端
CN105892839B (zh) * 2015-01-26 2019-10-08 腾讯科技(深圳)有限公司 一种基于即时通信工具的截图处理方法和装置
WO2016123266A1 (en) * 2015-01-27 2016-08-04 Twitter, Inc. Capture and sharing of video contents
CN105719240B (zh) * 2016-01-21 2019-01-08 腾讯科技(深圳)有限公司 图片处理的方法和装置
CN105912209B (zh) * 2016-04-11 2019-04-12 珠海市魅族科技有限公司 图像显示方法及装置
CN106814932A (zh) * 2016-11-29 2017-06-09 深圳市金立通信设备有限公司 一种桌面壁纸显示方法及终端
CN106651757A (zh) * 2016-12-02 2017-05-10 天脉聚源(北京)传媒科技有限公司 一种裁剪图片的方法及装置
CN107145795B (zh) * 2017-04-28 2020-08-18 Oppo广东移动通信有限公司 截图方法、装置及计算机设备
CN108319484B (zh) * 2017-05-17 2021-07-09 腾讯科技(深圳)有限公司 一种应用页面的处理方法、装置及存储介质
CN108153468A (zh) * 2017-12-14 2018-06-12 阿里巴巴集团控股有限公司 图片处理方法及装置
CN109085965B (zh) * 2018-07-19 2019-09-06 掌阅科技股份有限公司 笔记生成方法、电子设备及计算机存储介质
CN109033466B (zh) * 2018-08-31 2019-12-03 掌阅科技股份有限公司 页面分享方法、计算设备及计算机存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9083990B2 (en) * 2013-04-26 2015-07-14 Zhongshan Innocloud Intellectual Property Services Co., Ltd. Electronic device and method for managing video snapshot
WO2016078390A1 (zh) * 2014-11-21 2016-05-26 中兴通讯股份有限公司 一种截图图像输出方法、装置及存储介质
CN106168872A (zh) * 2016-06-23 2016-11-30 珠海市魅族科技有限公司 截屏方法和装置
CN106569700A (zh) * 2016-11-15 2017-04-19 珠海市魅族科技有限公司 一种截图方法以及截图装置
CN106775298A (zh) * 2016-11-28 2017-05-31 北京小米移动软件有限公司 截图的处理方法及装置
CN106791022A (zh) * 2016-11-30 2017-05-31 努比亚技术有限公司 一种移动终端及截图方法
CN107357505A (zh) * 2017-07-26 2017-11-17 北京小米移动软件有限公司 屏幕截图的方法、装置及计算机可读存储介质
CN109710362A (zh) * 2018-12-26 2019-05-03 掌阅科技股份有限公司 截图处理方法、计算设备及计算机存储介质

Also Published As

Publication number Publication date
CN109710362A (zh) 2019-05-03
US20220051460A1 (en) 2022-02-17
US11593981B2 (en) 2023-02-28
CN109710362B (zh) 2020-02-07

Similar Documents

Publication Publication Date Title
WO2020134708A1 (zh) 截图处理方法、计算设备及计算机存储介质
US9578248B2 (en) Method for generating thumbnail image and electronic device thereof
US8339399B2 (en) Declustering point-of-interest icons
CN109542382B (zh) 手写输入内容的显示方法、电子设备及计算机存储介质
WO2016101717A1 (zh) 基于触摸交互的搜索方法及装置
WO2017107654A1 (zh) 一种页面入口图标的显示方法及装置
JP5779085B2 (ja) 情報処理装置、画面出力システム、画面出力制御方法およびプログラム
WO2017032233A1 (zh) 一种图像生成方法及装置
JP7453471B2 (ja) ピクチャ処理方法、装置、デバイス及び記憶媒体
WO2020001022A1 (zh) 图片展示方法、计算设备及计算机存储介质
CN110333919B (zh) 一种呈现社交对象信息的方法与设备
JP2015170343A (ja) 画像表示装置および画像表示方法
US20140325409A1 (en) Active & Efficient Monitoring of a Graphical User Interface
WO2015161809A1 (en) Picture splitting method and apparatus, and picture loading method and apparatus
US20150227291A1 (en) Information processing method and electronic device
TWI470577B (zh) 重疊物件的繪製方法及裝置
WO2019036895A1 (en) GENERATING USER EXPERIENCE IN THREE DIMENSIONS BASED ON TWO-DIMENSIONAL MEDIA CONTENT
US9613288B2 (en) Automatically identifying and healing spots in images
US10534505B2 (en) Technique for preventing unnecessary overlap of user interfaces
WO2015090242A1 (zh) 一种定位图片列表中图片的方法和装置
US11621000B2 (en) Systems and methods for associating a voice command with a search image
US11782850B2 (en) Information processing method, server, terminal, and computer storage medium
EP3210101B1 (en) Hit-test to determine enablement of direct manipulations in response to user actions
WO2016101768A1 (zh) 终端以及基于触摸操作的搜索方法和装置
US10296185B2 (en) Viewing selected zoomed content

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: 19902908

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19902908

Country of ref document: EP

Kind code of ref document: A1