Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

star (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: Realbasic and EDI (Electronic Data Interchange)
Next thread: Re: Office


RB Database   -   tom.russell transport.alstom.com
  star   -   GAmoore aol.com

star
Date: 01.02.06 15:49 (Wed, 1 Feb 2006 14:49:14 EST)
From: GAmoore aol.com
Here is a little method that draws a star

// draw a star
function star(h as integer, k as integer, g as graphics)
const R = 9
const S = 3
const Pi = 3.14159
const Phi = .628318 // = π/5
dim i as integer
dim x(10), y(10), points(20) as integer
dim theta as single

theta = Pi / 2
for i = 1 to 10 step 2
x(i) = h + R*cos(theta)*scale
y(i) = k - R*sin(theta)*scale
theta = theta - Phi
x(i+1) = h + S*cos(theta)*scale
y(i+1) = k - S*sin(theta)*scale
theta = theta - Phi

//transfer to the point array that will be used to plot
points( 2*i -1 ) = x(i)
points( 2*i ) = y(i)
points( 2*i + 1 ) = x(i+1)
points( 2*i + 2 ) = y(i+1)
next
g.FillPolygon points


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>