keirbowden / sigcapapp

Signature Capture Samples
MIT License
9 stars 5 forks source link

Image size not configurable #7

Closed perryhoekstra closed 6 years ago

perryhoekstra commented 6 years ago

The signature image size generated is not configurable. This makes it difficult to display the generated signature image in any dashboard without resizing. It would be nice to set a scaling factor for the signature image.

keirbowden commented 6 years ago

Hi,

You can adjust the size of the image by adjusting the size of the canvas used to capture the signature. If you are using the default behaviour, the canvas will have a height of 300px and a width of 100% of the browser window/viewport. Depending on how you are using the component, you can change the dimensions via the width/height design attributes (lightning app builder), the width/height attributes (nested lightning component/Visualforce out).

On retina screens the captured image is twice the size of the resolution specified by the width/height, so a 200px x 300px image would actually be captured at 400px x 600px.

You can't change the dimensions on the action that is included in the package, but you can easily create your own based on the SigCapAction example in this repo.

I don't think I can resize the image due to the locker service blocking writing it to a smaller canvas element.

Does any of this help or do you have a different use case?

keirbowden commented 6 years ago

I'm closing this issue as it's been a number of weeks since I answered and there has been no further comment.