peter
22-02-2014, 02:37
Hello,
once again api.inc
open a canvas_window is easier now.
we have now:
OpenWindow( width, height )
Drawline( x1, y1, x2, y2, color )
examples:
Uses "ui","math"
#INCLUDE "api.inc"
OpenWindow 640, 480
Canvas_Font "arial",14, %CANVAS_FONTSTYLE_NORMAL
Single angle, cx, cy, r, na
Long i, x, y
angle=1 : cx=320 : cy=240 : r=50
Canvas_Clear 0
Canvas_Redraw
For i=0 To 20100
r=Sin(angle/100) * 200
na=((r*2*Pi)/3600) * angle
x =(Cos(na / r)*r)+cx
y =(Sin(na / r)*r)+cy
DrawPoint x,y, 4, Rgb 255,255,150
DrawPoint x,y, 2, Rgb 255,255,255
angle += .5
Next
DrawText 256,0,"Easter Flower", &HFFFFFF
Canvas_Redraw
While IsWindow(hwnd) And KeyDown(27)=0
Sleep 10
Wend
Canvas_Window End hwnd
Uses "ui"
#INCLUDE "api.inc"
OpenWindow 220, 200
Canvas_Font "arial",16, %CANVAS_FONTSTYLE_NORMAL
Randomize
Long i
Canvas_Clear &HF0C0C0
canvas_redraw
For i=1 To 12
DrawLine 10,i*15,220,i*15, Rnd(255,16777215)
Next
Canvas_Redraw
While IsWindow(hwnd) And KeyDown(27)=0
Sleep 10
Wend
Canvas_Window End hwnd
once again api.inc
open a canvas_window is easier now.
we have now:
OpenWindow( width, height )
Drawline( x1, y1, x2, y2, color )
examples:
Uses "ui","math"
#INCLUDE "api.inc"
OpenWindow 640, 480
Canvas_Font "arial",14, %CANVAS_FONTSTYLE_NORMAL
Single angle, cx, cy, r, na
Long i, x, y
angle=1 : cx=320 : cy=240 : r=50
Canvas_Clear 0
Canvas_Redraw
For i=0 To 20100
r=Sin(angle/100) * 200
na=((r*2*Pi)/3600) * angle
x =(Cos(na / r)*r)+cx
y =(Sin(na / r)*r)+cy
DrawPoint x,y, 4, Rgb 255,255,150
DrawPoint x,y, 2, Rgb 255,255,255
angle += .5
Next
DrawText 256,0,"Easter Flower", &HFFFFFF
Canvas_Redraw
While IsWindow(hwnd) And KeyDown(27)=0
Sleep 10
Wend
Canvas_Window End hwnd
Uses "ui"
#INCLUDE "api.inc"
OpenWindow 220, 200
Canvas_Font "arial",16, %CANVAS_FONTSTYLE_NORMAL
Randomize
Long i
Canvas_Clear &HF0C0C0
canvas_redraw
For i=1 To 12
DrawLine 10,i*15,220,i*15, Rnd(255,16777215)
Next
Canvas_Redraw
While IsWindow(hwnd) And KeyDown(27)=0
Sleep 10
Wend
Canvas_Window End hwnd