F
freeloader
Unregistered / Unconfirmed
GUEST, unregistred user!
我在对两个bmp图片进行透明处理时出现的错误.
我的代码如下:
procedure TfrmMain.BlendBmp(BmpFrom, BmpTo: TBitmap; var Bmp: TBitmap;
BlendValue: Byte);
var
I, J:Integer;
P, PFrom, PToByteArray;
Value:Byte;
begin
BmpFrom.PixelFormat:=pf24bit;
BmpTo.PixelFormat:=pf24bit;
Bmp.PixelFormat:=pf24Bit;
for J:=0 to Bmp.Height - 1 do
begin
P:=Bmp.ScanLine[J];
PFrom:=BmpFrom.ScanLine[J];
PTo:=BmpTo.ScanLine[J];
for I:=0 to Bmp.Width * 3 - 1 do
P:=PFrom * (255 - BlendValue) div 255 + PTo * BlendValue div 255;
end;
end;
那位大哥请指导以下
我的代码如下:
procedure TfrmMain.BlendBmp(BmpFrom, BmpTo: TBitmap; var Bmp: TBitmap;
BlendValue: Byte);
var
I, J:Integer;
P, PFrom, PToByteArray;
Value:Byte;
begin
BmpFrom.PixelFormat:=pf24bit;
BmpTo.PixelFormat:=pf24bit;
Bmp.PixelFormat:=pf24Bit;
for J:=0 to Bmp.Height - 1 do
begin
P:=Bmp.ScanLine[J];
PFrom:=BmpFrom.ScanLine[J];
PTo:=BmpTo.ScanLine[J];
for I:=0 to Bmp.Width * 3 - 1 do
P:=PFrom * (255 - BlendValue) div 255 + PTo * BlendValue div 255;
end;
end;
那位大哥请指导以下