Winamp是画上去的。实例:
procedure TWinampSkin.SetTitle(const Value: string);
begin
FTitle := Value;
TextScrollPos:=0;
if titlelength>30 then
ScrollTimer.Enabled := True;
PaintTitle;
//画标题栏
end;
procedure TWinampSkin.PaintTitle;
var text:string;
begin
if systemtitle='' then
text:=title
else
text:=systemtitle;
//给标题栏赋值
TextBMP.Canvas.Brush.color:=clBlack;
TextBMP.Canvas.FillRect(rect(0,0,155,10));
//画布区域
TitleLength:=TextOut(TextBMP.Canvas,Title,0,0,[]);
Canvas.CopyRect(rect(110,27,265,33),skmain.canvas,rect(110,27,265,33));
if Length(Text)>31 then
begin
if abs(TextScrollPos) >= TitleLength then
TextScrollPos:=0;
//循环
Canvas.CopyRect(rect(110,27,265,33),textbmp.canvas,rect(TextScrollPos,0,TextScrollPos+155,6));
if TextScrollPos+155 > TitleLength then
// nach links
Canvas.CopyRect(rect(110+Titlelength-TextScrollPos,27,265,33),textbmp.canvas,rect(0,0,265-(110+TitleLength-TextScrollPos),6));
if TextScrollPos < 0 then
// nach rechts
if TextScrollPos < -155 then
Canvas.CopyRect(rect(110,27,265,33),textbmp.canvas,rect(titlelength+textscrollpos,0,titlelength+textscrollpos+155,6))
else
Canvas.CopyRect(rect(110,27,110-textscrollpos,33),textbmp.canvas,rect(titlelength+textscrollpos,0,titlelength,6));
end else
TextOut(Canvas,Text,110,27,[]);
end;
procedure TWinampSkin.TextTimer(Sender: TObject);
begin
TextScrollPos:=TextScrollPos+5;
PaintTitle;
end;