Unlike others that frequent this site, I will not tell you to do a better search on this web site
Instead, if you are intrested with the DLL I found, go here to pick it up:
http://www.studiox64.com/blitzavi.php
Then here is an example of how to use it:
(Note: I cannot take any credit for the integration of the DLL into DBPro - that goes to The Tiger, but I can take credit for the example using his code
`Timer For Different CPU Speeds
Global LastTime as Integer
Global GameSpeed as Float
Global GameSpeedAdjustment as Float
#CONSTANT TRUE = 1
#CONSTANT FALSE = 0
Rem Do We Need To Create Frame Files? (True/False)
#CONSTANT CreateFrameOutput = 1
Rem Will Frame Files Have Time Format In Name? (Frame 00.00.00.00 vs. Frame 000001) (True/False)
#CONSTANT FrameNameMode = 1
Rem What Is Type Of File To Create?
#CONSTANT FrameOutPutFileType = "bmp"
#CONSTANT FrameSpeed = 45
Global FrameNumber as Integer
Global FrameName as String
`For Demo Purposes Only
Global SetupBackgroundCounter As Float
Global SetupBackgroundDir As Integer
Global SetupBackgroundDir2 As Integer
Global SetupCameraCounter As Float
Global SetupCameraDir As Integer
Global NumberOfSpheres as Integer
Global MoveStyle As Integer
Type SphereInfo
Size As Float
Rows As Integer
Cols As Integer
ML As Float
MR As Float
MU As Float
MD As Float
MRP As Float
MRN As Float
ChangeRate as Integer
Direction as Integer
Counter as Float
EndType
Type LightInfo
RedVal as Integer
GreenVal as Integer
BlueVal as Integer
PosX as Float
PosY as Float
PosZ as Float
DirX as Integer
DirY as Integer
DirZ as Integer
DistX as Float
DistY as Float
DistZ as Float
EndType
Dim Spheres() as SphereInfo
Dim Lights(6) as LightInfo
Global ICamera as SphereInfo
`Do Setup Of Display Mode
If Check Display Mode (720,480,32)
Set Display Mode 720,480,32
Else
Set Display Mode 720,480,16
EndIf
`Change Mouse 0
Hide Mouse
Hide Light 0
`Initial DB Settings - This Must Happen Before ChooseFile
sync on
sync rate 0
Randomize Timer()
SetupBackgroundCreate()
GameSpeedEqualiser()
`Need To Add Stuff To Prevent Same Process Launching Again And Need To Watch For Other
`Stuff From Windows
FrameNumber = 0
FrameName = ""
`Run For 3 Minute
MaxFrames = (60*30) * 3
NewFileFrame = 15*30
FrameCounter = 0
FrameNumber = 0
FileNumber = 1
CreateAviFile("MyMovie","MyMovie.avi",34,"Frame.bmp",1,0)
Do
If FrameCounter => NewFileFrame
CloseAviFile()
FileNumber = FileNumber + 1
CreateAviFile("MyMovie","MyMovie" + str$(FileNumber) +".avi",34,"Frame.bmp",1,0)
FrameCounter = 0
EndIf
AppSync()
If CreateFrameOutput
Get Image 1, 0,0,720,480,1
save image "Frame.bmp",1
WriteImageToAviFile()
Delete Image 1
EndIf
FrameNumber = FrameNumber + 1
FrameCounter = FrameCounter + 1
If FrameNumber => MaxFrames
`Produce End File
CloseAviFile()
end
EndIf
loop
Function AppSync()
SetupRunBackground()
Sync
GameSpeedEqualiser()
EndFunction
Function GameSpeedEqualiser()
Time=Timer()
GameSpeed = FrameSpeed:rem (Time - LastTime ) : Rem * GameSpeedAdjustment
LastTime=Time
EndFunction
Function SetupBackgroundCreate()
SpheresGenerate()
For I = 1 to NumberOfSpheres
Make Object Sphere I, Spheres(I).Size, Spheres(i).Rows, Spheres(i).Cols
If I = 1
`Make A Cube Or Something To Active Camera Area
Set Object Specular I, RGB(0,0,0)
Set Object Specular Power I, 100
Else
Ghost Object On I,1
EndIf
Set Object Cull I,0
Next I
LightsGenerate()
For I = 1 to 6
Make Light I
LightsPosition(I)
LightsColor(I)
Next I
` MoveStyle = Rnd(1)+1
MoveStyle = 1
Position Camera 0,0,0
If MoveStyle = 1
ICamera.ML = .01
ICamera.MR = .01
ICamera.MU = .01
ICamera.MD = .01
ICamera.MRP = .01
ICamera.MRN = .01
EndIf
` ICamera.ChangeRate = Rnd(100)+1
ICamera.ChangeRate = 50
ICamera.Counter = ICamera.ChangeRate + 1
EndFunction
Function SpheresGenerate()
NumberOfSpheres = 3
Dim Spheres(NumberOfSpheres) as SphereInfo
If MoveStyle = 2
Spheres(1).Size = 30
Spheres(1).Rows = Rnd(40)+5
Spheres(1).Cols = Rnd(40)+5
If MoveStyle = 1
Spheres(1).ML = (Rnd(100)+1)/1000.0
Spheres(1).MR = (Rnd(100)+1)/1000.0
Spheres(1).MU = (Rnd(100)+1)/1000.0
Spheres(1).MD = (Rnd(100)+1)/1000.0
Spheres(1).MRP = (Rnd(100)+1)/1000.0
Spheres(1).MRN = (Rnd(100)+1)/1000.0
EndIf
Spheres(1).ChangeRate = Rnd(100)+1
Spheres(1).Counter = Spheres(1).ChangeRate + 1
Spheres(2).Size = Rnd(20)+5
Spheres(2).Rows = Rnd(40)+5
Spheres(2).Cols = Rnd(40)+5
If MoveStyle = 1
Spheres(2).ML = (Rnd(100)+1)/1000.0
Spheres(2).MR = (Rnd(100)+1)/1000.0
Spheres(2).MU = (Rnd(100)+1)/1000.0
Spheres(2).MD = (Rnd(100)+1)/1000.0
Spheres(2).MRP = (Rnd(100)+1)/1000.0
Spheres(2).MRN = (Rnd(100)+1)/1000.0
EndIf
Spheres(2).ChangeRate = Rnd(100)+1
Spheres(2).Counter = Spheres(2).ChangeRate + 1
Spheres(3).Size = Rnd(5)+5
Spheres(3).Rows = Rnd(40)+5
Spheres(3).Cols = Rnd(40)+5
If MoveStyle = 1
Spheres(3).ML = (Rnd(100)+1)/1000.0
Spheres(3).MR = (Rnd(100)+1)/1000.0
Spheres(3).MU = (Rnd(100)+1)/1000.0
Spheres(3).MD = (Rnd(100)+1)/1000.0
Spheres(3).MRP = (Rnd(100)+1)/1000.0
Spheres(3).MRN = (Rnd(100)+1)/1000.0
EndIf
Spheres(3).ChangeRate = Rnd(100)+1
Spheres(3).Counter = Spheres(3).ChangeRate + 1
Else
Spheres(1).Size = 30
Spheres(1).Rows = 5
Spheres(1).Cols = 7
Spheres(1).ML = .025
Spheres(1).MR = .025
Spheres(1).MU = .025
Spheres(1).MD = .025
Spheres(1).MRP = .025
Spheres(1).MRN = .025
Spheres(1).ChangeRate = 75
Spheres(1).Counter = 76
Spheres(2).Size = 20
Spheres(2).Rows = 13
Spheres(2).Cols = 9
Spheres(2).ML = .015
Spheres(2).MR = .015
Spheres(2).MU = .015
Spheres(2).MD = .015
Spheres(2).MRP = .015
Spheres(2).MRN = .015
Spheres(2).ChangeRate = 50
Spheres(2).Counter = 51
Spheres(3).Size = 5
Spheres(3).Rows = 36
Spheres(3).Cols = 36
Spheres(3).ML = .009
Spheres(3).MR = .009
Spheres(3).MU = .009
Spheres(3).MD = .009
Spheres(3).MRP = .009
Spheres(3).MRN = .009
Spheres(3).ChangeRate = 100
Spheres(3).Counter = 101
EndIf
EndFunction
Function LightsGenerate()
LightsInfoSet(1, 200,0,0,255,0,0)
LightsInfoSet(2, 0,300,0,0,255,0)
LightsInfoSet(3, 0,0,400,0,0,255)
LightsInfoSet(4, -200,0,0,0,192,32)
LightsInfoSet(5, 0,-300,0,32,0,192)
LightsInfoSet(6, 0,0,-400,192,32,0)
` LightsInfoSet(1, -200,0,0,255,0,0)
` LightsInfoSet(2, 0,-200,0,0,255,0)
` LightsInfoSet(3, 0,0,-200,0,0,255)
` LightsInfoSet(4, 200,0,0,0,192,32)
` LightsInfoSet(5, 0,200,0,32,0,192)
` LightsInfoSet(6, 0,0,200,192,32,0)
EndFunction
Function LightsInfoSet(LightNum, X#, Y#, Z#, R, G, B)
Lights(LightNum).RedVal = R
Lights(LightNum).GreenVal = G
Lights(LightNum).BlueVal = B
Lights(LightNum).PosX = X#
Lights(LightNum).PosY = Y#
Lights(LightNum).PosZ = Z#
Lights(LightNum).DirX = (X#<>0)
Lights(LightNum).DirY = (Y#<>0)
Lights(LightNum).DirZ = (G#<>0)
EndFunction
Function LightsColor(LightNum)
Color Light LightNum, Lights(LightNum).RedVal, Lights(LightNum).GreenVal, Lights(LightNum).BlueVal
EndFunction
Function LightsPosition(LightNum)
Position Light LightNum, Lights(LightNum).PosX, Lights(LightNum).PosY, Lights(LightNum).PosZ
EndFunction
Function SetupRunBackground()
`Do Something In The Background?
`For Right Now (Since The Cube Has Already Been Created) Make The Cube Do Something
Cnt as Float
Cnt = GameSpeed * .01
For I = 1 To NumberOfSpheres
Spheres(I).Counter = Spheres(I).Counter + Cnt
If Spheres(I).Counter>Spheres(I).ChangeRate
Spheres(I).Counter = 0
Spheres(I).ChangeRate =Rnd(100)+1
LastDir = Spheres(I).Direction
While Int(Spheres(I).Direction/2) = Int(LastDir/2)
Spheres(I).Direction = Rnd(5)
EndWhile
If MoveStyle = 2
Select Spheres(I).Direction
Case 0
Spheres(I).ML = Spheres(I).ML + Rnd(10)/100.0
EndCase
Case 1
Spheres(I).MR = Spheres(I).MR + Rnd(10)/100.0
EndCase
Case 2
Spheres(I).MRP = Spheres(I).MRP + Rnd(10)/100.0
EndCase
Case 3
Spheres(I).MRN = Spheres(I).MRN + Rnd(10)/100.0
EndCase
Case 4
Spheres(I).MU = Spheres(I).MU + Rnd(10)/100.0
EndCase
Case 5
Spheres(I).MD = Spheres(I).MD + Rnd(10)/100.0
EndCase
EndSelect
EndIf
EndIf
If MoveStyle = 1
Select Spheres(I).Direction
Case 0
Turn Object Left I, GameSpeed * Spheres(I).ML
EndCase
Case 1
Turn Object Right I, GameSpeed * Spheres(I).MR
EndCase
Case 2
Roll Object Left I, GameSpeed * Spheres(I).MRP
EndCase
Case 3
Roll Object Right I, GameSpeed * Spheres(I).MRN
EndCase
Case 4
Pitch Object Up I, GameSpeed * Spheres(I).MU
EndCase
Case 5
Pitch Object Down I, GameSpeed * Spheres(I).MD
EndCase
EndSelect
Else
If MoveStyle = 2
Turn Object Left I, GameSpeed * Spheres(I).ML
Turn Object Right I, GameSpeed * Spheres(I).MR
Roll Object Left I, GameSpeed * Spheres(I).MRP
Roll Object Right I, GameSpeed * Spheres(I).MRN
Pitch Object Up I, GameSpeed * Spheres(I).MU
Pitch Object Down I, GameSpeed * Spheres(I).MD
EndIf
EndIf
Next I
ICamera.Counter = ICamera.Counter + Cnt
If ICamera.Counter>ICamera.ChangeRate
ICamera.Counter = 0
ICamera.ChangeRate =Rnd(100)+1
LastDir = ICamera.Direction
While Int(ICamera.Direction/2) = Int(LastDir/2)
ICamera.Direction = Rnd(5)
EndWhile
If MoveStyle = 2
Select ICamera.Direction
Case 0
ICamera.ML = ICamera.ML + Rnd(10)/1000.0
EndCase
Case 1
ICamera.MR = ICamera.MR + Rnd(10)/1000.0
EndCase
Case 2
ICamera.MRP = ICamera.MRP + Rnd(10)/1000.0
EndCase
Case 3
ICamera.MRN = ICamera.MRN + Rnd(10)/1000.0
EndCase
Case 4
ICamera.MU = ICamera.MU + Rnd(10)/1000.0
EndCase
Case 5
ICamera.MD = ICamera.MD + Rnd(10)/1000.0
EndCase
EndSelect
EndIf
For I = 1 To 6
If Lights(i).DirX <>0
If Lights(I).PosX > 500
Lights(i).DirX = -.5
Else
If Lights(I).PosX < -500
Lights(i).DirX =.5
Endif
EndIf
EndIf
If Lights(i).DirY <>0
If Lights(I).PosY > 500
Lights(I).DirY = -.5
Else
If Lights(I).PosY < -500
Lights(i).DirY = .5
EndIf
EndIf
EndIf
If Lights(i).DirZ <>0
If Lights(I).PosZ > 500
Lights(i).DirZ = -.5
Else
If Lights(I).PosZ < -500
Lights(i).DirZ = .5
EndIf
EndIf
EndIf
Lights(I).PosX = Lights(I).PosX + Lights(i).DirX
Lights(I).PosY = Lights(I).PosY + Lights(i).DirY
Lights(I).PosZ = Lights(I).PosZ + Lights(i).DirZ
LightsPosition(I)
Next I
EndIf
If MoveStyle = 1
Select ICamera.Direction
Case 0
Turn Camera Left GameSpeed * ICamera.ML
EndCase
Case 1
Turn Camera Right GameSpeed * ICamera.MR
EndCase
Case 2
Roll Camera Left GameSpeed * ICamera.MRP
EndCase
Case 3
Roll Camera Right GameSpeed * ICamera.MRN
EndCase
Case 4
Pitch Camera Up GameSpeed * ICamera.MU
EndCase
Case 5
Pitch Camera Down GameSpeed * ICamera.MD
EndCase
EndSelect
Else
If MoveStyle = 2
Turn Camera Left GameSpeed * ICamera.ML
Turn Camera Right GameSpeed * ICamera.MR
Roll Camera Left GameSpeed * ICamera.MRP
Roll Camera Right GameSpeed * ICamera.MRN
Pitch Camera Up GameSpeed * ICamera.MU
Pitch Camera Down GameSpeed * ICamera.MD
EndIf
EndIf
EndFunction
Function CurrentFrame(FrameNumber)
local I as Integer
Local S as WORD
Local M as WORD
Local H as WORD
LOCAL FTemp as Word
I = FrameNumber-( Int(FrameNumber/30) *30)
FTemp = Int(FrameNumber / 30)
S = FTemp -(INT(FTemp/60)*60)
FTemp = INT(Ftemp/60)
M = FTemp - (Int(FTemp/60)*60)
FTemp = INT(Ftemp/60)
H = FTemp - (Int(FTemp/60)*60)
Number$ = MakeString(str$(h),2,"0") + "." + MakeString(str$(M),2,"0")+ "." + MakeString(str$(S),2,"0")+ "." + MakeString(str$(I),2,"0")
EndFunction Number$
Function MakeString(StringValue$, StringLength, PadCharacter$)
sVal$ = StringValue$
While Len(sVal$) < StringLength
sVal$ = PadCharacter$ + sVal$
EndWhile
EndFunction sVal$
`Now Comes The Tigers' Stuff -
`Note: Place this area in a Different File for convience.
rem you can save an avi file directly using DB.
rem there is a three command
rem CreateAviFile(Title$,FileName$,FPS,ImageName$,CompressionDialog,OverwriteDialog)
rem WriteImageToAviFile() you must save the current frame into the ImageName$ file using BMP format
rem CloseAviFile()
rem the dll originaly was desugned for blitz basic
rem i did a simple translation of the functions
rem the blitz fie has better documentation tha this (see AVI folder)
rem see the example
rem translation by The TIGER
Function CreateAviFile(baviApplicationTitle$,baviNameOfAviFile$,baviFrameTime,baviImageName$,baviCompressionFlag,baviSuppressOverwrite)
baviBankSize = 250
rem baviBankDataIn = CreateBank(baviBankSize)
rem baviBankDataOut = CreateBank(baviBankSize)
make memblock 250,250
make memblock 251,250
For tcount = 0 To baviBankSize-1
rem PokeByte baviBankDataIn, tcount, 0
rem PokeByte baviBankDataOut, tcount, 0
write memblock byte 250,tcount,0
write memblock byte 250,tcount,0
Next tcount
If Len(baviNameOfAviFile$) > 80 Then exit prompt "ERROE !","Name Of Avi File is too long, must be 80 characters or less!" :end
For tcount = 0 To Len(baviNameOfAviFile$)-1
rem PokeByte baviBankDataIn, tcount, Asc(Mid$(baviNameOfAviFile$, tcount+1, 1))
write memblock byte 250,tcount,Asc(Mid$(baviNameOfAviFile$, tcount+1))
Next tcount
write memblock dword 250,80,baviFrameTime
If Len(baviImageName$)>79 Then end
For tcount = 0 To Len(baviImageName$)-1
rem PokeByte baviBankDataIn, tcount+84, Asc(Mid$(baviImageName$, tcount+1, 1))
write memblock byte 250,tcount+84,Asc(Mid$(baviImageName$, tcount+1))
Next tcount
If Len(baviApplicationTitle$) > 75 Then end
For tcount = 0 To Len(baviApplicationTitle$)-1
rem PokeByte baviBankDataIn, tcount+164, Asc(Mid$(baviApplicationTitle$, tcount+1, 1))
write memblock byte 250,tcount+164, Asc(Mid$(baviApplicationTitle$, tcount+1))
Next tcount
If baviCompressionFlag = 0
rem PokeByte baviBankDataIn, 240, False
write memblock byte 250,240,0
Else
rem PokeByte baviBankDataIn, 240, True
write memblock byte 250,240,1
EndIf
If baviSuppressOverwrite = 0
rem PokeByte baviBankDataIn, 241, False
write memblock byte 250,241,0
Else
rem PokeByte baviBankDataIn, 241, True
write memblock byte 250,241,1
EndIf
load dll "BlitzAvi.dll",98
show mouse
Call DLL 98,"create_avi_file",GET MEMBLOCK PTR(250),GET MEMBLOCK PTR(251)
hide mouse
endfunction result
Function WriteImageToAviFile()
if dm=0 then show mouse
Call DLL 98,"write_image_to_avi_file"
if dm=0 then hide mouse
dm=1
EndFunction result
Function CloseAviFile()
rem FreeBank baviBankDataIn
rem FreeBank baviBankDataOut
delete memblock 250
delete memblock 251
call dll 98,"close_avi_file"
delete dll 98
EndFunction result
And that's It...