2

我正在使用 wacom sdk 签名板,但我不知道如何获取签名图像,我正在使用 DemoButtons 示例。

在“pressOkButton”方法中,我想编写处理图像的代码,可能是缓冲图像格式

private void pressOkButton() throws STUException {
             //enter code here
            clearScreen();
            this.setVisible(true);

        }
4

1 回答 1

1
SigCtl sigCtl = new SigCtl();
sigCtl.setProperty("Licence", "<the_license_you_get_from_them>");
        dc = new DynamicCapture();
        int rc = dc.capture(sigCtl, who, why, null, null); // dc.capture(sigCtl, "who", "why", null, null);
        if(rc == 0) {
            logger.info("signature captured successfully\n");
            SigObj sig = sigCtl.signature();
            sig.extraData("AdditionalData", "CaptureImage.java Additional Data");
            int flags = SigObj.outputFilename | SigObj.color32BPP | SigObj.encodeData;
            sig.renderBitmap(fileNameArray[1].getAbsolutePath(), 300, 233, "image/png", 0.7f, 0x000000, 0xffffff, 0.5f, 0.0f, flags); //flags are: filename, dimensionX, dimensionY, mimeType, inkWidth, inkColor, inkBackground, paddingX, paddingY
            FileOutputStream fos = new FileOutputStream(fileNameArray[0].getPath());
            fos.write(sig.sigData());
            fos.flush();
            fos.close();
            retrieve();
        }
于 2017-10-20T15:14:06.023 回答