Functions¶
|
|
|
|
|
Details¶
- GnomeQR.generate_qr_code_async(text, requested_size, bg_color, fg_color, format, ecc, cancellable, callback, *user_data)¶
- Parameters:
text (
str) – The text of which generate the QR coderequested_size (
int) – The requested size (width and height) in pixels of the QR code. Only square QR codes are supported. If the requested size is smaller than the minimum required size for the QR code, it will be generated with 1 pixel per block.bg_color (
GnomeQR.ColororNone) – The background color of the code orNoneto use default (white)fg_color (
GnomeQR.ColororNone) – The foreground color of the code orNoneto use default (black)format (
GnomeQR.PixelFormat) – The pixel format for the output image dataecc (
GnomeQR.EccLevel) – The error correction levelcancellable (
Gio.CancellableorNone) – AGio.Cancellableto cancel the operationcallback (
Gio.AsyncReadyCallbackorNone) – function to call returning success or failure of the async grabbinguser_data (
objectorNone) – the data to pass to callback function
Generates the QrCode asynchronously.
Use
GnomeQR.generate_qr_code_finish() to complete it.
- GnomeQR.generate_qr_code_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – theGio.AsyncResultthat was provided to the callback- Raises:
- Returns:
The pixel data or
Noneon error- pixel_size_out:
The actual square QR code size (width and height) in pixels. Note that it may not match the requested_size in
GnomeQR.generate_qr_code_async().
- Return type:
(
GLib.Bytes, pixel_size_out:int)
Finish the asynchronous operation started by
GnomeQR.generate_qr_code_async() and obtain its result.
- GnomeQR.generate_qr_code_sync(text, requested_size, bg_color, fg_color, format, ecc, cancellable)¶
- Parameters:
text (
str) – the text of which generate the QR coderequested_size (
int) – The requested size (width and height) in pixels of the QR code. Only square QR codes are supported. If the requested size is smaller than the minimum required size for the QR code, it will be generated with 1 pixel per block.bg_color (
GnomeQR.ColororNone) – The background color of the code orNoneto use default (white)fg_color (
GnomeQR.ColororNone) – The foreground color of the code orNoneto use default (black)format (
GnomeQR.PixelFormat) – The pixel format for the output image dataecc (
GnomeQR.EccLevel) – The error correction levelcancellable (
Gio.CancellableorNone) – AGio.Cancellableto cancel the operation
- Raises:
- Returns:
The pixel data or
Noneon error- pixel_size_out:
The actual square QR code size (width and height) in pixels. Note that it may not match requested_size.
- Return type:
(
GLib.Bytes, pixel_size_out:int)
Generates the QrCode synchronously.