If your copying the texture in anyway, the alpha information will be lost, thus the masking info also will be.
Pass the texture across to this function:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1013
Pass the texture across to this function:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1013