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;