Reputation: 3126
I am using the following code to draw a text from the textinput on a Bitmap. It works fine except the problem that instead of drawing just the text, it draws the text inside a box with white background. How can I draw just the text without the box? I guessed its related to transparency so I set the Bitmapdata to be transparent, it still doesn't work.
var m:Matrix = new Matrix();
m.tx=100;
m.ty=100;
var txtMatrix:Matrix= new Matrix();
txtMatrix.tx=bmd.width;
txtMatrix.ty=bmd.height+50;
original= new BitmapData(bmd.width+200,bmd.height+400,true,0x00000000);
original.draw(bmpMy,m);
var txtMatrix:Matrix= new Matrix();
txtMatrix.tx=100;
txtMatrix.ty=bmd.height+105;
original.draw(txtTitle1,txtMatrix);
Note: The BitmapData bmd that is passed to 'original' is also transparent. bmpMy is the bitmap from the bmd BitmapData
Upvotes: 0
Views: 511
Reputation: 11912
You're drawing your entire TextInput component with the default TextInputSkin. Since this skin has a border and a white background, they will also be drawn.
I see 2 possible solutions:
or
.
txtTitle.setStyle("skinClass", MyCustomTextInputSkin);
When you're done drwing, restore the default skin:
txtTitle.setStyle("skinClass", TextInputSkin);
Upvotes: 2