Now i am attempting to read the pixel color from one bmap and write a blue pixel to another bmap if the pixel color read from the first bmap is the right color.

I have the following function:

function color_bmap(COLOR pixel_color)
{ var count_x;
var count_y;
var pixel;
COLOR temp_color;
BMAP* temp_bmap = bmap_createblack(744,600,32);
bmap_lock(temp_bmap,0);
bmap_lock(my_bmap,0);
count_y = 0;
while(count_y<600)
{ count_x = 0;
while(count_x<744)
{ pixel = pixel_for_bmap(my_bmap,count_x,count_y);
pixel_to_vec(temp_color,NULL,8888,pixel);
if(temp_color.blue==pixel_color.blue||temp_color.red==pixel_color.red||temp_color.green==pixel_color.green)
{ temp_color.red = 0;
temp_color.green = 0;
temp_color.blue = 250;
pixel = pixel_for_vec(temp_color,100,8888);
pixel_to_bmap(temp_bmap,count_x,count_y,pixel);
}
count_x += 1;
}
count_y += 1;
}
bmap_unlock(temp_bmap);
bmap_unlock(my_bmap);
my_panel.bmap = temp_bmap;
set(my_panel,VISIBLE);
}

This whole routine is working as it should, except that when i write a pixel to temp_bmap - no pixel is written. The instruction, pixel_to_bmap() is being executed - it just fails to actually write a pixel to temp_bmap. Why is this happening?

Last edited by Caermundh; 12/01/10 17:37.