Ver Mensaje Individual
  #2  
Antiguo 03-04-2006
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Prueba esto a ver si lo solucionas:
Código Delphi [-]
#45: How can I convert color value into gray-scaled color value?

If you want to convert a colored image into same gray scaled, then you must convert the color of the each pixel by the next schema:

function RgbToGray(Source: TColor) : TColor;
var Target: Byte;
begin
  Target := Round((0.30 * GetRValue(Source)) +
        (0.59 * GetGValue(Source)) +
        (0.11 * GetBValue(Source)));
  Result := RGB(Target, Target, Target);
end;

Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita