小程式wepy 手寫板

2022-02-19 22:15:12 字數 2496 閱讀 1738

參考:

直接**:

<

template

>

<

view

class

>

<

view

class

="handbtn"

>

<

button

catchtap

="clearnow"

class

="delbtn"

>重寫

button

>

<

button

catchtap

="exportimage"

class

="subbtn"

>完成

button

>

view

>

<

view

class

="handcenter"

>

<

canvas

class

="sign"

canvas-id

="sign"

disable-scroll

=true

bindtouchstart

="start"

bindtouchmove

="move"

bindtouchend

="end"

/>

view

>

<

view

class

="handright"

>

<

view

class

="handtitle"

>手寫簽名

view

>

view

>

view

>

template

>

<

script

>

import wepy from

'wepy

'import qiniuuploader from

'../../utils/qiniuuploader

'var

ctx

=wx.createcanvascontext(

'sign')

ctx.setstrokestyle(

"#000");

//設定線的寬度

ctx.setlinewidth(3);

//設定線兩端端點樣式更加圓潤

ctx.setlinecap(

'round');

//設定兩條線連線處更加圓潤

ctx.setlinejoin(

'round');

export

default

class fyxz extends wepy.page

onload()

getqiniutoken()

};this

.$parent.showloading();

this

.$parent.request(param).then(res

=>

).catch

(err

=>

) }

methods =,

move: (e)

=>

, end: (e)

=>

, exportimage: ()

=>

) p.then((fp)

=>

).then(()

=>

) }

})},

//清屏

clearnow: ()

=>

, /**

* 上傳

*/uploadimg: (url)

=>

; console.log(param)

qiniuuploader.upload(url,

function

(info) ,

function

(error) , param);},}

}script

>

<

style

lang

="less"

>

.info

.handright

.handcenter

.handtitle

.handbtn button

.handbtn

.delbtn,.subbtn

.subbtn

.delbtn image

.sign

style

>

view code

一樣的,寫完點選確定時,將簽名傳至七牛

手寫板開發總結

手寫板問題總結 1 手寫板傳送命令不返回資料問題 解決方案 1 開啟串列埠時,要以o rdwr 可讀寫 o noctty 防止將終端機當成程序控制終端機 o ndelay 以不可阻斷的方式開啟檔案,即無論有無資料讀取或等待,都會立即返回程序之中 2 設定正確的位元率,校驗位,停止位 3 取消軟體流控...

基於opencv3的手寫板

先上 再講解 手寫板.cpp 實現移動滑鼠的手寫板 include stdafx.h include include includeusing namespace cv using namespace std int red,green,blue mat imagen mat screenbuffe...

h5簡易手寫板

我該說點什麼呢,開頭居然不知道想說點什麼!好吧不知道說什麼,我們就來說說這個手寫板吧,雖然這個手寫板現在沒什麼用,但是。好像的確沒什麼用啊!只是存粹 練手的的,呵 呵 大寫的尷尬 我到底在說什麼啊!好吧不說了,都快跑題了。我們先看效果吧 在我小學的美術可是拿 了98分的,你說我畫的好不好,厲不厲害,...