# Bitmap pixel test

**URL:** <https://forum.kirupa.com/t/bitmap-pixel-test/314693>\
**Category:** Uncategorized\
**Created:** [October 6, 2010, 12:31pm UTC](https://forum.kirupa.com/t/bitmap-pixel-test/314693 "2010-10-06T12:31:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagguy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jagguy](https://forum.kirupa.com/u/jagguy)\
**Post date:** [October 6, 2010, 12:31pm UTC](https://forum.kirupa.com/t/bitmap-pixel-test/314693/1 "2010-10-06T12:31:27Z")

</div>

I cant get this bitmapData hit test  
working.

I have a btmapdata and i want to test a point (10,10) to see  
if it lies inside the bitmapdata. Not the rectangle the image is in but if a  
point lies inside a pixel area (not alpha area).

I test the collision  
inside a gameloop which is inside a document class.  
It doesnt recognise the  
bitmap,bitmapdata variable even when I use import for this variable

public class Main extends MovieClip {  
…  
…  
var myimg:Bitmap; // 1046: Type was not found or was not a compile-time constant: BitmapData.

var bmpdata:BitmapData;  
var myRect:Rectangle ;  
…  
…  
if(bmpdata.hitTest(new Point(bmpdata.x, bmpdata.y),  
255,  
Point //not sure what i put here for point,

```
                                new Point(10, 10),
                                    255 ))
           {
```
