Coloring a square grid by clicking
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I want to make an interface where a user can fill in a square grid by clicking. Some processing will then be done with these pixels to produce a new picture. How can I make this clickable interface? I thought about linking each little square to a set of mouse positions, but this seems unnecessarily complicated.
dynamic mouseposition
New contributor
add a comment |Â
up vote
4
down vote
favorite
I want to make an interface where a user can fill in a square grid by clicking. Some processing will then be done with these pixels to produce a new picture. How can I make this clickable interface? I thought about linking each little square to a set of mouse positions, but this seems unnecessarily complicated.
dynamic mouseposition
New contributor
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I want to make an interface where a user can fill in a square grid by clicking. Some processing will then be done with these pixels to produce a new picture. How can I make this clickable interface? I thought about linking each little square to a set of mouse positions, but this seems unnecessarily complicated.
dynamic mouseposition
New contributor
I want to make an interface where a user can fill in a square grid by clicking. Some processing will then be done with these pixels to produce a new picture. How can I make this clickable interface? I thought about linking each little square to a set of mouse positions, but this seems unnecessarily complicated.
dynamic mouseposition
dynamic mouseposition
New contributor
New contributor
New contributor
asked 1 hour ago
gilianzz
1233
1233
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
just select n for a nxn grid
n = 5;
Grid[Partition[
Table[DynamicModule[col = White,
EventHandler[
Dynamic[Graphics[EdgeForm[Thick], col, Rectangle,
ImageSize ->
Tiny]], "MouseClicked" :> (col =
col /. Black -> White, White -> Black)]], n^2], n]]
here is the result
New contributor
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
just select n for a nxn grid
n = 5;
Grid[Partition[
Table[DynamicModule[col = White,
EventHandler[
Dynamic[Graphics[EdgeForm[Thick], col, Rectangle,
ImageSize ->
Tiny]], "MouseClicked" :> (col =
col /. Black -> White, White -> Black)]], n^2], n]]
here is the result
New contributor
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
add a comment |Â
up vote
5
down vote
accepted
just select n for a nxn grid
n = 5;
Grid[Partition[
Table[DynamicModule[col = White,
EventHandler[
Dynamic[Graphics[EdgeForm[Thick], col, Rectangle,
ImageSize ->
Tiny]], "MouseClicked" :> (col =
col /. Black -> White, White -> Black)]], n^2], n]]
here is the result
New contributor
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
just select n for a nxn grid
n = 5;
Grid[Partition[
Table[DynamicModule[col = White,
EventHandler[
Dynamic[Graphics[EdgeForm[Thick], col, Rectangle,
ImageSize ->
Tiny]], "MouseClicked" :> (col =
col /. Black -> White, White -> Black)]], n^2], n]]
here is the result
New contributor
just select n for a nxn grid
n = 5;
Grid[Partition[
Table[DynamicModule[col = White,
EventHandler[
Dynamic[Graphics[EdgeForm[Thick], col, Rectangle,
ImageSize ->
Tiny]], "MouseClicked" :> (col =
col /. Black -> White, White -> Black)]], n^2], n]]
here is the result
New contributor
edited 5 mins ago
New contributor
answered 45 mins ago
shrap
664
664
New contributor
New contributor
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
add a comment |Â
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
Is there a way to get the information out of the picture e.g. 0,0,0,1,1,1,0,1,0 for a 3x3 grid?
â gilianzz
9 mins ago
add a comment |Â
gilianzz is a new contributor. Be nice, and check out our Code of Conduct.
gilianzz is a new contributor. Be nice, and check out our Code of Conduct.
gilianzz is a new contributor. Be nice, and check out our Code of Conduct.
gilianzz is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185240%2fcoloring-a-square-grid-by-clicking%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password