无聊! 实现了kugou动感歌词 原来这么简单
昨天晚上玩玩kugou 感觉无聊!
用delphi 实现了kugou动感歌词 原来这么简单
我本着 开源的精神 希望大家来一起来吧
var
H1, H2, H3: HRGN;
s: string;
TextRect: TRect;
i: Integer;
begin
s := '这只是个测试而已!';
Canvas.Font.Size := 42;
Canvas.Font.Style := [fsBold];
Canvas.Font.Name := '黑体';
TextRect.Left := 0;
TextRect.Top := 0;
TextRect.Right := TextRect.Left + Canvas.TextWidth(s);
TextRect.Bottom := TextRect.Top + Canvas.TextHeight(s);
BeginPath(Canvas.Handle);
Canvas.TextOut(TextRect.Left, TextRect.Top, s);
EndPath(Canvas.Handle);
H1 := PathToRegion(Canvas.Handle);
H2 := CreateRectRgn(TextRect.Left, TextRect.Top, TextRect.Right, TextRect.Bottom);
H3 := CreateRectRgn(0, 0, 0, 0);
CombineRgn(H3, H1, H2, RGN_XOR);
SelectClipRgn(Canvas.Handle, H3);
Canvas.Brush.Color := clRed;
Canvas.FillRect(TextRect);
for i := TextRect.Left to TextRect.Right do
begin
//Canvas.Pen.Color := RGB(Round(256 * (i + 1) / TextRect.Right - TextRect.Left + 1), 100, 50);//不用随机颜色
sleep(10);
Canvas.Pen.Color := clGreen;
Canvas.MoveTo(i, TextRect.Top);
Canvas.LineTo(i, TextRect.Bottom);
end;
SelectClipRgn(Canvas.Handle, 0);
DeleteObject(H2);
DeleteObject(H3);
[解决办法]
学习下
[解决办法]
学习,接分
[解决办法]
顶 学习一下
[解决办法]
兄弟你试下,按喝的速度再做修给我看,我就服你了
[解决办法]
不好意思写错了
按唱的速度再做给我看,我就服你了
[解决办法]
jf
[解决办法]