Man i dont get it to work

i have 2 bmaps
the 1st one with the color patern
and the 2nd one is a black image with only a alpha shape inside
now i was try to read an write the 1st bmap into the 2nd one
with pixel_for and pixel_to_bmap
and save it with bmap_save to se the result
but the alpha chanel is overwritten, complete white

here is my code, please help

Code:
void create_bmap()
{
	var alph, formatFrom, formatTo, pixel,format;
	COLOR col;
	
	int x,y, x_max = bmap_width(pattern_1), y_max = bmap_height(pattern_1);
	
	 bmap_to_format(alpha_1,4444);
	 bmap_to_format(pattern_1,4444);
	 
	formatTo = bmap_lock(alpha_1,format);
	formatFrom = bmap_lock(pattern_1,format);
  
	for(x = 0; x < x_max; x++)
       {
		
	for(y = 0; y < y_max; y++)
       {
			
	pixel = pixel_for_bmap(pattern_1, x, y);
	pixel_to_vec(col, alph, formatFrom, pixel);
			
	pixel = pixel_for_vec(col,alph, formatTo);
	pixel_to_bmap(alpha_1, x, y, pixel);
		
       }

       }
	
	bmap_unlock(pattern_1);
	bmap_unlock(alpha_1);
		wait(1);
	
	bmap_save(flame_1,"test.tga");
	
	
}