我写了个程序,可以做到将一张图片渐渐变成黑色的,但是当想将该黑色重新还原成图片时,却只能在该过程中变亮最后仍然是黑色的。各位高手,应该怎样解决啊,希望给出代码。谢谢先了。
解决方案 »
- 询问一下这段代码中的几个词的意思?
- Undeclared identifier: 'ActiveControl'
- 请教!两个FORM访问一张ACCESS表时,出现错误!
- 如何让子另一个窗体显示在主窗体的一个固定区域,并且子窗体最大化后还在这个区域?谢谢!
- 请问各位大虾,在delphi中怎样处理四舍五入的小数点?
- 请教饼图如何实现
- 我用TOleContainer嵌入MAX格式的图片后,怎样打印这个打开的图片?
- 我截获了ctrl+c,可我还是希望复制成功,怎么办?在线等候
- 怎样使ehlib中的Dbgrideh的列里的值垂直居中?
- 小问题!20分也该够了呀,我也没分啦!
- 谁给讲讲多线程!进着有分!
- 关于目录加密的问题
var
BytesPor: integer; //定义变量,存储图片的宽
wei,hei: integer;
p1: pByteArray; //定义变量,存储象素
countar: integer;
begin
BytesPor := Abs ( Integer(BMP.Picture.Bitmap.ScanLine[1])-
Integer(BMP.Picture.Bitmap.ScanLine[0]));
//得到图片的宽度 for countar := 1 to 256 do
begin
for hei := 0 to BMP.Picture.Bitmap.Height - 1 do
//从上到下进行扫描
begin
P1 := BMP.Picture.Bitmap.ScanLine[hei];
//得到每一行中的各个象素
for wei := 0 to BytesPor - 1 do
if P1^[wei] >0 then P1^[wei] := P1^[wei]-1;
//象素的RGB值-1
end;
Sleep(Pausetime); // 暂停指定的时间
BMP.Refresh; // 更新原来的图片
end;
end;procedure Re_Fade(const BMP:TImage; BMP_TEMP : TImage;Pausetime:integer);
var
BytesPor: integer; //定义变量,存储图片的宽 wei,hei: integer;
p1: pByteArray; //定义变量,存储象素
p1_temp : pByteArray;
countar: integer;
begin
BytesPor := Abs ( Integer(BMP.Picture.Bitmap.ScanLine[1])-
Integer(BMP.Picture.Bitmap.ScanLine[0]));//得到图片的宽度 for countar := 1 to 256 do
begin
for hei := 0 to BMP.Picture.Bitmap.Height - 1 do
//从上到下进行扫描
begin
P1 := BMP.Picture.Bitmap.ScanLine[hei];
p1_temp:= BMP_TEMP.Picture.Bitmap.ScanLine[hei];//得到原图象素值
//得到每一行中的各个象素
for wei := 0 to BytesPor - 1 do
if (P1^[wei] <255) and (P1^[wei]<p1_temp^[wei]) then P1^[wei] := P1^[wei]+1
else
P1^[wei]:=p1_temp^[wei];
//象素的RGB值+1
end;
Sleep(Pausetime); // 暂停指定的时间
BMP.Refresh; // 更新原来的图片
end;
end;