Primjer 4.1. do primjera 4.11

600 views

Published on

Naslov: Primjeri programa napisanih u Small Basicu
Autorica: Gordana Sokol

Published in: Education, Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
600
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Primjer 4.1. do primjera 4.11

  1. 1. Primjer 4.1:<br />GraphicsWindow.BackgroundColor = " Yellow" <br />GraphicsWindow.Title = " Moj prvi grafički prozor" <br />GraphicsWindow.Width = 640<br />GraphicsWindow.Height = 480<br />GraphicsWindow.Show()<br />Primjer 4.2:<br />GraphicsWindow.BackgroundColor = " Yellow" <br />GraphicsWindow.Title = " Moj prvi grafički prozor" <br />GraphicsWindow.Width = 640<br />GraphicsWindow.Height = 480<br />GraphicsWindow.Show()<br />GraphicsWindow.DrawLine(10, 10, 200, 200)<br />GraphicsWindow.DrawLine(10, 200, 200, 10)<br />Primjer 4.3:<br />GraphicsWindow.BackgroundColor = " Yellow" <br />GraphicsWindow.Title = " Moj prvi grafički prozor" <br />GraphicsWindow.Width = 640<br />GraphicsWindow.Height = 480<br />GraphicsWindow.Show()<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawLine(10, 10, 200, 200)<br />GraphicsWindow.PenColor = " Blue" <br />GraphicsWindow.DrawLine(10, 200, 200, 10)<br />Primjer 4.4:<br />GraphicsWindow.BackgroundColor = " Yellow" <br />GraphicsWindow.Title = " Moj prvi grafički prozor" <br />GraphicsWindow.Width = 640<br />GraphicsWindow.Height = 480<br />GraphicsWindow.Show()<br />GraphicsWindow.PenWidth = 10<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawLine(10, 10, 200, 200)<br />GraphicsWindow.PenColor = " Blue" <br />GraphicsWindow.DrawLine(10, 200, 200, 10)<br />Primjer 4.5:<br />GraphicsWindow.BackgroundColor = " Black" <br />GraphicsWindow.Width = 320<br />GraphicsWindow.Height = 400<br />GraphicsWindow.PenColor = " Yellow" <br />For i = 1 To 15<br />GraphicsWindow.PenWidth = i<br />GraphicsWindow.DrawLine(i * 20, 20, i * 20, 380)<br />EndFor<br />Primjer 4.6:<br />GraphicsWindow.Width = 400<br />GraphicsWindow.Height = 300<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawRectangle(20, 20, 300, 60)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillRectangle(60, 100, 300, 60)<br />Primjer 4.7:<br />GraphicsWindow.Width = 400<br />GraphicsWindow.Height = 300<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawRectangle(20, 20, 300, 60)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillRectangle(60, 100, 300, 60)<br />GraphicsWindow.DrawBoundText(20,200,100, " Klikni mišem za nastavak!" )<br />GraphicsWindow.MouseDown = OnMouseDown<br />Sub OnMouseDown<br />GraphicsWindow.Clear()<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawEllipse(20, 20, 300, 60)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillEllipse(60, 100, 300, 60)<br />EndSub<br />Primjer 4.8:<br />GraphicsWindow.Width = 400<br />GraphicsWindow.Height = 300<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawRectangle(20, 20, 300, 60)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillRectangle(60, 100, 300, 60)<br />GraphicsWindow.DrawBoundText(20,200,100, " Klikni mišem za nastavak!" )<br />GraphicsWindow.MouseDown = OnMouseDown<br />Sub OnMouseDown<br />GraphicsWindow.Clear()<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawEllipse(20, 20, 300, 60)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillEllipse(60, 100, 300, 60)<br />GraphicsWindow.DrawBoundText(20,200,100, " Klikni mišem za nastavak!" )<br />GraphicsWindow.MouseDown = OnMouseDown1<br />EndSub<br /> <br />Sub OnMouseDown1 <br />GraphicsWindow.Clear()<br />GraphicsWindow.PenColor = " Red" <br />GraphicsWindow.DrawEllipse(20, 20, 100, 100)<br />GraphicsWindow.BrushColor = " Green" <br />GraphicsWindow.FillEllipse(100, 100, 100, 100)<br />GraphicsWindow.DrawBoundText(20,200,200, " To bi bilo sve :-)!" )<br />EndSub<br />Primjer 4.9:<br />GraphicsWindow.BackgroundColor = " White" <br />GraphicsWindow.PenColor = " Blue" <br />GraphicsWindow.Width = 400<br />GraphicsWindow.Height = 400<br />For i = 1 To 100 Step 10<br />GraphicsWindow.DrawRectangle(200 - i, 200 - i, i * 2, i * 2)<br />EndFor<br />Primjer 4.10:<br />GraphicsWindow.BackgroundColor = " White" <br />GraphicsWindow.PenColor = " Purple" <br />GraphicsWindow.Width = 400<br />GraphicsWindow.Height = 400<br />For i = 1 To 200 Step 15<br />GraphicsWindow.DrawEllipse(200 - i, 200 - i, i * 2, i * 2)<br />EndFor<br />Primjer 4.11:<br />GraphicsWindow.BackgroundColor = " Black" <br />For i = 1 To 1000<br />GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()<br />x = Math.GetRandomNumber(640)<br />y = Math.GetRandomNumber(480)<br />GraphicsWindow.FillEllipse(x, y, 20, 10)<br />EndFor<br />

×