使用Delphi 制作无闪烁的动画效果
代码说明:
使用Delphi 制作无闪烁的动画效果,如何实现不闪烁的动画呢?这个例子或许能找到一些答案:部分代码如下: var x,i: Integer; dir,run: Boolean; begin b := TBitMap.Create; b.Width := AnimWindow.Width; b.Height := 32; b.Canvas.Pen.Color := clBtnFace; b.Canvas.Brush.Color := clBtnFace; b.Canvas.Rectangle(0,0,AnimWindow.Width,32); run := True; dir := False; x := 0; while run do for i := 0 to AnimWindow.ImageList1.Count-1 do begin b.Canvas.Rectangle(0,0,AnimWindow.Width,32); AnimWindow.ImageList1.Draw(b.Canvas,x,0,i); Synchronize(DrawAnimPic); Sleep(AnimWindow.SpinEdit1.Value); if (x = 0) or (x = 300) then dir := not dir; if dir then Inc(x) else Dec(x); end; b.Free; end;
下载说明:请别用迅雷下载,失败请重下,重下不扣分!