(首先请斑竹大人大量,把我的贴子时间留长一点)
如果我是诗人,我会为她写最美丽的诗句;
如果我是歌唱家,我会为她唱最动听的歌曲;
如果我是演员,我会为她常演最感人的影片;
如果我是老板,我会为她购买最豪华的别墅;
......
只可惜我是个程序员,我只有为她写最好(我能力范围内)的程序.
///////////////////////////////////////////
虽然我喜欢的人不喜欢我,但是我还是希望能为她编最好的程序.希望大家给个点子.
编什么样的程序好呢?要在三天之内.就请你们写个软件概要吧.
如果我是诗人,我会为她写最美丽的诗句;
如果我是歌唱家,我会为她唱最动听的歌曲;
如果我是演员,我会为她常演最感人的影片;
如果我是老板,我会为她购买最豪华的别墅;
......
只可惜我是个程序员,我只有为她写最好(我能力范围内)的程序.
///////////////////////////////////////////
虽然我喜欢的人不喜欢我,但是我还是希望能为她编最好的程序.希望大家给个点子.
编什么样的程序好呢?要在三天之内.就请你们写个软件概要吧.
解决方案 »
- ????菜鸟想加密和解密长度为2000个字节左右的字符串,要求加密后的字符长度能和加密前的差不多,加密后一下子大出好几倍的我也会,高
- 精确人事工资系统V1.2正式发布,欢迎下载试用!
- 200万条记录,5个左右的用户,用什么数据库好?
- 怎样用delphi调用WEBSERVICES请各位大哥抛砖引玉
- 有关bitbtn的numGlyph属性
- 松子,快来接分!非常感谢。
- 如何提取ADOqery数据处理异常时的错误代码?
- 为什么用ADOQuery删除完全相同的几个记录中的一个时报错,为什么?
- ☆★☆★☆★☆★MSSQL的表记录中有一字段记录全是CHAR(10)型的8位数字,我想在所有记录前加“34”,总共4000条,如何一下全改变☆★☆
- TTreeview如何为每一个节点指定不同的图标
- access数据库里有许多表,我要如何连接显示并查看?矮子兵
- 什么意思:[Error] Never-build package 'B1_Apply' requires always-build package 'dclusr'
感动ing...........
当然了,最后的情书是自己另外写的哈^_*
“永远爱你”之类肉麻的,那就很酷了!给分吧,为了爱情,祝你成功!:)unit LightSpd;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, ExtCtrls ;type
PStar =^TStar;
TStar =record
C, {color}
X,Y, {center X,Y}
W :integer;{width}
L,T,R,B, {coordiants}
S :single; {step}
end; TLightSpeedSpeed =(lsSlower,lsSlow,lsNormal,lsFast,lsFaster,lsLight);
TLightSpeedOption =(loColored,loMultiplay);
TLightSpeedOptions = set of TLightSpeedOption; TLightSpeed = class(TGraphicControl)
private
FStarsCount :byte;
FBrightness :byte;
FSpeed :TLightSpeedSpeed;
FOptions :TLightSpeedOptions;
FInterval :integer;
FCenterX,FCenterY :integer;
FActive :boolean; Timer: TTimer;
Stars: array[1..255] of tStar;
LX,LY,LS :integer; procedure SetInterval (Value :integer);
procedure SetActive (Value :boolean); protected
procedure Go(Sender: TObject);
procedure Paint; override; public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override; published
property StarsCount :byte read FStarsCount write FStarsCount default 100;
property Brightness :byte read FBrightness write FBrightness default 96;
property Speed :TLightSpeedSpeed read FSpeed write FSpeed default lsNormal;
property Options :TLightSpeedOptions read FOptions write FOptions;
property Interval :integer read FInterval write SetInterval default 50;
property Active :boolean read FActive write SetActive default false;
property ParentShowHint;
property ShowHint;
property Color default clBlack;
property ParentColor;
property Width default 200;
property Height default 160;
property Align default alNone;
property Visible;
property CenterX :integer read FCenterX write FCenterX;
property CenterY :integer read FCenterY write FCenterY;
end;procedure Register;implementationfunction Min (X,Y :integer) :integer;
begin
if X<Y then Min:=X else Min:=Y;
end;constructor TLightSpeed.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
ControlStyle := ControlStyle + [csReplicatable];
FStarsCount:=100;
FBrightness:=96;
FSpeed:=lsNormal;
FOptions:=[loColored,loMultiplay];
FInterval:=50;
FActive:=false; Width:=200;
Height:=160;
Align:=alNone;
Color:=clBlack; FCenterX:=Width div 2; FCenterY:=Height div 2;
LX:=Min(FCenterX,FCenterY); LY:=LX;
LS:=round(sqrt(LX*LX/2)); randomize;
fillchar(Stars,sizeof(Stars),$FF); Timer:=TTimer.Create(Self);
Timer.Interval:=0;
Timer.OnTimer:=Go;
end;destructor TLightSpeed.Destroy;
begin
Timer.Free;
inherited;
end;procedure TLightSpeed.SetInterval(Value :integer);
begin
if Value<>FInterval then begin
FInterval:=Value;
Timer.Interval:=FInterval;
end;
end;procedure TLightSpeed.SetActive(Value :boolean);
begin
if Value<>FActive then begin
FActive:=Value;
if FActive then Timer.Interval:=FInterval
else Timer.Interval:=0;
end;
end;{procedure TLightSpeed.SetColor(Value :tColor);
begin
if Value<>Color then begin
Canvas.Brush.Color:=Value;
Repaint;
end;
inherited;
end;
}
procedure TLightSpeed.Paint;
begin
Canvas.Brush.Color := Color;
Canvas.FillRect(Rect(0,0,Width,Height));{ Canvas.Pen.Color := clBtnShadow;
Canvas.PolyLine([Point(0,Height-1), Point(0,0), Point(Width-1,0)]); Canvas.Pen.Color := clBtnHighlight;
Canvas.PolyLine([Point(Width-1,0), Point(Width-1,Height-1), Point(0,Height-1)]);}
end;procedure TLightSpeed.Go(Sender: TObject);
var
Dot :integer;
red,green,blue :byte;
begin
LX:=Min(Height div 4,Width div 4); LY:=LX;
LS:=round(sqrt(LX*LX/2));
if not Visible and not (csDesigning in ComponentState) then exit;
for Dot:=1 to 255 do with Stars[Dot] do begin
if C<>-1 then begin
{clear line}
Canvas.Pen.Width:=W;
Canvas.Pen.Color:=Color;
Canvas.MoveTo(round(X+L),round(Y+T));
Canvas.LineTo(round(X+R),round(Y+B));
end
else begin
{define new line}
if Dot>FStarsCount then continue;
repeat
L:=random(LX)-LX div 2;
T:=random(LY)-LY div 2;
S:=sqrt(L*L+T*T);
until (S>6);
S:=1+succ(ord(FSpeed))/(S*S/LS*5);
R:=L*S*1.01; B:=T*S*1.01; {length 1 - 1.1}
blue:=random($40);
if loColored in FOptions then begin green:=random($40); red:=random($40); end
else begin green:=blue; red:=blue; end;
C:=FBrightness shl 16 + FBrightness shl 8 + FBrightness +
blue shl 16 + green shl 8 + red;
W:=1+byte(random(20)=0)+byte(random(20)=0);
end;
X:=FCenterX; Y:=FCenterY;
{draw line}
L:=L*S; R:=R*S;
T:=T*S; B:=B*S; if loMultiplay in FOptions then begin
blue := Min($FF, C shr 16 + random(round((S*S*S*S))));
if loColored in FOptions then begin
green:= Min($FF, C shr 8 and $FF + random(round((S*S*S*S))));
red := Min($FF, C and $FF + random(round((S*S*S*S))));
end
else begin green:=blue; red:=blue; end;
C:=integer(blue) shl 16 + green shl 8 + red;
end; Canvas.Pen.Width:=W; Canvas.Pen.Color:=C;
Canvas.MoveTo(round(X+L),round(Y+T));
Canvas.LineTo(round(X+R),round(Y+B)); if ((X+L<-5) or (X+L>ClientWidth+5))
or ((Y+T<-5) or (Y+T>ClientHeight+5))
then C:=-1;
end;
end;procedure Register;
begin
RegisterComponents('Samples', [TLightSpeed]);
end;end.