3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Color Picker
[Re: txesmi]
#406488
08/21/12 17:46
08/21/12 17:46
|
Joined: Apr 2008
Posts: 245
GameScore
OP
Member
|
OP
Member
Joined: Apr 2008
Posts: 245
|
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?
Last edited by GameScore; 08/21/12 17:47.
|
|
|
|