This code will play Movies in ASCII (BlitzPlus compatible):


AppTitle "ASCII MoviePlayer - F1 for FPS" Graphics 640, 480, 32, 2 SetBuffer BackBuffer() Global FPS#, FPSTime Global file$ = RequestFile("", "avi") Global movie% = OpenMovie(file$) buffer% = CreateImage(640, 480) asciiimage% = CreateImage(640, 480) While Not KeyHit(1) SetBuffer ImageBuffer(buffer%):Cls DrawMovie(movie%, 0, 0, ImageWidth(buffer%), ImageHeight(buffer%)) ImageToChars(buffer%, asciiimage%) SetBuffer FrontBuffer() Cls DrawImage asciiimage%, 0, 0 Color 255, 255, 255 If KeyDown(59) Then Text 5, 5, "FPS: " + Int(FPS) Flip CountFPS() Wend End Function ImageToChars(source%, target%, colors% = True) Local chars$ = " .,:`;'^" + Chr(34) + "<>\-/_!~=?)(|t+i7{j}lv]%[1cf32Jr$CuIyz9o6wTna5sk&VY40LO8mG*hexSgApqbZdUPQFDXKW#RNEHBM@" Local w% = 0, char$ = "", argb%, red%, green%, blue% For i = 1 To Len(chars$) If StringWidth(Mid$(chars$, i, 1)) > w% Then w% = StringWidth(Mid$(chars$, i, 1)) Next LockBuffer ImageBuffer(source%) Local buffer% = GraphicsBuffer() SetBuffer ImageBuffer(target%) Cls For y = 0 To (ImageHeight(source%) / FontHeight()) - 1 For x = 0 To (ImageWidth(source%) / w%) - 1 argb% = ReadPixelFast((x + .5) * w%, (y + .5) * FontHeight(), ImageBuffer(source%)) red% = (argb Shr 16) And $FF green% = (argb Shr 8) And $FF blue% = argb And $FF col# = (Float red + green + blue) / (3 * 255) If colors% Then Color red, green, blue char$ = Mid$(chars$, (Len(chars$) - 1) * col# + 1, 1) Text x% * w%, y% * FontHeight(), char$ Next Next SetBuffer buffer% UnlockBuffer ImageBuffer(source%) End Function Function CountFPS() FPS# = 1000.0 / (MilliSecs() - fpstime) FPSTime = MilliSecs() End Function