A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: BitmapData transparent background

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    996

    BitmapData transparent background

    How can I get the background of a BitmapData to be transparent. The reason for this is the movieclip it is taking the snapshot from is a movieclip with text inside it so it should just show the text without a white background. I tried to set the transparent value to true but that didn't work, any ideas?

    Code:
    	private function createBitmapData(source, containerName:String):MovieClip{
    		
    		var bitmapHolder:MovieClip=mcHolder.createEmptyMovieClip(containerName,mcHolder.getNextHighestDepth());
    		var bmpData = new BitmapData(source._width, source._height, true);
    		bmpData.draw(source);
    		bitmapHolder.attachBitmap(bmpData, 1, "never", true);
    		return bitmapHolder;
    	}

  2. #2
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    This is much easier than you think. Just go to --> Modify --> Bitmap --> Trace. Now get rid of the white areas by simply deleting them manually. Hope that I'm not on the wrong track and that this is what you were looking for.
    aut.

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    996
    Thanks for the help but this is not what i'm after. When you create a new BitmapData object it places a white color in it I need a way to set it to be transparent.

  4. #4
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Add the fillColor parameter when you create the BitmapData object - by default it will fill with solid white:
    code:

    var bmpData = new BitmapData(source._width, source._height, true,0x00FFFFFF);


    http://livedocs.adobe.com/flash/8/ma....html#wp140607

    K.

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    996
    Ah that's it thank you so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center