electronic signature [message #1849387] |
Sun, 16 January 2022 11:33 |
Eclipse User |
|
|
|
Dear all,
I am trying to develop an interface providing electronic signature and saving the signature/screenshot as a JPEG file in server.
Question 1:
For signature, I tried https://github.com/szimek/signature_pad , it works on Chrome/Edge/Safari/Firefox, not works on RAP Browser control.
Question 2:
For saving signature as a JPEG file, I tried
---
GC gc = new GC(shell.getDisplay());
final Image image = new Image( shell.getDisplay(), shell.getBounds().width, shell.getBounds().height );
gc.copyArea( image, shell.getBounds().x, shell.getBounds().y );
gc.dispose();
ImageLoader loader = new ImageLoader();
loader.data = new ImageData[]{ image.getImageData() };
String fileName = "D:/Temp/_test/a001.jpg"; // or a001.png
new File(fileName);
loader.save(fileName, SWT.IMAGE_PNG);
---
It works well in RCP, but not in RAP, I looked up org.eclipse.swt.graphics.GC on
https://javadoc.scijava.org/Eclipse/org/eclipse/swt/graphics/GC.html
and
https://download.eclipse.org/rt/rap/doc/3.6/guide/reference/api/org/eclipse/swt/graphics/GC.html
That supports copyArea(), this does not.
Any guides or examples will be appreciated.
Thank you.
David
[Updated on: Wed, 19 January 2022 05:25] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03194 seconds