home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 November / CPNL0711.ISO / beeld / screen / hcf.exe / Basic / Basic_Image_030_Video_Output_Warp.bas < prev    next >
BASIC Source File  |  2004-03-29  |  1KB  |  47 lines

  1. Sub subOut( v as integer )
  2.     image_out  = CreateImage( 1,1 )
  3.     ret = Image(image_out).Open( "c:\\temp\\img\\notebook.jpg" )
  4.     Image(image_out).DrawImageWarp( 105,81, 242,81 , 280,172, 147,201, v )
  5.     Image(image_out).PutVideo()
  6.     Image(image_out).Delete()
  7. EndSub
  8.  
  9. w = 1024/2
  10. h = 768/2
  11. FramesPerSecond = 15
  12. compress = 15
  13.  
  14. filename = "c:\\temp\\test" + compress + ".avi"
  15. print filename
  16. rc = OpenOutputVideo( filename, w,h, FramesPerSecond, compress )
  17. if rc <> 0 Then
  18.     image_old  = CreateImage( 1,1 )    
  19.     image_fade = CreateImage( 1,1 )    
  20.     i = 0
  21.     File.Find( "c:\\temp\\tttt\\*.jpg" )    
  22.     For fi = 0 To File.NumberOfElements - 1
  23.         ret = Image(image_fade).Open( File( fi ).Path )    
  24.         Print i + 1, " ret: ", ret, " ", File( fi ).Path
  25.         Image(image_fade).Resample(w,h)
  26.         if ret > 0 Then
  27.             If i > 0 Then
  28.                 for j = 0 to 255 step (255/FramesPerSecond/2)
  29.                     Image(0).CopyFrom( image_old )
  30.                     Image(0).DrawImageFade( 0,0,   j, image_fade )
  31.                     subOut(0)
  32.                 Next
  33.             EndIf
  34.             Image(image_old).CopyFrom( image_fade )
  35.             i = i + 1
  36.         EndIf
  37.         For j = 0 to (2*FramesPerSecond)
  38.             subOut(image_fade)
  39.         Next
  40.         Redraw()
  41.     Next
  42.     rc = CloseOutputVideo()
  43.     Image(image_in).Delete()
  44.     Image(image_fade).Delete()
  45. endif
  46. Print "Ende"
  47.