Just want to be clear - you're not placing bitmaps - but writing bitmap
data, so once the line is drawn (you'd represent it somehow as a vector
preview) you create some bitmapData which encompasses the line and brush
width, then you'd copy from your brush bitmap into the new bitmap along
the length of the spline.

Using this technique you could vary things like scatter, velocity,
wetness, pressure etc according to how fast the stroke was brushed. 

M

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Guntur N. Sarwohadi
> Sent: 28 February 2007 16:28
> To: flashcoders@chattyfig.figleaf.com
> Subject: Re: [Flashcoders] simulating airbrush + calligraphy brush
> 
> yeah.. i usually just use lineTo in a loop while the mouse is 
> pressed.. no curveTo as i thought it's unnecessary.
> 
> so I just need to place the bitmaps after the lineTo? is that 
> all? if I need to stretch the bitmap, say from the last point 
> to the current, is that possible? or by just placing the 
> bitmaps per point will suffice?
> 
> Guntur N. Sarwohadi
> 
> On 2/28/07, Danny Kodicek <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of 
> > > Guntur N. Sarwohadi
> > > Sent: 28 February 2007 14:56
> > > To: flashcoders@chattyfig.figleaf.com
> > > Subject: Re: [Flashcoders] simulating airbrush + calligraphy brush
> > >
> > > > apply the airbrush effect in a bitmap along the path - this way 
> > > > you can assign different brushes to the path after it's been
> > > drawn, undo
> > > > points etc.
> > >
> > >
> > > mmm.. love the idea... but, what do you mean by placing bitmaps 
> > > along a path? did you mean it will also stretch or just show for 
> > > every vertex of the path? can you give me pseudo-code of 
> how to do 
> > > this?
> >
> > Depends how you want to do it, but the simplest is to work 
> with a spline.
> > One method is to take one brush point every few moments and 
> turn this 
> > path into a Catmull-Rom spline. Then you can draw as many 
> points along 
> > the spline as you like. A quick guide to catmull rom 
> splines is here:
> > http://www.mvps.org/directx/articles/catmull/, but in essence:
> >
> > function catmullPoint (p0, p1, p2, p3, t) { // where p0 to p3 are 
> > points, and t is the fraction of the distance between
> > p1 and p2
> > return 0.5 * (2*p1 + t*(p2 - p0) + t*t*(2*p0 - 5*p1 + 4*p2 - p3) + 
> > t*t*t*(-p0 + 3*p1 - 3*p2 + p3)) }
> >
> > So if you have a list of points p0, p1, ... , pN, then you 
> can draw as 
> > many points along the spline as you like.
> >
> > Flash uses quadratic bezier curves in the drawing API and cubic 
> > beziers in the actual application - a cubic bezier and a 
> Catmull-Rom 
> > spline are essentially the same thing but with different 
> parameterizations.
> >
> > Danny
> >
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training 
> > http://www.figleaf.com http://training.figleaf.com
> >
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training 
> http://www.figleaf.com http://training.figleaf.com
> 


ECM Systems Ltd, Ellifoot Park, Burstwick, East Yorkshire HU12 9DZ
Tel: 01964 672000 
Fax: 01964 671102
Registered in England no. 01646471 
The information contained within this email expresses the views of the sender 
and not necessarily those of the company. It is private and confidential and 
may be legally privileged. It is intended solely for those authorised to 
receive it. If you are not the intended recipient you are hereby notified that 
any disclosure, copying, distribution or action taken in reliance on its 
contents is strictly prohibited and may be unlawful. If you have received this 
email in error, please telephone us immediately on 01964 672000 or email a 
reply to highlight the error and then delete it from your system. This email 
may contain links to web-sites, the contents of which ECM Systems Ltd have no 
control over and can accept no responsibility for. Any attachments have been 
virus-checked before transmission; however, recipients are strongly advised to 
carry out their own virus checking as ECM Systems Ltd do not warrant that such 
attachments are virus-free. Please note that this email has been created in the 
knowledge that Internet email is not a secure communications medium. We advise 
that you understand and observe this lack of security when emailing us.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to