HolesRemovalRgn example for Delphi
Function TForm1.DoHolesRemovalRgn ( hRegn: L_HRGN; nOffsetX: L_INT; nOffsetY: L_INT ): L_INT;
begin
{put the predefined region}
LEADImage1.SetRgnHandle( hRegn, nOffsetX, nOffsetY, L_RGN_SET );
{Remove holes}
Result:= LEADImage1.HolesRemovalRgn( );
end;