Method and device for scanning two-dimensional code
A technology of two-dimensional codes and scanning frames, applied in the field of scanning two-dimensional codes, can solve the problems of low decoding efficiency and long time consumption, and achieve the effect of improving decoding efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0022] Embodiment 1 of the present invention provides a method for scanning a two-dimensional code, such as figure 1 shown, including:
[0023] Step S1: the application starts the system camera;
[0024] Step S1 specifically includes:
[0025] The application sets the callback of the interface controller, and the application creates a camera object; the application obtains the current camera parameters according to the created camera object; the application starts the camera preview frame of the system camera according to the camera object.
[0026] Step S2: The application obtains the camera image through the camera preview frame of the system camera, rotates the camera image, and obtains the corresponding image in the rotated camera image according to the position of the rotated camera image and the scanning frame image in the rotated camera image. The scan frame image corresponding to the scan frame;
[0027] Step S3: The application decodes the acquired scanning frame i...
Embodiment 2
[0063] Embodiment 2 of the present invention provides a method for scanning a two-dimensional code, such as figure 2 and image 3 shown, including:
[0064] Step 101: The application obtains the object of the parent layout of the current application according to the preset object ID of the parent layout of the current application, obtains the object of the scan frame layout according to the preset object ID of the scan frame layout, and obtains the object of the scan frame layout according to the preset interface view control ID. Controls of the interface view class, that is, interface view objects;
[0065] Specifically, the application calls the system method findViewById method to obtain the object mContainer of the current application parent layout according to the preset object ID of the current application parent layout; according to the preset object ID of the scan frame layout, calls the system method findViewById method to obtain the scan frame layout The object mC...
Embodiment 3
[0175] This embodiment provides a device for scanning two-dimensional codes, such as Figure 5 As shown, it includes: a startup module 01, a first acquisition module 02 and a decoding module 03;
[0176] Start module 01, used to start the system camera;
[0177] Wherein, the startup module 01 includes an interface control submodule, a first creation submodule, a first startup submodule and a fifth acquisition submodule;
[0178] The interface control sub-module is used to set the callback of the interface controller;
[0179] First create a sub-module, which is used to create a camera object after the interface control sub-module sets the callback of the interface controller;
[0180] The fifth obtaining sub-module is used to obtain the current camera parameters according to the camera object created by the first creating sub-module;
[0181] The first launching submodule is configured to start the camera preview frame of the system camera according to the camera object cre...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 