必须自己写算法,一点一点判断是不是白色后再画上去。
比如拷贝:
type
THsColor=Packed Record
B, //兰色分量
G, //绿色分量
R, //红色分量
U:Byte; //未使用或Alpha通道
end;
THsColorArray=Array [0..8*1024-1] of THsColor;
PHsColorArray=^THsColorArray;
THsPoints=Array of PHsColorArray;
//将BMP2拷贝到BMP1上去,注意BMP1和BMP2要一样大
procedure MyCopy(BMP1,BMP2:TBitmap);
var
i,j:Integer;
p1,p2:THsPoints;
White:THsColor;
begin
BMP1.PixelFormat:=pf32Bit;
BMP2.PixelFormat:=pf32bit;
SetLength(p1,BMP1.Height);
SetLength(p2,BMP2.Height);
for i:=0 to BMP1.Height-1 do p1
:=BMP1.ScanLine;
for i:=0 to BMP2.Height-1 do p2:=BMP2.ScanLine;
white.R:=255; white.G:=255; white.B:=255; white.U:=0;
for i:=0 to BMP1.Height-1 do
for j:=0 to BMP1.Width-1 do
if Integer(P1)<>Integer(White) then
p1:=p2;
end;
实际上,您可以在BMP2上画好一些图形然后在拷贝到目标图上去,
因此只需要这样一个程序就可以完成所有操作了。[]