scribble icon indicating copy to clipboard operation
scribble copied to clipboard

background color

Open mbfakourii opened this issue 3 years ago • 2 comments
trafficstars

hi how change background color ? default background is transparent !

mbfakourii avatar Apr 14 '22 13:04 mbfakourii

i found a way to change background but i think is not good idea !

import 'package:image/image.dart' as image;


ByteData image2 = await notifier.renderImage(format: ImageByteFormat.png);
image.Image image3 = image.decodeImage(image2.buffer.asUint8List())!;
image3.fillBackground(Colors.white.hashCode);
final thumbnail = image.copyResize(image3, width: image3.width,height: image3.height);
Navigator.pop(context, image.encodeJpg(thumbnail));

and not work in web only work in windows !

mbfakourii avatar Apr 14 '22 14:04 mbfakourii

This should be an easy implementation, we might get around to it once we have time. Feel free to open a PR. The sketch model would need a backgroundColor property with a default of transparent. Drawing it in the widget should be straightforward

timcreatedit avatar May 13 '22 08:05 timcreatedit