画的时候不能影响视频的播放,各位老师有没有知道的?请指点一下,先谢谢啦!来者有分!

解决方案 »

  1.   

    http://blog.csdn.net/cityhunter172/category/15738.aspx
    http://blog.csdn.net/21aspnet/archive/2007/03/25/1540301.aspx
    好帖
      

  2.   

    跟画歌词是一样的意思,原理是这样.以下代码是实现在视频播放时,画歌词显示的前奏,就是几个框或几个点....
    在一张位图上画一个圈圈,或是方框,随便你.然后将位图贴到image 上,最后将图片贴到视频窗,不过要在解码时贴上去
    在定时器中贴歌词
    procedure TLrcFrm.Timer2Timer(Sender: TObject);
    begin
      Bitmap.Width:=Image1.Width;
      Bitmap.Height:=Image1.Height;
      GetCurrectXml(Bitmap,TotalTime + Timer2.Interval);  //传递的是累加时间
      TotalTime := TotalTime + Timer2.Interval;
      Bitmap.Canvas.Draw(image1.Left,image1.Top,image1.Picture.Graphic);
      Image1.Picture.Bitmap:=Bitmap;
    end;
    if (IsDrawPoint) and (XMLLineList[0].StartTime * 1000 <= CurrectTime +4000)then//当当前时间改变时,不能重画点
          begin
            PointTime := PointTime + Timer2.Interval;
            Bmp.Canvas.Brush.Style := bsClear;
            ColorRect.Top := 20;
            ColorRect.Bottom := 40;
            for i := 0 to PointCount - 1 do //由于每次都要重画,如果只画一次,会一闪而过
                                                  //当时间到一秒时,清除选定的颜色,并少画一个矫形  
            begin
              ColorRect.Left := FontLeft + i * 30;
              ColorRect.Right:= FontLeft + 20 + i * 30;
            //Image1.Canvas.Ellipse(Image1.left , 20 ,Image1.left + 20 , 40); //画圆,这个出来就是白色的....
                Bmp.Canvas.Brush.Color := clFuchsia; //画布颜色为透明色
              Bmp.Canvas.FillRect(ColorRect); //画框
            end;
            PointLeft := ColorRect.Left;
            PointRight := ColorRect.Right;        if (PointTime = 1000) and (PointCount >=0 ) then //一秒后 填充为白色,同时坐标往后移
            begin
              PointTime := 0;
              ColorRect.Left := PointLeft;
              ColorRect.Right := PointRight ;
              Bmp.Canvas.Brush.Color := clWhite;
              Bmp.Canvas.FillRect(ColorRect);
              PointLeft := PointLeft - 30;
              PointRight := PointRight - 30;
              Dec(PointCount);
              if  PointCount = 0 then
                 IsDrawPoint := false;
            end;
          end;
    上面这段代码是写在 GetCurrectXml 函数中的,楼主只要将定时器中的代码改为传递视频播放的当前时间就可以了