Computer Science Canada how do i draw the olympic rings?? |
Author: | ecookman [ Wed Oct 15, 2008 10:07 am ] |
Post subject: | how do i draw the olympic rings?? |
ok... i am wondering how i would go about trying to draw the olympic rings. this is a project i am working on for the draw function in turing, soooo... I don't want anyone giving me the answer, just a little something to start me off thanks for the help |
Author: | Insectoid [ Wed Oct 15, 2008 11:11 am ] |
Post subject: | RE:how do i draw the olympic rings?? |
Draw.oval a bunch of times? Draw.Arc would work too. |
Author: | ecookman [ Wed Oct 15, 2008 11:27 am ] |
Post subject: | RE:how do i draw the olympic rings?? |
thanks but i am not sure what you mean could you give me an example please? |
Author: | Euphoracle [ Wed Oct 15, 2008 12:16 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
He means "use Draw.Oval to draw ovals on the screen in the correct positions." It doesn't get any more clear than that ![]() |
Author: | andrew. [ Wed Oct 15, 2008 2:35 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
Look up Draw.Oval in Turing's Help (press F10 in Turing). That will explain everything. |
Author: | ecookman [ Wed Oct 15, 2008 4:15 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
yes but how do i use it, could someone give me a sample because i am completly lost and my help (f10) doesn't work |
Author: | ecookman [ Wed Oct 15, 2008 4:17 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
yes but how do i use it, could someone give me a sample because i am completly lost and my help (f10) doesn't work |
Author: | The_Bean [ Wed Oct 15, 2008 6:31 pm ] | ||
Post subject: | Re: how do i draw the olympic rings?? | ||
|
Author: | ecookman [ Thu Oct 16, 2008 6:57 am ] |
Post subject: | RE:how do i draw the olympic rings?? |
thankyou The Bean that solve my problem and thank you for showing me how to use it instead of telling me the command and solving my question that was exactly what i was looking for! ![]() |
Author: | ecookman [ Thu Oct 16, 2008 8:03 am ] |
Post subject: | RE:how do i draw the olympic rings?? |
i finished them here is what the code is thanks for help i thought you should see my end result! %drawoval (centerX, centerY, radiusX, radiusY, colour) %toptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptop drawfilloval (200, 200, 30, 30, brightblue) %outer ring drawfilloval (200, 200, 20, 20, white)%inner white to make ring drawfilloval (275, 200, 30, 30, black)%outer ring drawfilloval (275, 200, 20, 20, white)%inner white to make ring drawfilloval (350, 200, 30, 30, brightred) drawfilloval (350, 200, 20, 20, white) %toptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptoptop %bottombottombottombottombottombottombottombottombottombottombottombottom drawfilloval (237, 166, 40, 40, yellow)%outer ring drawfilloval (237, 166, 30, 30, white)%inner white to make ring drawfilloval (320, 166, 40, 40, green)%outer ring drawfilloval (320, 166, 30, 30, white)%inner white to make ring |
Author: | birajgauli [ Tue Mar 09, 2010 4:39 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
Try this ... i did it in Netbeans and it worked well.... /** * Assignment # 4 * input: none * output: display 5 olympics rings in full color with a text * @author biraj */ import javax.swing.JApplet; import java.awt.*; import java.awt.geom.*; import java.awt.Stroke; import java.awt.Font; public class NewJApplet extends JApplet { // Constructing the 5 rings using a new constructor private Ellipse2D.Double ring1= new Ellipse2D.Double(80., 30., 200., 200.); private Ellipse2D.Double ring2= new Ellipse2D.Double (320.,30.,200.,200.); private Ellipse2D.Double ring3= new Ellipse2D.Double (560.,30.,200.,200.); private Ellipse2D.Double ring4= new Ellipse2D.Double (200.,145.,200.,200.); private Ellipse2D.Double ring5= new Ellipse2D.Double (440.,145.,200.,200.); public void paint (Graphics canvas) { //instantiating the stroke and setting the size to 15 Stroke stroke = new BasicStroke(15); //casting the canvas to type canvas2D Graphics2D canvas2D = (Graphics2D) canvas; //applying the stroke setting to the canvas canvas2D.setStroke(stroke); //setting the color to blue canvas2D.setColor(Color.blue); //drawing the blue ring canvas2D.draw(ring1); //setting the color to black canvas2D.setColor(Color.black); //drawing the black ring canvas2D.draw(ring2); //setting the color to red canvas2D.setColor(Color.red); //drawing the red ring canvas2D.draw(ring3); //setting the color to yellow canvas2D.setColor(Color.yellow); //drawing the yellow ring canvas2D.draw(ring4); //setting the color to green canvas2D.setColor(Color.green); //drawing the green ring. canvas2D.draw(ring5); canvas2D.setColor (Color.black); //setting a custom font canvas2D.setFont(new Font("TimesRoman", Font.PLAIN, 60)); //drawing the string onto the canvas2D canvas2D.drawString("2010 Winter Olympics",170,420); } }[color=darkgreen][/color][/font] |
Author: | Insectoid [ Tue Mar 09, 2010 6:36 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
Birajgauli, replying to Turing Help posts from a year and a half a year ago with a response to the question is not helping anyone. This question was resolved ages ago, and even if it wasn't, it doesn't matter now. It's even less useful that you responded with a Java solution when the OP was using Turing, AND it is in the Turing help forum. I'm even more disturbed because this is your first *counted* post - leading me to believe that you made an account purely to respond to a dead topic. Please, if the OP hasn't responded to his own thread in more than a week after the last response, it's a dead thread and doesn't bear reviving. I'd post my necro card, but I promised to refrain. |
Author: | rdrake [ Tue Mar 09, 2010 7:58 pm ] |
Post subject: | RE:how do i draw the olympic rings?? |
Couldn't agree more, locked. |