Windows AlphaBlend函数
var BlendFunc: TBlendFunction; begin BlendFunc.BlendOp := AC_SRC_OVER; BlendFunc.BlendFlags := 0; BlendFunc.SourceConstantAlpha := TrackBar1.Position; if bit.PixelFormat = pf32bit then BlendFunc.AlphaFormat := AC_SRC_ALPHA else BlendFunc.AlphaFormat := 0; Windows.AlphaBlend(Canvas.Handle, {目标 DC} 0, 0, bit.Width, bit.Height, {目标位置与大小} bit.Canvas.Handle, {源 DC} 0, 0, bit.Width, bit.Height, {源位置与大小} BlendFunc {透明相关的结构} ); end;