imageBytes method

UrovoPrintJob imageBytes(
  1. Uint8List jpegOrPng, {
  2. int width = 200,
  3. int height = 80,
  4. UrovoAlign align = UrovoAlign.center,
})

Appends an image command using PNG/JPEG bytes.

Implementation

UrovoPrintJob imageBytes(
  Uint8List jpegOrPng, {
  int width = 200,
  int height = 80,
  UrovoAlign align = UrovoAlign.center,
}) {
  if (jpegOrPng.isEmpty) {
    throw ArgumentError.value(jpegOrPng, 'jpegOrPng', 'Image bytes cannot be empty.');
  }
  _commands.add(<String, Object>{
    'type': 'imageBytes',
    'bytes': base64Encode(jpegOrPng),
    'width': width,
    'height': height,
    'align': align.wireValue,
  });
  return this;
}