# Bitmap Fill + Drawing API = no good?

**URL:** <https://forum.kirupa.com/t/bitmap-fill-drawing-api-no-good/304567>\
**Category:** flash\
**Created:** [February 10, 2010, 3:06am UTC](https://forum.kirupa.com/t/bitmap-fill-drawing-api-no-good/304567 "2010-02-10T03:06:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheByteBandit](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@TheByteBandit](https://forum.kirupa.com/u/TheByteBandit)\
**Post date:** [February 10, 2010, 3:06am UTC](https://forum.kirupa.com/t/bitmap-fill-drawing-api-no-good/304567/1 "2010-02-10T03:06:54Z")

</div>

I’m trying to use a bitmap fill, but I can’t seem to get it to work.

I’m using FlashDevelop with assets imported from CS4 - this isn’t the problem, I can instantiate the asset I’m targeting perfectly fine, so I suspect that it’s a problem with what I’m trying to do.

Here’s my code:

```auto

//get the bitmap data from a grass symbol
//grass symbol IS present - can be added to stage fine
    var grassBMD:BitmapData = new BitmapData(155, 80);
    grassBMD.draw(new Grass());

//style the line (this works fine)
    this.graphics.lineStyle(.25, 0xCCCCCC, 1, true);

//try bitmap fill using the bitmap data from earlier
    this.graphics.beginBitmapFill(grassBMD);
//draw the box (slanted) using the drawing API
//I think this is why it doesn't work - instead of using a primitive shape, i'm using lines
    this.graphics.moveTo(0, 0);
    this.graphics.lineTo( -SIZE, SIZE / 2 );
    this.graphics.lineTo( 0, SIZE );
    this.graphics.lineTo( SIZE, SIZE / 2 );
    this.graphics.lineTo( 0, 0 );
//end fill
    this.graphics.endFill();

```

I’m not really sure what’s going on. Nothing gets displayed in the box, so I’m suspicious that I’m not allowed to use bitmap fill in non-primitive shapes. Any ideas are greatly appreciated 🙂
