now i wrot ethe code like this and i get nor crash
void get_clr()
{
COLOR clr;
var format;
var pixel;
BMAP* hitMap = "color_btn.png";
var texX = clamp ( mouse_pos.x - clr_main.pos_x, 0, bmap_width(hitMap)-1 );
var texY = clamp ( mouse_pos.y - clr_main.pos_y, 0, bmap_height(hitMap)-1 );
if(mouse_panel==clr_main)
{
var format=bmap_lock(hitMap,0);
var pixel=pixel_for_bmap(hitMap,texX,texY);
bmap_unlock(hitMap);
}
}
clr_main is the panel where the mouse is over
and hitMap is the button with the colorfield bmap to grab the color
the function will called when i hit this button
but how can i get the colorvalues of the pixel now?