# bitmapData with ColorTransform

**URL:** https://forum.kirupa.com/t/bitmapdata-with-colortransform/219137
**Category:** Uncategorized
**Created:** [March 14, 2007, 5:38am UTC](https://forum.kirupa.com/t/bitmapdata-with-colortransform/219137 "2007-03-14T05:38:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chapster](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chapster](https://forum.kirupa.com/u/chapster)
#### Post date: [March 14, 2007, 5:38am UTC](https://forum.kirupa.com/t/bitmapdata-with-colortransform/219137/1 "2007-03-14T05:38:10Z")

</div>

I have a wrapper function to create a bitmap snapshot of a movieClip with some text in it. Before I call the createBitmapData() function I had did a rgb color change on the clip but when I use the draw function with bitmapData it does not take my new rgb color of the movieClip with it so i’m trying to figure out how to use the new ColorTransform to transfer my color over to the newly drawn bitmap. Anyone can help?

```auto

	private function createBitmapData(source, containerName:String, color:String):MovieClip{
		
		var bitmapHolder:MovieClip=mcHolder.createEmptyMovieClip(containerName,mcHolder.getNextHighestDepth());
		var bmpData = new BitmapData(source._width, source._height, true, 0x00FFFFFF);
		//
		var ct=new ColorTransform();
		ct.rgb=0xFF0000;
		bmpData.draw(source, new Matrix(), ct);
		bitmapHolder.attachBitmap(bmpData, 1, "never", true);
		return bitmapHolder;
	}

```
