imageBytes method
UrovoPrintJob
imageBytes(
- Uint8List jpegOrPng, {
- int width = 200,
- int height = 80,
- 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;
}