⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 位图的淡入 (2001年1月8日).txt

📁 自己对DELPHI学习的一点体会
💻 TXT
字号:
位图的淡入 (2001年1月8日) 

网友更新  分类:多媒体   作者:阎 磊  推荐:yanlei   阅读次数:597  
(http://www.codesky.net)  

--------------------------------------------------------------------------------
在form1上放入Image1、Button1,装入bmp位图,设置Autosize:=true,在Button1的Click编写如下事件:
procedure TForm1.Button1Click(Sender: TObject);
var
x,y,i: integer;
ptr : PByteArray;
begin
image1.Picture.Bitmap.PixelFormat:=pf24bit;
for i := 1 to 255 do
begin
for y := 0 to image1.Height - 1 do
begin
ptr := image1.Picture.Bitmap.ScanLine[y];
for x := 0 to ((image1.Width *3) - 1) do
begin
if i<126 then
begin
if ptr[x] > 1 then ptr[x] := ptr[x] - 2;//2用来调整速度
end
else //后部分加快速度
if ptr[x] > 9 then ptr[x] := (ptr[x] - 10);
end;

end;

Canvas.Draw(0,0,image1.Picture.Bitmap);
Application.ProcessMessages;
end;

end;

 
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -