如何做出这种窗体效果?

paranoea 2001-06-08 11:08:00
如何做出这种窗体效果?就像股票分析软件中的"分析家4.0"的类似淡入淡出的效果.
...全文
84 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
say 2001-06-10
  • 打赏
  • 举报
回复
试试
AnimateWindow(handle,300,AW_HIDE or AW_CENTER);
paranoea 2001-06-10
  • 打赏
  • 举报
回复
看不明白
rh 2001-06-10
  • 打赏
  • 举报
回复
看不明白?嘿~~~~sorry~~~~
rh 2001-06-09
  • 打赏
  • 举报
回复
procedure TFormDaisy.ButtonFadeOutClick(Sender: TObject);
VAR
Bitmap : TBitmap;
i : INTEGER;
j : INTEGER;
Row : pRGBTripleArray;
RowBase: pRGBTripleArray;
step : INTEGER;
begin
Bitmap := TBitmap.Create;
TRY
Bitmap.PixelFormat := pf24bit;
Bitmap.Width := ImageRGB.Width;
Bitmap.Height := ImageRGB.Height;

FOR step := 32 DOWNTO 0 DO
BEGIN
FOR j := 0 TO Bitmap.Height-1 DO
BEGIN
RowBase := BitmapBase.Scanline[j];
Row := Bitmap.Scanline[j];

FOR i := 0 TO Bitmap.Width-1 DO
BEGIN // 32 = 2^5
Row[i].rgbtRed := (step * RowBase[i].rgbtRed ) SHR 5;
Row[i].rgbtGreen := (step * RowBase[i].rgbtGreen) SHR 5;
Row[i].rgbtBlue := (step * RowBase[i].rgbtBlue ) SHR 5
END
END;

ImageRGB.Picture.Graphic := Bitmap;

// Use API calls to avoid flicker.
// See VCL Repaint alternative in FadeIn
InvalidateRect(FormDaisy.Handle, NIL {whole window},
FALSE {don't erase background});
RedrawWindow(FormDaisy.Handle, NIL, 0, RDW_UPDATENOW);
END
FINALLY
Bitmap.Free;
END;
end;


procedure TFormDaisy.ButtonFadeInClick(Sender: TObject);
VAR
Bitmap : TBitmap;
i : INTEGER;
j : INTEGER;
Row : pRGBTripleArray;
RowBase: pRGBTripleArray;
step : INTEGER;
begin
Bitmap := TBitmap.Create;
TRY
Bitmap.PixelFormat := pf24bit;
Bitmap.Width := ImageRGB.Width;
Bitmap.Height := ImageRGB.Height;

FOR step := 0 TO 32 DO
BEGIN
FOR j := 0 TO Bitmap.Height-1 DO
BEGIN
RowBase := BitmapBase.Scanline[j];
Row := Bitmap.Scanline[j];

FOR i := 0 TO Bitmap.Width-1 DO
BEGIN // 32 = 2^5
Row[i].rgbtRed := (step * RowBase[i].rgbtRed ) SHR 5;
Row[i].rgbtGreen := (step * RowBase[i].rgbtGreen) SHR 5;
Row[i].rgbtBlue := (step * RowBase[i].rgbtBlue ) SHR 5
END
END;

// This is just as effective as the API calls.
// (See API call alternative in FadeOut.)
ImageRGB.Picture.Graphic := Bitmap;
ImageRGB.Repaint
END
FINALLY
Bitmap.Free;
END;
sweihua 2001-06-08
  • 打赏
  • 举报
回复
最好是在生成动画的软件中做.
在delphi中做也可以
用TCanvas.CopyRect就可以满足你的要求, 不过速度不一定保证
下面是某一种算法
procedure TForm1.Button2Click(Sender: TObject);
var
newbmp: TBitmap;
i,bmpheight,bmpwidth:integer;
begin
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
for i:=0 to bmpheight do
begin
Sleep(100);
newbmp.Canvas.CopyRect(Rect(0,bmpheight-i,bmpwidth,bmpheight),
image1.Canvas,
Rect(0,0,bmpwidth,i));
form1.Canvas.Draw(120,100,newbmp);
end;
newbmp.free;
end;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧