项目忙完了 没事写了个过程 混分
procedure XLightImage(Bitmap:TBitmap;x:Integer;y:Integer;r:Integer;Color:TColor);
var
Bitmap1,Bitmap2:TBitmap;
begin
Bitmap1:=TBitmap.Create;
Bitmap2:=TBitmap.Create;
Bitmap1.Assign(Bitmap);
BitBlt(Bitmap1.Canvas.Handle,0,0,Bitmap1.Width,Bitmap1.Height,Bitmap2.Canvas.Handle,0,0,DSTINVERT);
Bitmap1.Canvas.Pen.color:=Color;
Bitmap1.Canvas.Brush.Color:=Color;
Bitmap1.Canvas.Chord(x-r,y-r,x+r,y+r,0,0,0,0);
TransparentBlt(Bitmap.Canvas.Handle,0,0,Bitmap.Width,Bitmap.Height,Bitmap1.Canvas.Handle,0,0,Bitmap1.Width,Bitmap1.Height,Color);
Bitmap1.Free;
Bitmap2.Free;
end;
Bitmap 需要处理的图象
x 圆心X坐标
y 圆心Y坐标
r 圆的半径
Color 定义的透明颜色,默认为白色,但我想了X光的图象是黑白的,所以我定义的是红色。
举例
XLightImage(Bitmap1,round(Bitmap1.Width/2),round(Bitmap1.Height/2),300,clred);