Skip to main content

QRCodeManager API

Description​

IQRCodeManager is designed for working with QR codes in ZennoDroid. It allows you to manage the scan window, display images (e.g. QR codes), and interact with the camera/scanner interface.


Methods​

CloseQRCodeScanWindow​

  • void CloseQRCodeScanWindow()
    Closes the QR code scan window.

Example​

var qr = new QRCodeManager();

qr.CloseQRCodeScanWindow(); // Close the QR code scan window

CloseViewfinderWindow​

  • void CloseViewfinderWindow()
    Closes the viewfinder (camera) window.

Example​

var qr = new QRCodeManager();

qr.CloseViewfinderWindow(); // Close the viewfinder window

DrawImage​

  • void DrawImage(byte[] image, Rectangle area, Rectangle background)
    Displays an image on the screen.

    Parameters:

    • image — byte array of the image;
    • area — area in which the image will be displayed;
    • background — background area (for positioning/rendering).

Example​

var qr = new QRCodeManager();

var area = new Rectangle(100, 200, 400, 400); // Where the image goes
var background = new Rectangle(0, 0, 720, 1280); // Background area

qr.DrawImage(project.Path + "qrcode.png", area, background); // From a file
qr.DrawImage(File.ReadAllBytes(project.Path + "qrcode.png"), area, background); // From a byte array

  • void DrawImage(string fileName, Rectangle area, Rectangle background)
    Displays an image from a file.

    Parameters:

    • fileName — path to the image file;
    • area — display area;
    • background — background area.

PressQRCodeScanButton​

  • void PressQRCodeScanButton()
    Presses the QR code scan start button.

Example​

var qr = new QRCodeManager();
qr.PressQRCodeScanButton();

SetViewfinderPosition​

  • void SetViewfinderPosition(Rectangle rect)
    Sets the position of the viewfinder window.

    Parameters:

    • rect — area where the window is placed.

Example​

var qr = new QRCodeManager();

qr.SetViewfinderPosition(new Rectangle(100, 200, 400, 400)); // Place the viewfinder window