簡體   English   中英

在Ti.paint鈦/ android中捕獲像素的X,Y坐標

[英]Capturing X,Y co-ordinates of pixel in Ti.paint titanium/android

在這里,我面臨一個小問題,我在使用鈦制加速器提供的Ti.paint模塊。 問題是我可以在某個事件監聽器上獲得所有x和y像素坐標嗎?

    var paintView = Paint.createPaintView({
    top : 0,
    right : 0,
    bottom : 80,
    left : 0,
    strokeColor : '#0f0',
    strokeAlpha : 255,
    strokeWidth : 10,
    eraseMode : false
});

paintView.addEventListener('touchmove', function(e) {

    Ti.API.info('listener called ' + e.x + ',' + e.y);
});

但是它並不能捕獲所有X,Y坐標,因此會跳過其中的一些。緩慢繪畫會捕獲幾乎所有有色像素坐標,但是會快速繪制,跳過一些像素坐標。請提供幫助。

阿里

觸摸移動事件受到限制,因此您的代碼不會過載。

如果您絕對需要掌握所有要點,則需要跨入Java領域並根據需要自定義繪畫模塊。

該模塊的源代碼可在以下位置獲得: https : //github.com/appcelerator/titanium_modules/tree/master/paint/mobile/android

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM