WEB webpage photographing implementation method and device
By calling the interface in the browser to obtain the camera device and displaying the video screen stream, combined with the screenshot function of the photo button, the imaging quality loss, rendering lag and installation of the web page photo function in the prior art is solved, and the plug-in-free high-definition photo shooting function is realized.
Patent Information
- Application Number
- CN202510375682.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-24
AI Technical Summary
In the prior art, the WEB web photography function has cumbersome problems with the imaging quality due to the loss of the size of the canvas element, the insufficient video frame rate, and the need to install a camera application or plug-in.
By calling the browser interface, obtaining the terminal-connected camera device, and adding the video screen stream information of the camera device to the Video element to display; by calling the browser interface to save the screenshot of the current display screen of the Video element, realizing the photo function without installing applications or plug-ins.
It realizes the imaging quality of high-definition display, supports video clarity restoration of high-definition video streams, and does not require installation of applications or plug-ins, making it more convenient to use and better experience.
Smart Images

Figure CN120201287A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a method and device for implementing web page photography. Background Art
[0002] The web page photography function refers to the function of taking photos of people, documents, certificates or other items that need to generate images through the website to control the camera connected to the computer. Usually, the website photography requires the installation of the corresponding external camera application or plug-in, and the website function performs the photography function by accessing the camera application or plug-in interface; or first use the camera device to take photos, save the photos to the local computer, and then upload the local computer photos to the website through the website photo upload function.
[0003] In the prior art, a web page controls the camera by calling the application or plug-in interface installed on the camera through a browser, rendering the camera image in real time onto a canvas element, displaying the camera display screen through the canvas element, and then taking pictures by controlling the camera. This method has several disadvantages: first, the image quality will be lost due to the size of the canvas element; second, when the image quality is high but the frame rate of the video displayed by the canvas element is not enough, the rendered display screen will be stuck; third, the corresponding camera application or plug-in needs to be installed, which is cumbersome to use.
[0004] The existing technology has the following problems: first, the image quality will be affected by the size of the canvas element; second, when the image quality is high but the frame rate of the canvas element display video is insufficient, the rendered display screen will be stuck; third, changing different camera devices requires installing the corresponding camera application or plug-in, which is cumbersome to use.
[0005] In summary, the current web page photography function requires the installation of a camera device plug-in or application, and each time a camera device is changed, a plug-in or application needs to be installed, which is very troublesome. Therefore, how to solve the problem of using the web page to take photos without installing a camera device application or plug-in on the computer, and avoiding the cumbersome process of changing a device to install a plug-in or application is a technical problem that needs to be solved urgently. Summary of the invention
[0006] The purpose of the present invention is to provide a method and device for realizing web page photography, aiming to solve the above-mentioned problems in the prior art.
[0007] The present invention provides a method for realizing web page photography, comprising:
[0008] Get the camera device connected to the terminal by calling the browser interface, transmit the camera device to the browser screen and display it in the Video element;
[0009] The current display screen of the Video element is captured and saved by calling the browser interface through the photo-taking button.
[0010] The present invention provides a device for realizing WEB page photo-taking, including:
[0011] A calling module, configured to obtain the camera device connected to the terminal by calling the browser interface, transmit the camera device to the picture in the browser, and display it in the Video element;
[0012] A saving module, configured to capture and save the current display screen of the Video element by calling the browser interface through the photo-taking button.
[0013] An embodiment of the present invention further provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above WEB page photo-taking implementation method are realized.
[0014] An embodiment of the present invention further provides a computer-readable storage medium, on which an implementation program for information transmission is stored. When the program is executed by a processor, the steps of the above WEB page photo-taking implementation method are realized.
[0015] By adopting the embodiment of the present invention, the imaging restores the picture quality according to the video clarity of the video stream, supports high-definition display; and there is no need to install an application or a plug-in, which is more convenient to use and has a better user experience. Description of the Drawings
[0016] In order to more clearly illustrate the technical solutions in one or more embodiments of this specification or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 is a flowchart of the WEB page photo-taking implementation method according to an embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of the WEB page photo-taking implementation method according to an embodiment of the present invention;
[0019] Figure 3 is a detailed flowchart of the WEB page photo-taking implementation method according to an embodiment of the present invention;
[0020] Figure 4 is a schematic diagram of the WEB page photo-taking implementation device according to an embodiment of the present invention;
[0021] Figure 5 It is a schematic diagram of the electronic device according to an embodiment of the present invention. Detailed implementation manners
[0022] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will clearly and completely describe the technical solutions in one or more embodiments of this specification with reference to the accompanying drawings in one or more embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this document.
[0023] Method embodiments
[0024] According to an embodiment of the present invention, a method for realizing WEB page photographing is provided. Figure 1 It is a flowchart of the method for realizing WEB page photographing according to an embodiment of the present invention, as Figure 1 shown. The method for realizing WEB page photographing according to an embodiment of the present invention specifically includes:
[0025] Step S101, obtain the camera device connected to the terminal by calling the browser interface, and transmit the camera device to the screen of the browser and display it in the Video element; specifically, the terminal is connected to the camera device, the website is initialized, and media access authorization is performed by calling the browser interface. After the media access authorization is passed, by calling the browser interface, the video frame stream information of the obtained camera device is added to the Video element for display.
[0026] Wherein, the camera device includes: the camera of the terminal itself, or a camera device externally connected through USB.
[0027] Step S101, save a screenshot of the current display screen of the Video element by calling the browser interface through the photographing button. Specifically, the photographing button takes a screenshot of the current video information displayed in the Video element by calling the browser interface, and downloads the picture information to the local or uploads it to the file server.
[0028] The above technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0029] As Figure 2As shown in the figure, in the technical solution of the embodiment of the present invention, the computer terminal is in the left square box, and the camera device is in the right small square box. The camera device is connected to the computer through USB. After the connection, the computer accesses the website through the browser. The website obtains the camera device connected through USB by calling the browser interface. The website displays the picture of the camera device transmitted to the browser in the Video element through the browser interface. The current displayed picture of the Video is captured and saved locally or uploaded to the file server by calling the browser interface through the photo-taking button.
[0030] As Figure 3 shown, the processing flow of the website displaying the camera picture and the processing flow of the photo-taking button function are shown. Specifically:
[0031] 1. Start connecting the camera device;
[0032] 2. The website initializes and performs media access authorization by calling the browser interface;
[0033] 3. After authorization, the obtained video picture stream information is added to the Video media element for display by calling the browser interface;
[0034] 4. The photo-taking button captures the current displayed video information by calling the browser interface;
[0035] 5. After downloading the picture information to the local or uploading it to the file server, the process ends.
[0036] Adopting the technical solution of the embodiment of the present invention, the imaging restores the picture quality according to the video clarity of the video stream, supports high-definition display; and there is no need to install an application or plug-in, which is more convenient to use and has a better user experience.
[0037] Device Embodiment 1
[0038] According to the embodiment of the present invention, a device for realizing WEB page photographing is provided. Figure 4 is a schematic diagram of the device for realizing WEB page photographing according to the embodiment of the present invention. As Figure 4 shown, the device for realizing WEB page photographing according to the embodiment of the present invention specifically includes:
[0039] A calling module 40, which is used to obtain the camera device connected to the terminal by calling the browser interface, and transmit the camera device to the picture in the browser and display it in the Video element; specifically used for:
[0040] The terminal connects the camera device, the website initializes, and performs media access authorization by calling the browser interface. After the media access authorization is passed, the obtained video picture stream information of the camera device is added to the Video element for display by calling the browser interface.
[0041] Among them, the camera device includes: the camera of the terminal itself, or a camera device externally connected through USB.
[0042] The saving module 42 is used to call the browser interface through the photographing button to save the screenshot of the current display screen of the Video element. Specifically, it is used for:
[0043] The photographing button takes a screenshot of the video information currently displayed by the Video element through calling the browser interface, and downloads the picture information to the local or uploads it to the file server.
[0044] The embodiment of the present invention is a device embodiment corresponding to the above method embodiment. The specific operations of each module can be understood with reference to the description of the method embodiment, and will not be elaborated here.
[0045] Device Embodiment Two
[0046] The embodiment of the present invention provides an electronic device, as Figure 5 shown, including: a memory 50, a processor 52, and a computer program stored on the memory 50 and operable on the processor 52. When the computer program is executed by the processor 52, the steps described in the method embodiment are implemented.
[0047] Device Embodiment Three
[0048] The embodiment of the present invention provides a computer-readable storage medium. An implementation program for information transmission is stored on the computer-readable storage medium. When the program is executed by the processor 52, the steps described in the method embodiment are implemented.
[0049] The computer-readable storage medium described in this embodiment includes but is not limited to: ROM, RAM, magnetic disk, optical disc, etc.
[0050] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for taking photos on a web page, characterized in that: include: Get the camera device connected to the terminal by calling the browser interface, transmit the camera device to the browser screen and display it in the Video element; Use the camera button to call the browser interface to save a screenshot of the current display screen of the Video element.
2. The method according to claim 1, characterized in that: The camera device connected to the terminal is obtained by calling the browser interface, and the camera device is transmitted to the browser screen and displayed in the Video element. Specifically, it includes: The terminal connects to the camera device, the website is initialized, and media access authorization is performed by calling the browser interface. After the media access authorization is passed, the video screen stream information of the camera device is added to the Video element for display by calling the browser interface.
3. The method according to claim 1, characterized in that Using the camera button to call the browser interface to save a screenshot of the current display screen of the Video element includes: The camera button takes a screenshot of the video information currently displayed by the Video element by calling the browser interface, and downloads the image information to the local computer or uploads it to a file server.
4. The method according to claim 1, characterized in that: The camera device includes: a camera of the terminal itself, or a camera device connected externally via USB.
5. A device for realizing web page photography, characterized in that: include: The calling module is used to obtain the camera device connected to the terminal by calling the browser interface, and transmit the camera device to the browser screen and display it in the Video element; The saving module is used to call the browser interface through the camera button to save a screenshot of the current display screen of the Video element.
6. The device according to claim 5, characterized in that The calling module is specifically used for: The terminal connects to the camera device, the website is initialized, and media access authorization is performed by calling the browser interface. After the media access authorization is passed, the video screen stream information of the camera device is added to the Video element for display by calling the browser interface.
7. The device according to claim 5, characterized in that The storage module is specifically used for: The camera button takes a screenshot of the video information currently displayed by the Video element by calling the browser interface, and downloads the image information to the local computer or uploads it to a file server.
8. The device according to claim 5, characterized in that The camera device includes: a camera of the terminal itself, or a camera device connected externally via USB.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for implementing WEB webpage photography as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an implementation program for information transmission, and when the program is executed by the processor, the steps of the method for implementing WEB webpage photography as described in any one of claims 1 to 4 are implemented.