4Q-s-r-o / signature

Flutter plugin that creates a canvas for writing down a signature
MIT License
252 stars 83 forks source link

toImage() returns defineable size image? #56

Closed rivella50 closed 2 years ago

rivella50 commented 2 years ago

Hi there, at the moment controller.toImage() and .toPngBytes() return various size images, depending on the painted dots area. Since the backend i have to upload signature images expects fixed size images i was wondering if it wouldn't be possible to let callers of those 2 methods define optional width and height parameters which (if defined) would be used as the size of the returned image, where the signature then is centered. If the width and/or height are smaller than the signature those values would be used.

Or how could i reach this by myself after receiving a ui.Image from controller.toImage() ?

MartinHlavna commented 2 years ago

Hi,

how should it behave? By adding transparent space, or by upscaling the signature?

rivella50 commented 2 years ago

Hi Martin, i would suggest adding transparent space, or if a background color is passed (as an additional parameter?) then use that color.

MartinHlavna commented 2 years ago

Published in 5.2.0

rivella50 commented 2 years ago

Thanks a lot. I will test it asap.