thanks Charles,
Def is great!
Question: (vector4i circ[50]) is (circ[50] as vector4i ?)
what type has sys ?
and what are variables without any type?
Sleep under 10 msec has no effect!
what we need is a command like LimitFrame(). QueryPerformanceCounter would be good for it!
Peter
and here something for the users brains.
IndexBase 0
Include Once "Win_C.inc"
Include Once "Win_D.inc"
Include Once "Win_G.inc"
Function WndProc(byval hWnd as long,byval wMsg as long, byval wParam as long,byval lparam as long) as long callback
if wMsg = WM_CREATE
'
elseif wMsg = WM_PAINT
'
elseif wMsg = WM_MOUSEMOVE
xMouse = LoWord(lParam)
yMouse = HiWord(lParam)
InValidateRect hwnd,0,0
'
elseif wMsg = WM_DESTROY
PostQuitMessage 0
else
Function = DefWindowProc hWnd,wMsg,wParam,lParam
endif
End Function
Declare Function LoadPicture(byval pfile as string) as long
Declare Function DrawToImage(byval PicHdc As Long, byval x1 As Long, byval y1 As Long, byval w as long, byval h as long)
Declare Function FreePicture()
Dim jc,bHdc,iHdc,dir,pHnd(10),pHdc(10) as long
Dim s1,s2,s3,s4,s5,s6,s7,s8 as long
SetWindow "HappyShow 2010",320,264,WS_DLGFRAME
bHdc = SetBuffer WinWidth,WinHeight
iHdc = CreateImage 2560,264
s1 = LoadPicture "pics/christball320x240.bmp"
s2 = LoadPicture "pics/snowman320x240.bmp"
s3 = LoadPicture "pics/wintersnow320x240.bmp"
s4 = LoadPicture "pics/christmas320x240.bmp"
s5 = LoadPicture "pics/tannen320x240.bmp"
s6 = LoadPicture "pics/newtree320x240.bmp"
s7 = LoadPicture "pics/morewinter320x240.bmp"
s8 = LoadPicture "pics/happy320x240.bmp"
DrawToImage s1,0,0,320,240
DrawToImage s2,320,0,320,240
DrawToImage s3,640,0,320,240
DrawToImage s4,960,0,320,240
DrawToImage s5,1280,0,320,240
DrawToImage s6,1600,0,320,240
DrawToImage s7,1920,0,320,240
DrawToImage s8,2240,0,320,240
While EscKey() =0
CopyImageRect iHdc,jc,0,320,240,0,0
if dir =0
jc = jc +2
if jc >=2240 Then dir =1
elseif dir =1
jc = jc -2
if jc <=0 Then dir =0
endif
DoEvents
FlipBuffer
Sleep 10
Wend
FreeBuffer
FreeImages
FreePicture
ExitProcess 0
Function LoadPicture(byval pfile as string) as long
static co as long
co += 1
pHnd(co) = LoadImage(0, pfile, 0, 0, 0, 16)
pHdc(co) = CreateCompatibleDC(hdc)
SelectObject pHdc(co), pHnd(co)
Function = pHdc(co)
End Function
Function FreePicture()
For c=1 To 8
DeleteObject pHnd(c): DeleteDC pHdc(c)
Next
End Function
Function DrawToImage(byval PicHdc As Long,byval x1 As Long, byval y1 As Long, byval w as long, byval h as long)
BitBlt iHdc, x1, y1, w, h, PicHdc, 0, 0, &hCC0020
End Function
[attachment deleted by admin]