the principle is to use a translucent black image to cover the source image!
procedure tmform. greybmp (image: tbitmap); <br/> var <br/> vbitmap: tbitmap; <br/> BF: tblendfunction; // alphablend transparent function structure <br/> begin <br/> vbitmap: = tbitmap. create; <br/> with vbitmap DO <br/> begin <br/> vbitmap. width: = image. width; <br/> vbitmap. height: = image. height; <br/> // create a dark image <br/> canvas. brush. color: = clblack; <br/> canvas. fillrect (rect (0, 0, vbitmap. width, vbitmap. height); </P> <p> BF. blendop: = ac_src_over; <br/> BF. sourceconstantalpha: = 160; // transparency <br/> BF. blendflags: = 0; </P> <p> Windows. alphablend (image. canvas. handle, 0, 0, vbitmap. width, vbitmap. height, <br/> vbitmap. canvas. handle, 0, 0, vbitmap. width, vbitmap. height, <br/> BF); <br/> end; <br/> vbitmap. free; <br/> end;