# linebitmapStyle

**URL:** <https://forum.kirupa.com/t/linebitmapstyle/290096>\
**Category:** flash\
**Created:** [June 9, 2009, 6:42pm UTC](https://forum.kirupa.com/t/linebitmapstyle/290096 "2009-06-09T18:42:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![whomba](https://avatars.discourse-cdn.com/v4/letter/w/8797f3/32.png) [@whomba](https://forum.kirupa.com/u/whomba)\
**Post date:** [June 9, 2009, 6:42pm UTC](https://forum.kirupa.com/t/linebitmapstyle/290096/1 "2009-06-09T18:42:02Z")

</div>

Hello, long time reader, first time contributer here.  
I am trying to mimic a paint brush in AS3. Right now I am simply checking for mouse down + mouse move then putting a copy of an image on the stage. This sucks because after a while it starts to get bogged down.

As a result I checked out graphics.lineBitmapStyle(), I was able to get that to work (technically) but not how I wanted to use it. Right now it just tiles it (yes, i know there is a switch to turn tiling off) acting like a ‘scratch off’ lottery ticket, as in, there is an image under neath (my bitmap) and my ‘drawing’ just makes it visible. Any help would be greatly appreciated… code is below:

```auto

var oldWay:Canvas = new Canvas()
//Create bmp data:
var bRect:BitmapData = new BitmapData(100, 100); //create bitmap
var c:Canvas = new Canvas(); //create spoof canvas
c.graphics.beginFill(oxFF0000);//start fill
c.graphics.drawRoundRect(0,0, 100, 100,10,10);//draw that ****!
c.graphics.endFill();//end fill
bRect.draw(c);//draw this out to the bmpdata
oldWay.graphics.lineStyle(bRect.height,0); //start a line style
oldWay.graphics.lineBitmapStyle(bRect,null,true,false) //set bitmap style
oldWay.graphics.moveTo(nX1, nY1);//move this to my old location
oldWay.graphics.lineTo(nX2, nY2);//draw to new location

```

Image of results here:  
 ![](http://forum.kirupa.com/uploads/kirupa/5455/45a41bc9be47e44e.png)
