[Gambas-user] is there an example for generating curves

Fabien Bodard gambas.fr at ...626...
Mon Jan 12 22:48:34 CET 2015


Hi julio :

Public Struct PuntoBezier
  x As Float
  y As Float
End Struct

You can use PointF class for that


Dim p as PointF

2015-01-12 22:21 GMT+01:00 Julio Sanchez <jusabejusabe at ...626...>:
> rolf:
>
> Here's an example of drawing Bezier curves
>
> http://jsbsan.blogspot.com.es/2014/07/dibujando-una-curva-bezier-de-mas-de-3.html
>
>
> Regards,
>
> Julio
>
> 2015-01-12 14:02 GMT+01:00 Fabien Bodard <gambas.fr at ...626...>:
>
>> Better than words, this is a demo !
>>
>> 2015-01-12 12:22 GMT+01:00 Fabien Bodard <gambas.fr at ...626...>:
>> > Well.. you need two things in fact . first you can use an array of point
>> :
>> >
>> > Private $aPoints as new Point[]
>> >
>> >
>> > Then you add in real time your points :
>> >
>> > $apoint.add(point(x,y))
>> > and query the redraw of the drawing area
>> >
>> > MyDA.refresh
>> >
>> >
>> > Public sub MyDA_Draw()
>> >
>> >   dim i as integer
>> >
>> > for i=0 to $aPoints.max -1 step 2
>> >
>> >   draw.line($apoint[i].x$apoint[i].y,$apoint[i+1].x,$apoint[i+1].y)
>> >
>> > next
>> >
>> > end
>> >
>> >
>> > You ca doing the same fr the second drawing area and of ourse a second
>> > point array.
>> >
>> > Don't forget that in gambas many of the control don't store datas,
>> > they are just viewer.
>> > You need some array to store datas and then use them to draw.
>> >
>> > Each time drawing area is refreshing you need to redraw the full curve
>> > .(and all things to draw is the view)
>> >
>> > Regards,
>> >
>> > Fabien Bodard
>> >
>> > 2015-01-12 10:06 GMT+01:00 rolf <rolf.frogs at ...221...>:
>> >> Hi,
>> >>
>> >> I can manage to draw curves of measured values, when they arrive i.e.
>> the
>> >> curve has to be extendet up to 50 times. And a second measurement
>> session
>> >> should be drawn in a second drawarea.
>> >>
>> >> The gambas documentation about drawarea is not really helpfull in this
>> case.
>> >>
>> >> Is there an example where I can see how to handle two drawing areas and
>> add
>> >> points or lines in them (I think I have to use the cache, but can't see
>> what
>> >> is drawn).
>> >>
>> >> Many thanks for any help
>> >> Rolf
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
>> >> GigeNET is offering a free month of service with a new server in
>> Ashburn.
>> >> Choose from 2 high performing configs, both with 100TB of bandwidth.
>> >> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
>> >> vanity: www.gigenet.com
>> >> _______________________________________________
>> >> Gambas-user mailing list
>> >> Gambas-user at lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>> >
>> >
>> > --
>> > Fabien Bodard
>>
>>
>>
>> --
>> Fabien Bodard
>>
>>
>> ------------------------------------------------------------------------------
>> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
>> GigeNET is offering a free month of service with a new server in Ashburn.
>> Choose from 2 high performing configs, both with 100TB of bandwidth.
>> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
>> vanity: www.gigenet.com
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> www.gigenet.com
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list