bitmap問題,可以幫我把這個動畫中加上背景嗎? |
尚未結案
|
Marco-SUN
一般會員 ![]() ![]() 發表:5 回覆:8 積分:2 註冊:2004-04-10 發送簡訊給我 |
我跟書上寫了個火炎動畫,卻背景只有黑色......我想有其他背景.
這本畫內容非淺,我連日思考研究,弄得消化不良,
邏請高手指點﹗ 主要原代碼: var
w,h: Integer;
Alpha: Integer;
Firemat: Array of byte;
Pallette: Array [0..(256*3-1)] of Byte;
SrcBMP: TBitmap;
FireBMP: TBitmap;
procedure init;
procedure Render;
------------------------------------
procedure Tflame.init;
var
i :integer;
begin
SrcBMP := TBitmap.Create;
SrcBMP.Assign(form1.Image1.Picture.Bitmap);
SrcBMP.PixelFormat := pf24bit; fireBMP := TBitmap.Create;
fireBMP.Assign(form1.Image1.Picture.Bitmap);
fireBMP.PixelFormat := pf24bit; w := FireBMP.Width;
h := FireBMP.Height;
Alpha := 30;
SetLength(Firemat,w*(h+10)); Randomize; for i := 0 to 85 do
begin
Pallette[i*3] := 0;
Pallette[i*3+1] := 0;
Pallette[i*3+2] := i*3;
end;
for i := 1 to 85 do
begin
Pallette[(85+i)*3] := 0;
Pallette[(85+i)*3+1] := i*3;
Pallette[(85+i)*3+2] := 255;
end;
for i := 1 to 85 do
begin
Pallette[(170+i)*3] := i*3;
Pallette[(170+i)*3+1] := 255;
Pallette[(170+i)*3+2] := 255;
end;
end; Procedure Tflame.Render;
var
i,k,x,y,pos :Integer;
firechance :Integer;
Firewidth: Integer;
r,g,b,clr: Integer;
src,dest: PByteArray;
begin
FireChance := 10;
for i := 0 to w-1 do
Firemat[w+i] := 0; x := 0;
while x
|
mustapha.wang
資深會員 ![]() ![]() ![]() ![]() ![]() 發表:89 回覆:409 積分:274 註冊:2002-03-13 發送簡訊給我 |
|
Marco-SUN
一般會員 ![]() ![]() 發表:5 回覆:8 積分:2 註冊:2004-04-10 發送簡訊給我 |
|
mustapha.wang
資深會員 ![]() ![]() ![]() ![]() ![]() 發表:89 回覆:409 積分:274 註冊:2002-03-13 發送簡訊給我 |
|
Marco-SUN
一般會員 ![]() ![]() 發表:5 回覆:8 積分:2 註冊:2004-04-10 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |