I tried to change the code as follows
grab points in event handler [1], then actually draw it after
capturing is over [2]
The result curve is not smooth in case of fast, long distance moves

[1] https://github.com/solomax/FlexSandbox/blob/master/web/src/Main1.mxml#L37
[2] https://github.com/solomax/FlexSandbox/blob/master/web/src/Main1.mxml#L31

On Thu, Oct 6, 2016 at 2:37 PM, Javier Guerrero García
<javi...@gmail.com> wrote:
> Yes, I understood, but you can do it in many ways:
>
>    - Capture mouse coordinates, and draw the new pixel on a bitmap placed
>    underneath
>    - Capture mouse coordinates, and draw a new <Line> object from the last
>    captured point to the new coordinates, and so on
>    - Capture mouse coordinates, and perfom a graphics.lineTo on a Sprite on
>    each mouse move (a one liner for a one liner :)
>
> I think the vector approach should perform better on redraws, and I really
> do think your problem is right there on the fullscreen redraws: 60fps or
> even 30fps should be more than enough to capture a signature.
>
> To confirm first, try first separating the areas, and see it that makes it
> smoother :)
>
> On Thu, Oct 6, 2016 at 9:27 AM, Maxim Solodovnik <solomax...@gmail.com>
> wrote:
>
>> It sort of "pencil drawing" by mouse/pen
>> I'll try to capture points and draw it later(or better in separated thread)
>>
>> Thanks for the pointer
>>
>> On Thu, Oct 6, 2016 at 2:23 PM, Javier Guerrero García
>> <javi...@gmail.com> wrote:
>> > Hi Maxim!
>> >
>> > Are you capturing the points on line objects, or on a bitmap drawn at the
>> > bottom that has to be interpolated and redrawn on every mouse movement?
>> Try
>> > separating the capture and paint areas, capturing line objects instead of
>> > pixels on a bitmap, or at least draw the bitmap with the lowest posible
>> > interpolation quality, to see if it helps.
>> >
>> > Hope it works :)
>> >
>> > On Thu, Oct 6, 2016 at 5:49 AM, Maxim Solodovnik <solomax...@gmail.com>
>> > wrote:
>> >
>> >> changing FPS to 60 doesn't help :( (originally it was 30)
>> >> Final code for capturing events and drawing is the same as prototype
>> code
>> >> still got ugly, non-smooth curve in case mouse moving very fast
>> >>
>> >> Line in much smoother in Gimp
>> >> In fact Flex desktop app produces smooth enough line
>> >> will try to create browser quick start and double check
>> >>
>> >> On Thu, Oct 6, 2016 at 9:18 AM, Maxim Solodovnik <solomax...@gmail.com>
>> >> wrote:
>> >> > Hello,
>> >> >
>> >> > Thanks a lot for the quick answers, definitely flex is one of my
>> >> > favorite communities :)
>> >> > Here is example project: https://github.com/solomax/FlexSandbox
>> >> > since it is desktop and tiny it looks not that bad
>> >> > In my main project the resulting line is not smooth at all :(
>> >> >
>> >> > I'll try to check the code and remove any delays, thanks for the
>> pointer.
>> >> >
>> >> > Additionally I'll try to check FFT, I have tried to add additional
>> >> > points and use cubicCurveTo, but was unable to finish this (it is
>> >> > currently commented)
>> >> >
>> >> > On Thu, Oct 6, 2016 at 1:47 AM, OK <p...@olafkrueger.net> wrote:
>> >> >> Alex Harui wrote
>> >> >>>>can't you just up the frame per second of the swf to say 60, and if
>> >> >>>>needed interpolate data points to smooth it?
>> >> >>> That is a possibility, but the interpolation code may also affect
>> input
>> >> >>> rate.
>> >> >>
>> >> >> For this approach it might be helpful to google with "spline
>> >> interpolation"
>> >> >> and "FFT" (Fast Fourier Transformation). Maybe you find some ready to
>> >> use
>> >> >> AS3 implementations.
>> >> >>
>> >> >> Olaf
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context: http://apache-flex-users.
>> >> 2333346.n4.nabble.com/Get-mouse-coordinates-on-high-
>> >> speed-tp13737p13748.html
>> >> >> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > WBR
>> >> > Maxim aka solomax
>> >>
>> >>
>> >>
>> >> --
>> >> WBR
>> >> Maxim aka solomax
>> >>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>



-- 
WBR
Maxim aka solomax

Reply via email to