PDA

View Full Version : Linux Pingi Picture Show



peter
17-02-2014, 22:18
Hi,

Funny picture show for you.


Uses "ui"
#INCLUDE "api.inc"


DWord hwnd = Canvas_Window("api_app",xMid(640),yMid(480),640,480)
Canvas_Attach(hwnd,0,%TRUE)
DWord hdc = Canvas_GetDC()
Canvas_Font "verdana",16, %CANVAS_FONTSTYLE_NORMAL


Long pic, but, z, x, y, n, i, m
Single v, w
Dim a(8) As Long


For i=1 To 5
a(i) = Rnd(0,6)
Next

pic = LoadIcon "icon/linuxstrip.ani"
but = LoadIcon "icon/marshbutterfly.ani"


x = (640-96)/2
y = (480-96)/2
m = 1


While IsWindow(hwnd) And Keydown(%VK_ESCAPE)=0
Canvas_Clear Rgb 240,240,240
For i=0 To 640 Step 128
DrawIcon hdc,but,i,342,128,128,a(m)
m = m+1
Next
m =1
DrawIcon hdc,pic,x,y,96,96,z

v +=.1
If v >=6 Then
v = 0
z +=1
If z=57 Then z=0
End If

w +=.2
If w >=1 Then
w = 0
For i=1 To 5
a(i) +=1
If a(i) = 8 Then a(i)=0
Next
End If

n = z+1
DrawText 272,150,"Picture " & n, &h8080FF

Canvas_Redraw
Sleep 10
Wend
Canvas_Window End