Computer Science Canada Not sure why it won't appear... |
Author: | bass_maniac [ Fri Sep 30, 2005 11:29 am ] | ||
Post subject: | Not sure why it won't appear... | ||
Ok, here's the code,
Basically what I want it to do is ask the user the radius of the circle and then draw a circle about the center of the screen. It checks every pixel within a box from (centerx - radius, centery - radius) to (centerx + radius, centery + radius). If that particular point is within radius distance of the center its coordinates are noted in sph1x and sph1y and that point should be drawn in red. NOTE: I did not use drawfilloval because I need to know the coordinates of every pixel in the circle (for something later on in the program.) If you know of another way to do the same thing that's easier, please let me know. |
Author: | ZeroPaladn [ Fri Sep 30, 2005 11:54 am ] |
Post subject: | a suggestion |
actually, you could use Draw.FillOval and the use What.DotColor to check to see if every pixel is the color you suggest, then put the x and y coordinates of the pixel into 2 arrays (or a 2d array if you can figure it out), that way you can call up the coordinates later in the program. try that out. |
Author: | bass_maniac [ Fri Sep 30, 2005 12:35 pm ] |
Post subject: | |
Thanks. That did work. I spent so much time thinking about this I'm suprised I didn't think of that. |
Author: | ZeroPaladn [ Fri Sep 30, 2005 1:14 pm ] |
Post subject: | :) |
lolz, its ok if you want to think "outside the box" with that crazy code you had going there, but if something simple can do something very complcated (and it hurts the brain), then why do it complicated, unless you want a challenge. |
Author: | jamonathin [ Fri Sep 30, 2005 1:43 pm ] | ||||
Post subject: | |||||
There's a problem with trying to make a bunch of dots make a circle. You'd need sind and cosd functions to do that, like so. .
And it's not a perfect circle, unless you spend way too much time on it, im shure is possible. But you can also make cool looking things from that because you can shape every pixel. . .
|
Author: | Mr. T [ Fri Sep 30, 2005 4:12 pm ] |
Post subject: | Alex's Opinion |
Your second code doesn't work. ![]() |
Author: | beard0 [ Fri Sep 30, 2005 6:56 pm ] |
Post subject: | Re: Alex's Opinion |
Pwned wrote: Your second code doesn't work. :?
Yes it does - notice where the's an emoticon? He had "28))" and it got changed on him to "2 ![]() ![]() |
Author: | Cervantes [ Fri Sep 30, 2005 8:24 pm ] |
Post subject: | Re: a suggestion |
ZeroPaladn wrote: put the x and y coordinates of the pixel into 2 arrays (or a 2d array if you can figure it out)
2 1D arrays are NOT the same as a 2D array. Unless the second dimension of the 2D array has only 2 elements, in which case they are similar. |
Author: | ZeroPaladn [ Sat Oct 01, 2005 3:51 pm ] |
Post subject: | |
really, i thought that 2d arrays and 1d arrays were the same thing, cept for the fact that you can store 2 kinds of data in a 2D array ![]() |
Author: | beard0 [ Sat Oct 01, 2005 3:57 pm ] |
Post subject: | |
Nope. A 1D array is just a list. A 2d array is like a table, so that if each index goes from 0-9, you have 100 elements in your array. |
Author: | ZeroPaladn [ Sat Oct 01, 2005 4:00 pm ] |
Post subject: | |
you learn sumthing new everyday now dont we? |